logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chang, Betty" <bch...@datasweep.com>
Subject RE: I cannot figure out where my extra message line comes from onthe console
Date Wed, 12 Nov 2003 23:08:59 GMT
Hi --   I removed my ConsoleAppender, and just call BasicConfigurator()
with no parameters,  and I STILL get that extra line.
Here's the code:

import org.apache.log4j.*;
public class MyApp
{
	static Logger logger = Logger.getLogger("myapp");

	public static void main (String[] args)
	{
	
		BasicConfigurator.configure();		
		logger.info("here");
	}
}

And, here's the output:

- here
0 [main] INFO myapp  - here

As you can see -- I now have the default format line,  but where is that
extra first line coming from???

Betty



-----Original Message-----
From: Paul Smith [mailto:paul.smith@lawlex.com.au] 
Sent: Wednesday, November 12, 2003 2:54 PM
To: Log4J Users List
Subject: Re: I cannot figure out where my extra message line comes from
onthe 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