I'm a Python newbie, and the following code wrote the following messages to /var/log/syslog
May 8 22:14:22.531833 almach <info>./test.txt: HELLO 01 May 8 22:14:22.531853 almach <info>./test.txt: HELLO 02 May 8 22:14:22.531860 almach <info>./test.txt: HELLO 03 So, why
Messages were written to /var/log/syslog and not ./test.txt?
setlogmask(0) was ineffective, and message "HELLO 02" was written to syslog?
Also, I tested the code in a Linux machine that had demon rsyslogd running, and it might have affected my code somehow.
from syslog import syslog, setlogmask, LOG_INFO, openlog openlog('./test.txt') syslog(LOG_INFO, "HELLO 01") setlogmask(0) syslog(LOG_INFO, "HELLO 02") setlogmask(255) syslog(LOG_INFO, "HELLO 03")
setlogmask(0). The mask must be a bitwise combination of the symbolic constants.