How to check if something was written to /dev/log?

6,591

I think handler = SysLogHandler(address='/dev/log')

might be what you are missing. you should find output in /var/log/syslog.

Source: https://stackoverflow.com/questions/3968669/how-to-configure-logging-to-syslog-in-python

Share:
6,591

Related videos on Youtube

wasd
Author by

wasd

Trying to move from pythonier to pythonista =)

Updated on September 18, 2022

Comments

  • wasd
    wasd over 1 year

    I'm writing application which is intended to log to syslog. In documentation for SysLogHandler (python, logging module) it is said that for UNIX systems it's usually '/dev/log'. I need to test if something was written there, how can one read the content of '/dev/log'?

    I have Ubuntu 14.04

    • Sylvain Pineau
      Sylvain Pineau almost 8 years
      On Ubuntu syslog file is /var/log/syslog. Do you need to check if something new has been logged to it from another python script?
  • wasd
    wasd almost 8 years
    Aha, so I need to specify address as '/dev/log/' but to see if something was logged I need to check /var/log/syslog!