You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by George Sebastian <jo...@gmail.com> on 2005/12/01 15:02:10 UTC

Putting additional info in LoggingEvent

Hi
I have a requirement for the detailed logging of an application.

And my application consist of different modules and each module is loaded by
a single process.

There are also different threads running with the application

But I have some threads which interacts with different modules of my app.

I need each module is some what big (but runs in a single process) so I like
to have some common naming (like component name) for a log request so that i
can easily identify from which module the request came from.

How can I put such a kind of information using log4j's LoggingEvent.

With very my little knowledge I feel like the MDC and NDC cannot be used
here as they are defined per thread (Since my app have single
thread  accessing different components sequentially.

Can someone please correct me if I am wrong.

If i am right is there any other solution to this problem.

Like extending LoggingEvent  to put my own custom event or so

Please help

Thanks
-George Sebastian

Re: Putting additional info in LoggingEvent

Posted by Curt Arnold <ca...@apache.org>.
On Dec 1, 2005, at 8:02 AM, George Sebastian wrote:

> Hi
> I have a requirement for the detailed logging of an application.
>
...
>
> I need each module is some what big (but runs in a single process)  
> so I like
> to have some common naming (like component name) for a log request  
> so that i
> can easily identify from which module the request came from.

Maybe you are getting at something else, but that appears to be  
exactly what the logger name is designed to do.  There may be some  
confusion since a class name is often used as a logger name, but you  
are completely free to use a different strategy.  The logger name  
should be thought of as a "topic" of logging messages and it is up to  
you to design a set of topics that make sense for your application.

> Like extending LoggingEvent  to put my own custom event or so
>

There is nothing but pain down that path.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org