On 2013-11-22 13:46:50, Yaroslav Halchenko wrote:
> what about making it even better:
> 
> formatter = logging.Formatter("%(name)s[%(process)d]: %(levelname)-7s 
> %(message)s")

> so we report the pid as well, stay together with the name while still keeping
> indentation for the levelname conssitent for easier visual parsing.  you can
> try attached script to "play" with it.. it should look like

Yeah, it's nice touch to include the pid.  I would still suggest 
using the syslog level instead of encoding it into the message 
part.

At work we filter on priority and include that the level as a 
tagged field like this with syslog-ng:

template t_message {
        template("$ISODATE $HOST ${MSGHDR}priority=$PRIORITY $MSG\n");
        template_escape(no);
};

so we would end with messages like this:

Nov 22 13:45:58 novo fail2ban[6554]: priority=info INFO    info msg kjasdhfk 
jasdh fkjasdh fkjasdh fkjsdh f 
laksdjflkasjdflkajsdklfjasdlkfjaslkdjflaskdjflkasdjfklasdjfk


/Allan
-- 
Allan Wind
Life Integrity, LLC
<http://lifeintegrity.com>


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to