return to first page linux journal archive
keywordscontents

Listing 15. Writing to System Log

#! /usr/local/bin/python
import syslog
syslog.syslog('syslog junkie: the script has just got woken up')
# some code
for a in ['a', 'b', 'c']:
    b = 'syslog junkie: I found letter '+a
    syslog.syslog(b)
syslog.syslog('syslog junkie: the script goes to sleep now, bye,
bye!')