logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken....@bmwna.com
Subject RE: I cannot figure out where my extra message line comes from on the console
Date Wed, 12 Nov 2003 23:00:41 GMT
Paul -

Are you sure about that?  I thought that only happened with
BasicConfigurator.configure() (no params).

  /**
     Add <code>appender</code> to the root category.
     @param appender The appender to add to the root category.
  */
  static
  public
  void configure(Appender appender) {
    Logger root = Logger.getRootLogger();
    root.addAppender(appender);
  }


Maybe she is picking up a log4j config file from the classpath?

Ken
  



> -----Original Message-----
> From: Paul Smith [mailto:paul.smith@lawlex.com.au]
> Sent: Wednesday, November 12, 2003 5:54 PM
> To: Log4J Users List
> Subject: Re: I cannot figure out where my extra message line 
> comes from
> on the console
> 
> 
> The BasicConfigurator already creates and configures a ConsoleAppender
> automatically, so the other one that you are adding is 
> doubling up. (The
> output with the time is your appender is your one I think).
> 
> cheers,
> 
> Paul
> 
> On Thu, 2003-11-13 at 09:40, Chang, Betty wrote:
> > Hi all--  (I'm a new user, so please forgive).
> > 
> >  
> > 
> > Here's my simple program:
> > 
> >  
> > 
> > ----------------------------------
> > 
> >  
> > 
> > import org.apache.log4j.*;
> > 
> >  
> > 
> > public class MyApp
> > 
> > {
> > 
> >             static Logger logger = Logger.getLogger("myapp");
> > 
> >             public static void main (String[] args)
> > 
> >             {
> > 
> >                         PatternLayout pl = new 
> PatternLayout("%-5p %d
> > %m%n");
> > 
> >                         ConsoleAppender cappnd = new
> > ConsoleAppender(pl);
> > 
> >                         BasicConfigurator.configure(cappnd);
> > 
> > 
> >                         
> > 
> >                         logger.info("here");
> > 
> >             }
> > 
> > }
> > 
> >  
> > 
> > And here's my output :
> > 
> >  
> > 
> >  - here
> > 
> > INFO  2003-11-12 14:38:53,530 here
> > 
> >  
> > 
> > I cannot figure where the extra line with "- here " on my 
> console comes
> > from.    
> > 
> > I must be doing something silly.  
> > 
> >  
> > 
> > Thanks
> > 
> >  
> > 
> > Betty
> > 
> >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 

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


Mime
View raw message