On Monday 24 October 2005 17:28, Samuel Le Berrigaud wrote:
> # the root logger is OFF (OFF doesn't mean anything to log4j)
> log4j.rootLogger = OFF
>
> # logging your package
> log4j.logger.yourpackage = debug, stdout, R

many thanks for the answer it works fine.
Just a strange behavior about actions. It logs but with a different layout

class com.mydomain.util.InitLog:
INFO 2005-10-24 18:11:33,553 com.mydomain.util.InitLog (InitLog.java:22) - 
START web! 
(perfect)
class it.
Oct 24, 2005 6:11:39 PM com.mydomain.action.LoginAction execute
INFO: test action
(quite fine but with a different layout)

in log4j.properties:
#log4j.rootLogger=OFF
log4j.rootLogger = OFF
log4j.logger.com.domain = debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p %d %c (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/home/lorenzo/Desktop/example.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p %d %c (%F:%L) - %m%n

It would be nice if com.mydomain.action.LoginAction use this pattern"%5p %d %c 
(%F:%L) - %m%n"

anyway many thanks

regards Lorenzo

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to