logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ram <ram_ku...@yahoo.co.in>
Subject Re: log4j properteis set up for different packages
Date Mon, 20 Jul 2009 11:14:12 GMT
Hi jocob,
   Thanks, for the reply. I tried with your suggestion, but still logs are comming in both
the files
  Here is the updated log4j which i tried

log4j.rootLogger=DEBUG, stdout, WEB, R, ALERTS,
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n



 log4j.appender.WEB=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.WEB.File=C:/logs/a.log
 log4j.appender.WEB.DatePattern='.'yyyy-MM-dd-a
 log4j.appender.WEB.layout=org.apache.log4j.PatternLayout
 log4j.appender.WEB.layout.ConversionPattern=%d %p [%t] %c.%M() - %m%n
 log4j.logger.com.org.do.presentation.don =debug,WEB
 log4j.additivity.WEB=false



 log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.R.File=C:/logs/b.log
 log4j.appender.R.DatePattern='.'yyyy-MM-dd-a
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%d %p [%t] %c.%M() - %m%n
 log4j.logger.com.org.do.presentation.application=debug,WEB
 log4j.additivity.R=false
 

com.org.do.presentation.application should go to b.log 

 log4j.logger.com.org.do.presentation.don should go to a.log
  


Thanks & Regards,
Ram
    

--- On Fri, 17/7/09, Jacob Kjome <hoju@visi.com> wrote:

From: Jacob Kjome <hoju@visi.com>
Subject: Re: log4j properteis set up for different packages
To: "Log4J Users List" <log4j-user@logging.apache.org>
Date: Friday, 17 July, 2009, 10:40 PM

Please correct your log4j.properties.  It's got two definitions for "rootLogger".  And one
has the appender before the logging level which is wrong.

In any case, it looks like in both cases you are attempting a add, at least, the R appender
to the root logger.  If you do that, then all child loggers will inherit it and log to it. 
If you expect certain child loggers not to log to it, then either can't set it at the root
logger or you need to set additivity to false for the loggers you don't want to go to the
R appender.

Jake

On Fri, 17 Jul 2009 17:48:18 +0530 (IST)
 Seetha Rama Krishna <ram_kurra@yahoo.co.in> wrote:
> 
> Hi,
>   I am having two war (a.war, b.war)files each one is having its one log4j.properties.
so two log files(a.log and b.log) are getting generated
> 
>   Previously, these log4j.properties are there in each of the war files. so there
is no problem is generating the log files.
> 
>   I have removed these two log4j.properties from made it one log4j.proeprties and
log information
> has to go to with respect the package  
> com.org.do.presentation.don  and its subsequent  packages com.org.do.presentation.don.application,
>         com.org.do.presentation.don.application.car like has to go a.log
> 
> com.org.do.presentation.admin.struts  and its subsequent packages pacakages to go b.log
> 
> 
>   Now the problem, log information is not populated as expected.
> 
> 
> here is log 4j.properties
> 
> log4j.properties
> 
> 
> 
> log4j.rootLogger=DEBUG, stdout, WEB, R, ALERTS, 
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
> 
> 
> log4j.logger.com.org.do.presentation.don =debug,WEB
> log4j.appender.WEB=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.WEB.File=C:/logs/a.log
> log4j.appender.WEB.DatePattern='.'yyyy-MM-dd-a
> log4j.appender.WEB.layout=org.apache.log4j.PatternLayout
> log4j.appender.WEB.layout.ConversionPattern=%d %p [%t] %c.%M() - %m%n
> #log4j.additivity.WEB=false
> 
> log4j.rootLogger=R,debug
> 
> log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.R.File=C:/logs/b.log
> log4j.appender.R.DatePattern='.'yyyy-MM-dd-a
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%d %p [%t] %c.%M() - %m%n
> #log4j.additivity.R=false
> 
> 
> 
> -------------------------------------
> # Individual Class/Package Log Settings
> # -------------------------------------
> 
> log4j.logger._jsps=DEBUG
> 
> log4j.logger.com.org=DEBUG
> log4j.logger.com.org.doe=DEBUG
> 
> log4j.logger.org.apache=ERROR
> 
> 
>      Can any let me know where i am doing mistake
> 
> 
> 
> Thanks & Regards,
> Ram
> 
> 
>      See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz.
http://in.buzz.yahoo.com/


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




      Love Cricket? Check out live scores, photos, video highlights and more. Click here http://cricket.yahoo.com
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message