Created
February 26, 2025 16:57
-
-
Save izacarias/2d90df298a017ff58ef379992aea1fa3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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