You may want to log4j file to look like that then

# the root logger is OFF (OFF doesn't mean anything to log4j)
log4j.rootLogger = OFF

# logging your package
log4j.logger.yourpackage = debug, stdout, R

## then the rest of your appenders

SaM

On 10/24/05, Lorenzo Sicilia <[EMAIL PROTECTED]> wrote:
>
> Hi to all,
>
> I have a webapplication with struts where I want use log4j.
>
> in my log4j.properties:
> log4j.rootLogger=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 [%t] (%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=%p %t %c - %m%n
>
> when the application start I get this output:
> ...
> DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> (PropertyMessageResources.java:132) - getMessage(en_US,finalizing)
> DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> (PropertyMessageResources.java:224) - loadLocale(en_US)
> DEBUG [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> (PropertyMessageResources.java:246) - Loading resource
> 'org/apache/struts/action/ActionResources_en_US.properties'
> ...
>
> I use a Init log4j servlet with this snippets in web.xml
> <servlet>
> <servlet-name>log4j-init</servlet-name>
> <servlet-class>it.kemen.util.InitLog</servlet-class>
>
> <init-param>
> <param-name>log4j-init-file</param-name>
> <param-value>WEB-INF/log4j.properties</param-value>
> </init-param>
>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> Can I esclude struts output log? I want just the log from my package
>
> thanks in advance.
>
> regards Lorenzo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Samuel Le Berrigaud

Reply via email to