Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > log4j writing to multiple logs conditionally

Reply
Thread Tools

log4j writing to multiple logs conditionally

 
 
Arvind
Guest
Posts: n/a
 
      05-23-2004
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.
 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      05-24-2004

"Arvind" <> schrieb im Newsbeitrag
news: om...
> 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

 
Reply With Quote
 
 
 
 
Rajesh Tihari
Guest
Posts: n/a
 
      05-24-2004
Hi Arvind

http://logging.apache.org/log4j/docs/manual.html is what you need to
read. It will help you solve the probelm you have described below very
easily.

Cheers
Rajesh T

(Arvind) wrote in message news:<. com>...
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Log4j configuration: how to suppress internal logs from Log4j? joes Java 1 08-06-2005 04:31 PM
WinXP Home SP2 logs in then right away logs off Andrew Computer Support 15 10-19-2004 09:45 AM
Win XP SP2 Logs in then Logs out awallwork at sign gmail dot com Computer Support 2 10-16-2004 08:19 PM
Win XP SP2 Logs in then Logs out Andrew Computer Support 2 10-16-2004 04:27 PM
WinXP Home SP2 Logs on then Logs off awallwork at sign gmail dot com Computer Support 2 10-16-2004 02:28 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57