Re: log4j
Re: log4j
- Subject: Re: log4j
- From: Lachlan Deck <email@hidden>
- Date: Thu, 24 May 2012 21:08:05 +1000
On 24/05/2012, at 7:00 PM, Ron X wrote:
> hi4all
>
> i have currently setted up log4j as:
>
> #============================
> log4j.rootLogger = COPY, INFO, A1
>
> log4j.appender.COPY = org.apache.log4j.FileAppender
> log4j.appender.COPY.layout = er.extensions.logging.ERXPatternLayout
> log4j.appender.COPY.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} %c{1} (%F:%L) %x - %m%n
> log4j.appender.COPY.File=/tmp/copy.log
> log4j.appender.COPY.MaxFileSize=10MB
> log4j.appender.COPY.MaxBackupIndex=5
>
> log4j.logger.com.ls.processing = COPY
> #=============================
>
> but no file /tmp/copy.log was created...
>
> how can i set up logging current class/package to special file?
> _______________________________________________
Have a look at the example log4j setup when you create a new project (see the Properties file), or look at example Wonder projects.
From a few years back I had something like this:
----------------------------------------
# log4j appender and formatting
log4j.rootLogger=INFO, A1, myMail
log4j.loggerFactory=er.extensions.logging.ERXLogger$Factory
# A1 is a ConsoleAppender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L) %x -%m%n
# A2 is a DailyRollingFileAppender
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=/var/log/webobjects_apps/my.woa.log
log4j.appender.A2.datePattern='.'yyyy-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L) %x -%m%n
# myMail is the SMTPAppender
log4j.appender.myMail=org.apache.log4j.net.SMTPAppender
log4j.appender.myMail.Threshold=ERROR
log4j.appender.myMail.BufferSize=10
log4j.appender.myMail.From=email@hidden
log4j.appender.myMail.To=email@hidden
log4j.appender.myMail.SMTPHost=localhost
log4j.appender.myMail.Subject=Log4J Error Message (MyApp.woa)
log4j.appender.myMail.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.myMail.layout.ConversionPattern=%r %-5p %d{ISO8601} [%t] %n%n-->%W{n[i:p s]}%n %n%n (%C, %M, %F:%L) - %n%n%m%n
Lachlan Deck
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >log4j (From: Ron X <email@hidden>) |