You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Pete Rowley <pe...@openrowley.com> on 2004/05/20 20:32:56 UTC

Process name in log format

I am trying to get a process name in a log format, however I don't see nay documented way to do this.  I suppose it would be possible to use NDCs or MDCs for this, but that seems a little heavy handied just for this (actually requiring code to support).  Is there some other way of achieving this, perhaps an conversion specifier I have over looked?

Regards
---
Pete

Re: Process name in log format

Posted by Lennart Goedhart <le...@omnibase.com.au>.
Looking through the source code, doesn't look like it (patternparser.cpp
contains the supported conversion specifiers). Also, process name is not a
part of the loggingevent class.
Looks like you'll have to strip argv[0] down to the process name only, and
use an MDC/NDC to do it.

----- Original Message ----- 
From: Pete Rowley
To: Log4CXX User
Sent: Friday, May 21, 2004 4:32 AM
Subject: Process name in log format


I am trying to get a process name in a log format, however I don't see nay
documented way to do this.  I suppose it would be possible to use NDCs or
MDCs for this, but that seems a little heavy handied just for this (actually
requiring code to support).  Is there some other way of achieving this,
perhaps an conversion specifier I have over looked?

Regards
---
Pete