You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Rajesh <ra...@gmail.com> on 2009/07/16 14:30:12 UTC

Log messages are getting written into both Systemout log and application log

Hi

  I am using log4j once of my biggest issue is  my messages are routed to both 
sysout and log file.

 I use the following code to create logger object. I have not attached my 
config file instead i m hardcoding the values

cat = Category.getInstance(application name);
Layout layout = new PatternLayout("%d %c %-5p - %m%n");
async.addAppender(new DailyRollingFileAppender(
					layout, "application.log","'.'yyyy-MM-
dd"));

cat.addAppender(async);
cat.setPriority(Priority.toPriority("ERROR"));


above code has been used.

 This code runs in websphere app server. And my web application uses many other 
jar files like axis.jar and commons-logging.jar. 

I donot understand why my logs are getting written into both application log 
and Sysout log

Please suggest me some idea

if i use the below code .will it solve the problem
cat.setAddivity(false)

Thanks
Rajesh.J


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