Django request logging with rsyslog

In my original post about logging Django requests, I had only tried my code with syslog-ng. It works fine with rsyslog as well: the logging output was accepted and routed perfectly.

Here's my rsyslog configuration snippet:

$template fcFile,"/var/log/django/fc/%YEAR%%MONTH%%DAY%.log"
$outchannel fcLog,$fcFile,2000000000,echo foo

!fairview
*.*     $fcLog

Nice and concise. Note the outchannel, though: don't do that in production; use a real log rotation script.

Comments have been turned off for this article, but you can always contact us about it.