Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353168 - WebUtil.initCommonsLoggingSettings sets a system property that mutes other plugins using JCL
Summary: WebUtil.initCommonsLoggingSettings sets a system property that mutes other pl...
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 358968
Blocks:
  Show dependency tree
 
Reported: 2011-07-26 18:02 EDT by Shaw Terwilliger CLA
Modified: 2015-07-10 19:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shaw Terwilliger CLA 2011-07-26 18:02:09 EDT
Build Identifier: 20110615-0604

When TasksUiPlugin starts it loads the WebUtil class, which sets the JCL system property "org.apache.commons.logging.Log" to use NoOpLog if the user didn't set the property explicitly (few will).  Other plug-ins that start after TasksUiPlugin, and desire JCL's default log implementation discovery (which tries to load a _working_ implementation like log4j) are now stuck with NoOpLog.

It would be nice if WebUtil didn't do any JCL configuration and just let the normal discovery mechanism work.  I don't know of any other Eclipse plug-ins that configure JCL without explicit user input, and NoOpLog is an especially cruel default.

Reproducible: Always

Steps to Reproduce:
1. Develop a new "logger" bundle that includes log4j and starts later than Mylyn TasksUiPlugin and logs something via JCL at startup like: LogFactory.getLog(LoggerPlugin.class).error("my critical error");
2. Run Eclipse with "logger" and Mylyn installed
3. See no log output via log4j for "logger" when it starts/runs
4. Confirm NoOpLog was used instead of log4j by stepping into LogFactory.getLog() in the debugger
Comment 1 Steffen Pingel CLA 2011-09-26 16:07:28 EDT
The reason for configuring the logging system is that otherwise warning messages from HttpClient and possibly other libraries ends up on the console by default which can be confusing. It's a work-around since to my knowledge there is no support in the platform to configure commons logging. 

Users can easily enable logging by specifying the org.apache.commons.logging.Log system property but I see your point that a generic mechanism or relying on the default discovery mechanism would be preferable. I have raised bug 358968 to discuss this on a cross projects level. Depending on the outcome we may end up removing the explicit configuration of commons logging in Mylyn to avoid conflicts with other consumers of commons logging.
Comment 2 Sam Davis CLA 2015-07-10 19:53:04 EDT
Since there has been no activity on this bug in a very long time, I am marking it WORKSFORME. Please feel free to reopen the bug if it is still an issue.