From: Erskine, C. <chr...@ed...> - 2004-09-29 19:29:30
|
Commons_logging has a startup sequence which looks for the log4j package on the classpath and uses it if found. If it is found, it looks for (depending on the version) log4j.properties and/or log4j.xml to initialize the appenders. This initialization occurs for the first class to do some form of logging which in this case is HttpClient. What could be done is to create a log4j.properties file which could live in the src/test/java directory that would get copied to the output directory for the tests. This would not be copied to the distribution directory and packaged with htmlunit. Chris Erskine EDS Consulting Services F5-EDS-001 2424 Garden of the Gods Rd Colorado Springs, CO 80919 Phone: 719-535-6064 Phone: mailto:chr...@ed... -----Original Message----- From: Brad Clarke [mailto:yo...@br...] Sent: Wednesday, September 29, 2004 12:16 PM To: htm...@li... Subject: [Htmlunit-user] log4j I've been forced to add log4j to my testing classpath for something other than htmlunit and whenever I run my tests I get these from httpclient: log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.HttpClient). log4j:WARN Please initialize the log4j system properly. This didn't happen until I upgraded all the jars and used latest CVS. Either I changed more than I thought when upgrading all the jars or something changed in htmlunit. Any ideas? Brad C ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Erskine, C. <chr...@ed...> - 2004-09-29 21:08:03
|
You said that you added log4j to your classpath. Commons-logging is calling it since it is on the classpath. Chris Erskine EDS Consulting Services F5-EDS-001 2424 Garden of the Gods Rd Colorado Springs, CO 80919 Phone: 719-535-6064 Phone: mailto:chr...@ed... -----Original Message----- From: Brad Clarke [mailto:yo...@br...] Sent: Wednesday, September 29, 2004 2:41 PM To: htm...@li... Subject: RE: [Htmlunit-user] log4j I hate logging...if it's that important you should throw an exception! :) I'm using a packaged version of htmlunit for my project so this won't help me. While I can create the log4j.properties/xml I shouldn't need to. It just makes htmlunit look broken to me and I want to fix it. I'm really more interested in what changed to make this warning start poping up now. I'm not really doing anything different that before... Brad --- "Erskine, Chris" <chr...@ed...> wrote: > Commons_logging has a startup sequence which looks for the log4j package on > the classpath and uses it if found. If it is found, it looks for (depending > on the version) log4j.properties and/or log4j.xml to initialize the > appenders. This initialization occurs for the first class to do some form > of logging which in this case is HttpClient. What could be done is to > create a log4j.properties file which could live in the src/test/java > directory that would get copied to the output directory for the tests. This > would not be copied to the distribution directory and packaged with > htmlunit. > > Chris Erskine > > EDS Consulting Services > F5-EDS-001 > 2424 Garden of the Gods Rd > Colorado Springs, CO 80919 > > Phone: 719-535-6064 > > Phone: > mailto:chr...@ed... > -----Original Message----- > From: Brad Clarke [mailto:yo...@br...] > Sent: Wednesday, September 29, 2004 12:16 PM > To: htm...@li... > Subject: [Htmlunit-user] log4j > > I've been forced to add log4j to my testing classpath for something other > than > htmlunit and whenever I run my tests I get these from httpclient: > > log4j:WARN No appenders could be found for logger > (org.apache.commons.httpclient.HttpClient). > log4j:WARN Please initialize the log4j system properly. > > This didn't happen until I upgraded all the jars and used latest CVS. Either > I > changed more than I thought when upgrading all the jars or something changed > in > htmlunit. > > Any ideas? > > Brad C > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Brad C. <yo...@br...> - 2004-09-29 21:54:08
|
log4j exists because I have pdfbox, which directly uses log4j so I must have it. Both of these things were there before the updates and only now do I see the warnings from httpclient. Maybe I just need to go complain in comp.java.centralized.logging.sucks or something :) Brad --- "Erskine, Chris" <chr...@ed...> wrote: > You said that you added log4j to your classpath. Commons-logging is calling > it since it is on the classpath. > > Chris Erskine > > EDS Consulting Services > F5-EDS-001 > 2424 Garden of the Gods Rd > Colorado Springs, CO 80919 > > Phone: 719-535-6064 > > Phone: > mailto:chr...@ed... > -----Original Message----- > From: Brad Clarke [mailto:yo...@br...] > Sent: Wednesday, September 29, 2004 2:41 PM > To: htm...@li... > Subject: RE: [Htmlunit-user] log4j > > I hate logging...if it's that important you should throw an exception! :) > > I'm using a packaged version of htmlunit for my project so this won't help > me. While > I can create the log4j.properties/xml I shouldn't need to. It just makes > htmlunit > look broken to me and I want to fix it. > > I'm really more interested in what changed to make this warning start poping > up now. > I'm not really doing anything different that before... > > Brad > > --- "Erskine, Chris" <chr...@ed...> wrote: > > > Commons_logging has a startup sequence which looks for the log4j package > on > > the classpath and uses it if found. If it is found, it looks for > (depending > > on the version) log4j.properties and/or log4j.xml to initialize the > > appenders. This initialization occurs for the first class to do some form > > of logging which in this case is HttpClient. What could be done is to > > create a log4j.properties file which could live in the src/test/java > > directory that would get copied to the output directory for the tests. > This > > would not be copied to the distribution directory and packaged with > > htmlunit. > > > > Chris Erskine > > > > EDS Consulting Services > > F5-EDS-001 > > 2424 Garden of the Gods Rd > > Colorado Springs, CO 80919 > > > > Phone: 719-535-6064 > > > > Phone: > > mailto:chr...@ed... > > -----Original Message----- > > From: Brad Clarke [mailto:yo...@br...] > > Sent: Wednesday, September 29, 2004 12:16 PM > > To: htm...@li... > > Subject: [Htmlunit-user] log4j > > > > I've been forced to add log4j to my testing classpath for something other > > than > > htmlunit and whenever I run my tests I get these from httpclient: > > > > log4j:WARN No appenders could be found for logger > > (org.apache.commons.httpclient.HttpClient). > > log4j:WARN Please initialize the log4j system properly. > > > > This didn't happen until I upgraded all the jars and used latest CVS. > Either > > I > > changed more than I thought when upgrading all the jars or something > changed > > in > > htmlunit. > > > > Any ideas? > > > > Brad C > > |
From: Brad C. <yo...@br...> - 2004-09-29 20:42:05
|
I hate logging...if it's that important you should throw an exception! :) I'm using a packaged version of htmlunit for my project so this won't help me. While I can create the log4j.properties/xml I shouldn't need to. It just makes htmlunit look broken to me and I want to fix it. I'm really more interested in what changed to make this warning start poping up now. I'm not really doing anything different that before... Brad --- "Erskine, Chris" <chr...@ed...> wrote: > Commons_logging has a startup sequence which looks for the log4j package on > the classpath and uses it if found. If it is found, it looks for (depending > on the version) log4j.properties and/or log4j.xml to initialize the > appenders. This initialization occurs for the first class to do some form > of logging which in this case is HttpClient. What could be done is to > create a log4j.properties file which could live in the src/test/java > directory that would get copied to the output directory for the tests. This > would not be copied to the distribution directory and packaged with > htmlunit. > > Chris Erskine > > EDS Consulting Services > F5-EDS-001 > 2424 Garden of the Gods Rd > Colorado Springs, CO 80919 > > Phone: 719-535-6064 > > Phone: > mailto:chr...@ed... > -----Original Message----- > From: Brad Clarke [mailto:yo...@br...] > Sent: Wednesday, September 29, 2004 12:16 PM > To: htm...@li... > Subject: [Htmlunit-user] log4j > > I've been forced to add log4j to my testing classpath for something other > than > htmlunit and whenever I run my tests I get these from httpclient: > > log4j:WARN No appenders could be found for logger > (org.apache.commons.httpclient.HttpClient). > log4j:WARN Please initialize the log4j system properly. > > This didn't happen until I upgraded all the jars and used latest CVS. Either > I > changed more than I thought when upgrading all the jars or something changed > in > htmlunit. > > Any ideas? > > Brad C > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Mike B. <mb...@Ga...> - 2004-09-29 21:58:03
|
Brad Clarke wrote: > I'm really more interested in what changed to make this warning start poping up now. > I'm not really doing anything different that before... As Chris said, this is default behaviour for commons-logging. You can explicitly set the logger back to SimpleLog (likely what you were using before you put log4j in the classpath) by setting a system property. The HtmlUnit tests themselves do this so that we can explicitly turn off some of the commons-httpclient log messages. The relevant line is System.getProperties().put( "org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); The HtmlUnit code that does this is in MainTestSuite btw. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |