log4j writing to multiple logs conditionally

Discussion in 'Java' started by Arvind, May 23, 2004.

  1. Arvind

    Arvind Guest

    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.
     
    Arvind, May 23, 2004
    #1
    1. Advertising

  2. "Arvind" <> schrieb im Newsbeitrag
    news:...
    > 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
     
    Robert Klemme, May 24, 2004
    #2
    1. Advertising

  3. 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:<>...
    > 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.
     
    Rajesh Tihari, May 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexandra Stehman

    eclipse, junit, log4j, & finding log4j.xml

    Alexandra Stehman, Jan 19, 2004, in forum: Java
    Replies:
    0
    Views:
    5,804
    Alexandra Stehman
    Jan 19, 2004
  2. Alex Hunsley
    Replies:
    2
    Views:
    12,987
    =?ISO-8859-15?Q?Fr=E9d=E9ric_G=E9din?=
    May 28, 2004
  3. Rodolfo
    Replies:
    0
    Views:
    967
    Rodolfo
    Jul 12, 2004
  4. joes
    Replies:
    1
    Views:
    2,215
  5. Miguelon cosapi data

    Login IP remote in the logs Log4J

    Miguelon cosapi data, Nov 28, 2006, in forum: Ruby
    Replies:
    1
    Views:
    263
    Miguelon cosapi data
    Nov 28, 2006
Loading...

Share This Page