RE: how to switch of logging with log4j at initialization
Since you are still having problems, I would set up a simple test app with a class or two and a clean classpath. Edgar > -Original Message- > From: Martin Monsorno [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 03, 2003 2:37 AM > To: 'Struts Users Mailing List' > Cc: 'Niesen, Nathan'; Edgar Dollin > Subject: Re: how to switch of logging with log4j at initialization > > > "Craig R. McClanahan" <[EMAIL PROTECTED]> writes: > > > [...] > > >> > >> As I wrote as an answer to Edgar Dollin, my problem is not > that log4j > >> is used, but that my log4j configuration seems to be not > the only one > >> used, as I set the logging for "com.apache" to a file with ERROR > >> level, but the output for (some of?) the commons-classes is logged > >> anyway to stdout. > >> > > > > Assuming that "com.apache" is not a typo, you might try > "org.apache" > > instead. > > > > Yes, it's a typo. Unfortunately NOT in my > log4j.configuration, only in my posting, so no luck with this, too :-( > > -- > Martin > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
"Craig R. McClanahan" <[EMAIL PROTECTED]> writes: [...] >> >> As I wrote as an answer to Edgar Dollin, my problem is not that log4j >> is used, but that my log4j configuration seems to be not the only one >> used, as I set the logging for "com.apache" to a file with ERROR >> level, but the output for (some of?) the commons-classes is logged >> anyway to stdout. >> > > Assuming that "com.apache" is not a typo, you might try "org.apache" > instead. > Yes, it's a typo. Unfortunately NOT in my log4j.configuration, only in my posting, so no luck with this, too :-( -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
On Tue, 1 Apr 2003, Martin Monsorno wrote: > Date: Tue, 01 Apr 2003 16:42:32 +0200 > From: Martin Monsorno <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: "Niesen, Nathan" <[EMAIL PROTECTED]> > Cc: 'Edgar Dollin' <[EMAIL PROTECTED]>, > 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: Re: how to switch of logging with log4j at initialization > > "Niesen, Nathan" <[EMAIL PROTECTED]> writes: > > There is a bug in commons-logging 1.0.2+ that causes log4j to be used if > > it's found in the classpath. Just remove the log4j jar from your webapps > > lib dir. > > > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561 > > > > There is also a bug in the commons-logging nightly build, which is what the > > current Struts build uses, that causes the commons-logging.properties to be > > ignored. > > > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894 > > As I wrote as an answer to Edgar Dollin, my problem is not that log4j > is used, but that my log4j configuration seems to be not the only one > used, as I set the logging for "com.apache" to a file with ERROR > level, but the output for (some of?) the commons-classes is logged > anyway to stdout. > Assuming that "com.apache" is not a typo, you might try "org.apache" instead. > -- > Martin Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to switch of logging with log4j at initialization
If you put the properties files in your webapps classes dir, it will only apply to your webapp. Try putting the properties files in your app servers classpath. With Tomcat you'd put them in tomcat/common/classes. -Original Message- From: Martin Monsorno [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 8:43 AM To: Niesen, Nathan Cc: 'Edgar Dollin'; 'Struts Users Mailing List' Subject: Re: how to switch of logging with log4j at initialization "Niesen, Nathan" <[EMAIL PROTECTED]> writes: > There is a bug in commons-logging 1.0.2+ that causes log4j to be used if > it's found in the classpath. Just remove the log4j jar from your webapps > lib dir. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561 > > There is also a bug in the commons-logging nightly build, which is what the > current Struts build uses, that causes the commons-logging.properties to be > ignored. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894 As I wrote as an answer to Edgar Dollin, my problem is not that log4j is used, but that my log4j configuration seems to be not the only one used, as I set the logging for "com.apache" to a file with ERROR level, but the output for (some of?) the commons-classes is logged anyway to stdout. -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
"Niesen, Nathan" <[EMAIL PROTECTED]> writes: > There is a bug in commons-logging 1.0.2+ that causes log4j to be used if > it's found in the classpath. Just remove the log4j jar from your webapps > lib dir. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561 > > There is also a bug in the commons-logging nightly build, which is what the > current Struts build uses, that causes the commons-logging.properties to be > ignored. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894 As I wrote as an answer to Edgar Dollin, my problem is not that log4j is used, but that my log4j configuration seems to be not the only one used, as I set the logging for "com.apache" to a file with ERROR level, but the output for (some of?) the commons-classes is logged anyway to stdout. -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
Edgar Dollin <[EMAIL PROTECTED]> writes: > In commons-logging.properties (somewhere on the classpath) I have these two > lines > > > org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory > Log > > org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF > actory > > I forget what they are both for but commons-logging always seems to find the > log4j configuration. Tried this too, it doesn't work, what is not surprising: this settings tell struts to use log4j. But my problem is that log4j is used already, but the log4j configuration is ignored, or better: there seems to be another log4j configuration which prints this output on INFO level on stdout. -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to switch of logging with log4j at initialization
There is a bug in commons-logging 1.0.2+ that causes log4j to be used if it's found in the classpath. Just remove the log4j jar from your webapps lib dir. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561 There is also a bug in the commons-logging nightly build, which is what the current Struts build uses, that causes the commons-logging.properties to be ignored. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894 Nathan. -Original Message- From: Edgar Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 7:39 AM To: 'Martin Monsorno'; 'Struts Users Mailing List' Subject: RE: how to switch of logging with log4j at initialization In commons-logging.properties (somewhere on the classpath) I have these two lines org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory Log org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF actory I forget what they are both for but commons-logging always seems to find the log4j configuration. Edgar > -Original Message- > From: Martin Monsorno [mailto:[EMAIL PROTECTED] > Sent: Friday, March 28, 2003 3:04 AM > To: 'Struts Users Mailing List' > Subject: Re: how to switch of logging with log4j at initialization > > > COMPAGNON GUILLAUME <[EMAIL PROTECTED]> writes: > > > according to me (as the simplest way), you need to have a > > commons-logging.propeties file with > > > org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl. > > Log4jF > > actory > > I tried this already, but it doesn't change anything. > > Apparently, log4j is already used by Struts, but my > configuration is ignored. Like there is an appender > configured in the java code, or so. But I hope, this is not > the case ? > > > -- > Martin > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to switch of logging with log4j at initialization
In commons-logging.properties (somewhere on the classpath) I have these two lines org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory Log org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF actory I forget what they are both for but commons-logging always seems to find the log4j configuration. Edgar > -Original Message- > From: Martin Monsorno [mailto:[EMAIL PROTECTED] > Sent: Friday, March 28, 2003 3:04 AM > To: 'Struts Users Mailing List' > Subject: Re: how to switch of logging with log4j at initialization > > > COMPAGNON GUILLAUME <[EMAIL PROTECTED]> writes: > > > according to me (as the simplest way), you need to have a > > commons-logging.propeties file with > > > org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl. > > Log4jF > > actory > > I tried this already, but it doesn't change anything. > > Apparently, log4j is already used by Struts, but my > configuration is ignored. Like there is an appender > configured in the java code, or so. But I hope, this is not > the case ? > > > -- > Martin > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
COMPAGNON GUILLAUME <[EMAIL PROTECTED]> writes: > according to me (as the simplest way), you need to have a > commons-logging.propeties file with > org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF > actory I tried this already, but it doesn't change anything. Apparently, log4j is already used by Struts, but my configuration is ignored. Like there is an appender configured in the java code, or so. But I hope, this is not the case ? -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to switch of logging with log4j at initialization
according to me (as the simplest way), you need to have a commons-logging.propeties file with org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF actory <> hope thats help Guillaume Compagnon > -Message d'origine- > De: Martin Monsorno [SMTP:[EMAIL PROTECTED] > Date: mercredi 26 mars 2003 09:25 > À:Struts Users Mailing List > Objet: Re: how to switch of logging with log4j at initialization > > Stephen Smithstone <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Ce message et toutes les pièces jointes (ci-après le "message") sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite.Tout message électronique est susceptible d'altération. Le CREDIT DU NORD et ses filiales déclinent toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. This message and any attachments ( the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited.E-mails are susceptible to alteration. Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
Stephen Smithstone <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to switch of logging with log4j at initialization
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]