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 "Prestel, John D." <Jo...@ngc.com> on 2010/05/12 16:28:50 UTC
application property
Does log4cxx provide a way to set the "application" property on logging
events via, presumably, an appender's configuration? Chainsaw uses this
property to determine which tab a log message should land in. It seems
log4j provides the ability to do this, but it's not clear where log4cxx
stands.
Reference: http://markmail.org/message/5ufciwvzoqyeqc5x
Re: application property
Posted by "Jacob L. Anawalt" <ja...@geckosoftware.com>.
Doesn't it inherit from the parent thread so if you set the MDC before
spawning any new threads it has those properties?
On 2010-05-12 08:57, Dale King wrote:
> I just remembered that MDC is local to each thread, so you need to do
> this in each thread. In my case my code was a business logic DLL that
> was called by a 3rd party app which created all the threads, so I
> wrapped all my exposed entry points with MDC::put and MDC::remove.
>
--
Jacob Anawalt
Gecko Software, Inc.
janawalt@geckosoftware.com
435-752-8026
RE: application property
Posted by "Prestel, John D." <Jo...@ngc.com>.
Well that's less than ideal. I would prefer a means to set it once for
the entire process. I'll plan to experiment and poke through the source
unless someone knows how.
From: Dale King [mailto:dalewking@gmail.com]
Sent: Wednesday, May 12, 2010 10:58 AM
To: Log4CXX User
Subject: Re: application property
I just remembered that MDC is local to each thread, so you need to do
this in each thread. In my case my code was a business logic DLL that
was called by a 3rd party app which created all the threads, so I
wrapped all my exposed entry points with MDC::put and MDC::remove.
On Wed, May 12, 2010 at 10:45 AM, Prestel, John D.
<Jo...@ngc.com> wrote:
Thanks, Dale! I'll try it and report my findings.
From: Dale King [mailto:dalewking@gmail.com]
Sent: Wednesday, May 12, 2010 10:41 AM
To: Log4CXX User
Subject: Re: application property
It does allow it, since I know that I've done it. Unfortunately that was
with a previous employer so I don't have access to the code.
I don't know if you can do it through the configuration file. I think I
did it using an MDC property in my app's initialization code as in:
MDC::put( "application", "myapp" );
On Wed, May 12, 2010 at 10:28 AM, Prestel, John D.
<Jo...@ngc.com> wrote:
Does log4cxx provide a way to set the "application" property on logging
events via, presumably, an appender's configuration? Chainsaw uses this
property to determine which tab a log message should land in. It seems
log4j provides the ability to do this, but it's not clear where log4cxx
stands.
Reference: http://markmail.org/message/5ufciwvzoqyeqc5x
--
Dale King
--
Dale King
Re: application property
Posted by Dale King <da...@gmail.com>.
I just remembered that MDC is local to each thread, so you need to do this
in each thread. In my case my code was a business logic DLL that was called
by a 3rd party app which created all the threads, so I wrapped all my
exposed entry points with MDC::put and MDC::remove.
On Wed, May 12, 2010 at 10:45 AM, Prestel, John D. <Jo...@ngc.com>wrote:
> Thanks, Dale! I’ll try it and report my findings.
>
>
>
> *From:* Dale King [mailto:dalewking@gmail.com]
> *Sent:* Wednesday, May 12, 2010 10:41 AM
> *To:* Log4CXX User
> *Subject:* Re: application property
>
>
>
> It does allow it, since I know that I've done it. Unfortunately that was
> with a previous employer so I don't have access to the code.
>
> I don't know if you can do it through the configuration file. I think I did
> it using an MDC property in my app's initialization code as in:
>
> MDC::put( "application", "myapp" );
>
> On Wed, May 12, 2010 at 10:28 AM, Prestel, John D. <Jo...@ngc.com>
> wrote:
>
> Does log4cxx provide a way to set the “application” property on logging
> events via, presumably, an appender’s configuration? Chainsaw uses this
> property to determine which tab a log message should land in. It seems log4j
> provides the ability to do this, but it’s not clear where log4cxx stands.
>
> Reference: http://markmail.org/message/5ufciwvzoqyeqc5x
>
>
>
>
> --
> Dale King
>
--
Dale King
RE: application property
Posted by "Prestel, John D." <Jo...@ngc.com>.
Thanks, Dale! I'll try it and report my findings.
From: Dale King [mailto:dalewking@gmail.com]
Sent: Wednesday, May 12, 2010 10:41 AM
To: Log4CXX User
Subject: Re: application property
It does allow it, since I know that I've done it. Unfortunately that was
with a previous employer so I don't have access to the code.
I don't know if you can do it through the configuration file. I think I
did it using an MDC property in my app's initialization code as in:
MDC::put( "application", "myapp" );
On Wed, May 12, 2010 at 10:28 AM, Prestel, John D.
<Jo...@ngc.com> wrote:
Does log4cxx provide a way to set the "application" property on logging
events via, presumably, an appender's configuration? Chainsaw uses this
property to determine which tab a log message should land in. It seems
log4j provides the ability to do this, but it's not clear where log4cxx
stands.
Reference: http://markmail.org/message/5ufciwvzoqyeqc5x
<http://markmail.org/message/5ufciwvzoqyeqc5x>
--
Dale King
Re: application property
Posted by Dale King <da...@gmail.com>.
It does allow it, since I know that I've done it. Unfortunately that was
with a previous employer so I don't have access to the code.
I don't know if you can do it through the configuration file. I think I did
it using an MDC property in my app's initialization code as in:
MDC::put( "application", "myapp" );
On Wed, May 12, 2010 at 10:28 AM, Prestel, John D. <Jo...@ngc.com>wrote:
> Does log4cxx provide a way to set the “application” property on logging
> events via, presumably, an appender’s configuration? Chainsaw uses this
> property to determine which tab a log message should land in. It seems log4j
> provides the ability to do this, but it’s not clear where log4cxx stands.
>
> Reference: *http://markmail.org/message/5ufciwvzoqyeqc5x*<http://markmail.org/message/5ufciwvzoqyeqc5x>
>
>
--
Dale King
Re: application property
Posted by Dale King <da...@gmail.com>.
Which is yet another reason why we desperately need a new release of
Chainsaw. Most of the network appenders don't even work with the current. I
tried to build chainsaw a while back, but could not get it to build.
On Wed, May 12, 2010 at 11:13 AM, Scott Deboy <sc...@gmail.com> wrote:
> Chainsaw svn head now adds the receiver name as a property, so you could
> use that to route events in Chainsaw. I think you also get a property for
> network appenders containing local socket and port info.
>
> Scott
>
>
>
> On May 12, 2010, at 7:28 AM, "Prestel, John D." <Jo...@ngc.com>
> wrote:
>
> Does log4cxx provide a way to set the “application” property on logging
> events via, presumably, an appender’s configuration? Chainsaw uses this
> property to determine which tab a log message should land in. It seems log4j
> provides the ability to do this, but it’s not clear where log4cxx stands.
>
> Reference: *http://markmail.org/message/5ufciwvzoqyeqc5x*<http://markmail.org/message/5ufciwvzoqyeqc5x>
>
>
--
Dale King
Re: application property
Posted by Scott Deboy <sc...@gmail.com>.
Chainsaw svn head now adds the receiver name as a property, so you
could use that to route events in Chainsaw. I think you also get a
property for network appenders containing local socket and port info.
Scott
On May 12, 2010, at 7:28 AM, "Prestel, John D." <Jo...@ngc.com>
wrote:
> Does log4cxx provide a way to set the “application” property on
> logging events via, presumably, an appender’s configuration? Chainsa
> w uses this property to determine which tab a log message should lan
> d in. It seems log4j provides the ability to do this, but it’s not c
> lear where log4cxx stands.
>
> Reference: http://markmail.org/message/5ufciwvzoqyeqc5x
>