I'm looking at how to log to syslog from within my Python app, and I found there are two ways of doing it:
Which is the best option to use, advantages/disadvantages of each one, etc, because I really don't know which one should I use.
syslog(message) or syslog. syslog(priority, message) This method is used to send a string type message to the system logger. Each message has a priority. The priority argument can be used to set the priority of the given message.
System Logging Protocol (Syslog) is a way network devices can use a standard message format to communicate with a logging server. It was designed specifically to make it easy to monitor network devices. Devices can use a Syslog agent to send out notification messages under a wide range of specific conditions.
syslog.syslog()
can only be used to send messages to the local syslogd. SysLogHandler
can be used as part of a comprehensive, configurable logging subsystem, and can log to remote machines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With