This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thread13
Recipients thread13
Date 2017-02-28.10:42:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488278549.76.0.307223036696.issue29675@psf.upfronthosting.co.za>
In-reply-to
Content
On Ubuntu LTS 16.04, SysLogHandler with a custom formatter does not seem to expand loglevel/levelno fields properly, when there are square brackets ( see the attached examples ). Instead, it seems to replace '[%(loglevel)s]' with a '[pid]', and '%(loglevel)s' with 'LOGLEVEL[pid]' .

To test, run 'journalctl -f | grep test_test_test' on one console, and the attached files on another. The output for 'bad.py' looks as follows:
===
Feb 28 21:30:05 hostname <test_test_test>[7117]: logging was configured for process <7117>
===

And should have looked like:
===
Feb 28 21:30:05 hostname <test_test_test>[INFO]: logging was configured for process <7117>
===

For 'good.py', the output is as follows:
===
Feb 28 21:30:04 hostname <test_test_test>INFO[7114]: logging was configured for process <7114>
===

and should have probably been: 
===
Feb 28 21:30:04 hostname <test_test_test>INFO: logging was configured for process <7114>
===

Kind regards, /t13
History
Date User Action Args
2017-02-28 10:42:29thread13setrecipients: + thread13
2017-02-28 10:42:29thread13setmessageid: <1488278549.76.0.307223036696.issue29675@psf.upfronthosting.co.za>
2017-02-28 10:42:29thread13linkissue29675 messages
2017-02-28 10:42:29thread13create