You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Monsorno <mo...@gmx.de> on 2003/03/25 11:58:01 UTC
how to switch of logging with log4j at initialization
Hi *,
when starting my struts-enabled web-app, I get output like this
,----
| [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
| [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
| [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.webapp.example.AlternateApplicationResources', returnNull=true
| [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.webapp.example.ApplicationResources', returnNull=true
| [INFO] MemoryDatabasePlugIn - -Initializing memory database plug in from '/WEB-INF/database.xml'
| [INFO] ValidatorPlugIn - -Loading validation rules file from '/WEB-INF/validator-rules.xml'
|
| ...
|
`----
printed to stdout.
My log4j configuration looks like this:
,----
| # root category
| log4j.rootCategory=ERROR, Console
| # apache stuff
| log4j.category.org.apache=ERROR, Apache
| log4j.additivity.org.apache=false
|
| #######################################################################
| # apache
| #######################################################################
| log4j.appender.Apache=org.apache.log4j.FileAppender
| log4j.appender.Apache.File=${log.dir}/apache.log
| log4j.appender.Apache.layout=org.apache.log4j.PatternLayout
| log4j.appender.Apache.layout.ConversionPattern=[%p,%c] %m%n
|
| #######################################################################
| # the console appender for everything else
| #######################################################################
| log4j.appender.Console=org.apache.log4j.ConsoleAppender
| log4j.appender.Console.layout=org.apache.log4j.PatternLayout
| log4j.appender.Console.layout.ConversionPattern=[%p,%c] %m%n
`----
So, obviously, struts (or better say commons?), is not interested in
my log4j configuration: it prints INFO messages to stdout, but should
only print ERROR messages to the specified log-file.
How can I configure this? Any help is appreciated.
--
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: how to switch of logging with log4j at initialization
Posted by Martin Monsorno <mo...@gmx.de>.
Stephen Smithstone <sk...@lchost.co.uk> writes:
> if you have the log4j.properties on the classpath in the file just add
>
> log4j.logger.org.apache.struts = warn
>
> that will stop the struts stuff
Hmm, I didn't understand completely what you recommended, but I
- did put the log4j.property file on the classpath (before that, I
specified it by setting the log4j.configuration-system-property,
which worked for all logging stuff but the described one)
- put the line
log4j.logger.org.apache.struts = warn
into my log4j.properties file. This did not change anything, so I
deleted ".struts" in this line, because the problematic logging is
done mostly by commons classes as it seems, but no difference.
Any hints?
--
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: how to switch of logging with log4j at initialization
Posted by Stephen Smithstone <sk...@lchost.co.uk>.
if you have the log4j.properties on the classpath in the file just add
log4j.logger.org.apache.struts = warn
that will stop the struts stuff
On Tuesday 25 March 2003 10:58 am, Martin Monsorno wrote:
> Hi *,
>
> when starting my struts-enabled web-app, I get output like this
>
> ,----
>
> | [INFO] PropertyMessageResources - -Initializing,
> | config='org.apache.struts.util.LocalStrings', returnNull=true [INFO]
> | PropertyMessageResources - -Initializing,
> | config='org.apache.struts.action.ActionResources', returnNull=true [INFO]
> | PropertyMessageResources - -Initializing,
> | config='org.apache.struts.webapp.example.AlternateApplicationResources',
> | returnNull=true [INFO] PropertyMessageResources - -Initializing,
> | config='org.apache.struts.webapp.example.ApplicationResources',
> | returnNull=true [INFO] MemoryDatabasePlugIn - -Initializing memory
> | database plug in from '/WEB-INF/database.xml' [INFO] ValidatorPlugIn -
> | -Loading validation rules file from '/WEB-INF/validator-rules.xml'
> |
> | ...
>
> `----
>
> printed to stdout.
>
> My log4j configuration looks like this:
>
> ,----
>
> | # root category
> | log4j.rootCategory=ERROR, Console
> | # apache stuff
> | log4j.category.org.apache=ERROR, Apache
> | log4j.additivity.org.apache=false
> |
> | #######################################################################
> | # apache
> | #######################################################################
> | log4j.appender.Apache=org.apache.log4j.FileAppender
> | log4j.appender.Apache.File=${log.dir}/apache.log
> | log4j.appender.Apache.layout=org.apache.log4j.PatternLayout
> | log4j.appender.Apache.layout.ConversionPattern=[%p,%c] %m%n
> |
> | #######################################################################
> | # the console appender for everything else
> | #######################################################################
> | log4j.appender.Console=org.apache.log4j.ConsoleAppender
> | log4j.appender.Console.layout=org.apache.log4j.PatternLayout
> | log4j.appender.Console.layout.ConversionPattern=[%p,%c] %m%n
>
> `----
>
> So, obviously, struts (or better say commons?), is not interested in
> my log4j configuration: it prints INFO messages to stdout, but should
> only print ERROR messages to the specified log-file.
>
> How can I configure this? Any help is appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org