log4j writing to multiple logs conditionally

A

Arvind

Hi,

Is there a way log4j could be configured to write to different files
conditionally? Let me try to explain what I need more clearly.

The application iam working on , consists of multiple Message Driven
Beans (the same can be substituted by multiple SessionBeans), each
driving a separate application. Each of these receive requests which
are ofcourse different from each other. Currently all the logs go into
a single file. I would like to know if we could configure log4j to
write it to separate files based on which Bean receives the
message/request.

Please let me know if I have been vague, and wld like me to explain it
in more detail.

Thanks
Arvind.
 
R

Robert Klemme

Arvind said:
Hi,

Is there a way log4j could be configured to write to different files
conditionally? Let me try to explain what I need more clearly.

The application iam working on , consists of multiple Message Driven
Beans (the same can be substituted by multiple SessionBeans), each
driving a separate application. Each of these receive requests which
are ofcourse different from each other. Currently all the logs go into
a single file. I would like to know if we could configure log4j to
write it to separate files based on which Bean receives the
message/request.

Please let me know if I have been vague, and wld like me to explain it
in more detail.

Dunno about log4j but with java.util.logging you can have a mulitude of
loggers that all have their own output channel. I assume similar things
can be done with log4j.

So the way would be to have each bean use its own logger that writes to a
different output.

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top