Question

I am getting the following warnings in my console when I run my testng suites:

log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager)
log4j:WARN Please initialize the log4j system properly.

We were using log4j previously but have since moved to a new logger. The project has had all references to log4j removed, but we are still getting these errors. We are using Selenium Web Driver, and it seems like we are getting these warnings on this line here:

driver = new FirefoxDriver();

The only thing I can think of is that FirefoxDriver is asking for a log4j object or something and it is not receiving it, but the source code doesn't call for a log4j. Does anyone have any idea why we are getting these warnings? I am not too familiar with log4j and have just recently been brought on to the team. I have read things about log4j properties files, but we don't have any of those so I don't think it has anything to do with those.

Was it helpful?

Solution

log4j is being asked for a logger corresponding to

org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager

and the log message clearly show that log4j is still present somewhere deep inside. For maven projects this is most likely a transient dependency which you explicitly must disable yourself.

The established convention is that this is the name of the class requesting the logger object, in case you want to investigate.

OTHER TIPS

It is not called but it is still associated with in your project build library, remove it from there and remove the log4j xml aslo from the project build directory. Give it a try

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top