Mergifyio / daiquiri

Python library to easily setup basic logging functionality
Apache License 2.0
333 stars 25 forks source link

[Syslog] no logs into local7 #7

Closed nlamirault closed 7 years ago

nlamirault commented 7 years ago

hi, using Python 3 syslog :

>>> import syslog
>>> syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_LOCAL7)
>>> syslog.syslog("test")

and logs :

$ tail -f /var/log/local7.log
...
Jul  5 15:12:50 cloud-nimbus02-prp python3.4[6636]: test

i try your library using the syslog output :

>>> import daiquiri
>>> daiquiri.setup(outputs=(
...         daiquiri.output.Syslog("cmdb", "LOG_LOCAL7"),
...         daiquiri.output.STDERR,
... ))
>>> logger = daiquiri.getLogger("foo")
>>> logger.info("daiquiri")

There is no log in the local7.log file. Any idea ?

jd commented 7 years ago

@nlamirault if you use .info you need to set the level to logging.INFO by default:

daiquiri.setup(
    level=logging.INFO,
    outputs=(
        daiquiri.output.Syslog("cmdb", "LOG_LOCAL7"),
        daiquiri.output.STDERR,
))

Or use logger.error to test instead. Is it better?

nlamirault commented 7 years ago

Perfect ! Thanks