[issue1647654] No obvious and correct way to get the time zone offset
Max Arnold added the comment: Our region recently switched to another timezone and I've noticed similar issue while using Mercurial. There is some (hopefully) useful details: http://mercurial.selenic.com/bts/issue2511 -- nosy: +LwarX ___ Python tracker <http://bugs.python.org/issue1647654> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6444] multiline exception logging via syslog handler
Max Arnold added the comment: Sorry for long delay, I was on vacation. I have installed sysklogd, metalog and syslog-ng on a virtual machine and executed test script. First two daemons log exception as single concatenated line. Syslog-ng splits it as described in original report. Do you suggest to file bug report to syslog-ng maintainer? -- ___ Python tracker <http://bugs.python.org/issue6444> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6444] multiline exception logging via syslog handler
Max Arnold added the comment: I'll try to investigate this issue a bit more in a few days. I plan to compare sysklogd, sylog-ng and probably metalog. Maybe this issue is specific to syslog-ng only. -- status: pending -> open ___ Python tracker <http://bugs.python.org/issue6444> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6444] multiline exception logging via syslog handler
Max Arnold added the comment: Which syslog daemon you use? I've encountered this on syslog-ng. There is stripped down syslog-ng.conf (messages with facility LOCAL0 are routed to /var/log/local.log and all others to /var/log/default.log): #-- options { chain_hostnames(off); use_dns (no); use_fqdn (no); sync(0); stats(43200); }; source src { unix-stream("/dev/log" max-connections(256)); internal(); file("/proc/kmsg"); }; template t_filetmpl { template("$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC $HOST $MSG\n"); }; # Create destinations destination default { file("/var/log/default.log" template(t_filetmpl) ); }; destination local { file("/var/log/local.log" template(t_filetmpl) ); }; # Create filters filter local { facility(local0) or program("^root.*"); }; # Connect source and destinations log { source(src); filter(local); destination(local); flags(final); }; log { source(src); destination(default); }; #-- And this is result: # first line landed in /var/log/local.log Jul 15 23:52:02 localhost root: ERROR /14 division by zero # remaining ones in /var/log/default.log Jul 15 23:52:02 localhost Traceback (most recent call last): Jul 15 23:52:02 localhost File "./test.py", line 12, in Jul 15 23:52:02 localhost a = 1/0 Jul 15 23:52:02 localhost ZeroDivisionError: integer division or modulo by zero Results like yours (which are not very readable but still appropriate for me) I get only when logging performed via udp socket. -- status: pending -> open ___ Python tracker <http://bugs.python.org/issue6444> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6444] multiline exception logging via syslog handler
Max Arnold added the comment: > Why can't you either use %r in the format string, or define your own handler/formatter to do exactly what you want? I'm describing default behaviour of logger.exception(). Out of the box (with SyslogHandler and "/dev/log") I'm unable to use it, because of this problem. Can you please explain in more details how I can change my code to correcly log exceptions? For example: import logging, logging.handlers log = logging.getLogger() h = logging.handlers.SysLogHandler('/dev/log', logging.handlers.SysLogHandler.LOG_LOCAL0) h.setFormatter(logging.Formatter('%(name)s: %(levelname)s %(funcName)s/%(lineno)d %(message)s')) log.addHandler(h) try: a = 1/0 except: log.exception('division by zero') -- status: pending -> open ___ Python tracker <http://bugs.python.org/issue6444> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6444] multiline exception logging via syslog handler
New submission from Max Arnold : I use syslog message routing mechanism to log high-priority messages from my python code to separate file. When exceptions are logged, only first line routed to specified file, and the rest goes in /var/log/messages. Such problem exists when SyslogHandler instantiated with "/dev/log". If logging is performed to remote host via udp socket, then exception logged as one long string with all lines being concatenated. Probably multiline log messages should be automatically splitted and logged line-by-line with the same facility, severity and program name. Also it will be good to have special formatter tag which expands as empty string in first logged line, and as user-defined string in remaining ones. This can simplify automated log analysis. -- components: Library (Lib) messages: 90307 nosy: LwarX severity: normal status: open title: multiline exception logging via syslog handler type: behavior versions: Python 2.5 ___ Python tracker <http://bugs.python.org/issue6444> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711603] syslog syscall support for SysLogLogger
Max Arnold added the comment: Sorry, I've read your first reply too fast and incorrectly interpreted it as recommendation to use stream handler with /dev/log. Anyway, thank you for clarification. -- ___ Python tracker <http://bugs.python.org/issue1711603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711603] syslog syscall support for SysLogLogger
Max Arnold added the comment: Is it safe to use single handler instance in multiple loggers or single stream in multiple handlers? -- ___ Python tracker <http://bugs.python.org/issue1711603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711603] syslog syscall support for SysLogLogger
Max Arnold added the comment: Can I vote for this issue? Many systems with syslog aren't configured to listen on UDP socket and thus out of the box SysLogHandler does not work. -- nosy: +LwarX ___ Python tracker <http://bugs.python.org/issue1711603> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com