Skip to content

Instantly share code, notes, and snippets.

@izacarias
Created February 26, 2025 16:57
Show Gist options
  • Save izacarias/2d90df298a017ff58ef379992aea1fa3 to your computer and use it in GitHub Desktop.
Save izacarias/2d90df298a017ff58ef379992aea1fa3 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import logging
from logging.handlers import SysLogHandler
syslogRemote = SysLogHandler(address=('127.0.0.1', 514))
remote_logger = logging.getLogger('remote_logging')
remote_logger.addHandler(syslogRemote)
remote_logger.setLevel(logging.INFO)
remote_logger.info('This is a remote log message')
remote_logger.info('It works just as the default logger ;-)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment