Logging

Discussion in 'Java' started by Ilya Lakhmitski, Sep 28, 2011.

  1. Is there a way do not print to the console the message:

    log4j:WARN No appenders could be found for logger?
     
    Ilya Lakhmitski, Sep 28, 2011
    #1
    1. Advertising

  2. Ilya Lakhmitski

    Tobi Guest

    On 28 Sep., 08:15, Ilya Lakhmitski <> wrote:
    > Is there a way do not print to the console the message:
    >
    > log4j:WARN No appenders could be found for logger?


    It looks like you're using the log4j framework but didn't configured
    any appender. Could you provide some more information (e.g. the log4j
    configuration)?
     
    Tobi, Sep 29, 2011
    #2
    1. Advertising

  3. Ilya Lakhmitski

    Arne Vajhøj Guest

    On 9/28/2011 2:15 AM, Ilya Lakhmitski wrote:
    > Is there a way do not print to the console the message:
    >
    > log4j:WARN No appenders could be found for logger?


    If you want log output, then configure log4j properly
    (see the log4j docs on how to do that).

    If you don't want that, then put this in the top
    of your main:

    Logger.getRootLogger().addAppender(new NullAppender());

    Arne
     
    Arne Vajhøj, Oct 1, 2011
    #3
  4. On 10/01/2011 03:18 AM, Arne Vajhøj wrote:
    > On 9/28/2011 2:15 AM, Ilya Lakhmitski wrote:
    >> Is there a way do not print to the console the message:
    >>
    >> log4j:WARN No appenders could be found for logger?

    >
    > If you want log output, then configure log4j properly
    > (see the log4j docs on how to do that).
    >
    > If you don't want that, then put this in the top
    > of your main:
    >
    > Logger.getRootLogger().addAppender(new NullAppender());


    Even that can be controlled via configuration. I would prefer that
    approach because it leaves the option to enable logging if that should
    be necessary.

    Kind regards

    robert
     
    Robert Klemme, Oct 1, 2011
    #4
  5. Ilya Lakhmitski

    Arne Vajhøj Guest

    On 10/1/2011 5:23 AM, Robert Klemme wrote:
    > On 10/01/2011 03:18 AM, Arne Vajhøj wrote:
    >> On 9/28/2011 2:15 AM, Ilya Lakhmitski wrote:
    >>> Is there a way do not print to the console the message:
    >>>
    >>> log4j:WARN No appenders could be found for logger?

    >>
    >> If you want log output, then configure log4j properly
    >> (see the log4j docs on how to do that).
    >>
    >> If you don't want that, then put this in the top
    >> of your main:
    >>
    >> Logger.getRootLogger().addAppender(new NullAppender());

    >
    > Even that can be controlled via configuration. I would prefer that
    > approach because it leaves the option to enable logging if that should
    > be necessary.


    There is a point in that.

    Arne
     
    Arne Vajhøj, Oct 1, 2011
    #5
    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. Stefan Siegl
    Replies:
    0
    Views:
    988
    Stefan Siegl
    Aug 27, 2003
  2. janne
    Replies:
    0
    Views:
    9,626
    janne
    Sep 10, 2004
  3. Christoph Haas
    Replies:
    0
    Views:
    484
    Christoph Haas
    Jun 12, 2006
  4. Christoph Haas
    Replies:
    1
    Views:
    492
    Vinay Sajip
    Jun 14, 2006
  5. johnny
    Replies:
    1
    Views:
    674
    Dennis Lee Bieber
    Dec 12, 2006
Loading...

Share This Page