Bug 422816 - [Workbench] setting WorkbenchLogger regardless of the ILoggerProvider
Summary: [Workbench] setting WorkbenchLogger regardless of the ILoggerProvider
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jonas Helming CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-29 03:08 EST by Jan Weidauer CLA
Modified: 2018-01-30 02:20 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Weidauer CLA 2013-11-29 03:08:52 EST
In E4Application class the WorkbenchLogger is added to the application context regardless of which ILoggerProvider is set. This is done in method createDefaultContext() after calling createDefaultHeadlessContext().
Using the ILoggerProvider to set a logger to the context would provide the possibility to set an own ILogger via setting a ILoggerProvider in the bundle activator of the application.
Comment 1 Lars Vogel CLA 2013-11-29 04:02:06 EST
Sounds reasonable. Would you be able to provide a Gerrit review for that, so that we can code review your suggestion? See http://www.vogella.com/articles/Gerrit/article.html#eclipsegerritcontribution for an introduction to Gerrit contributions for Eclipse.
Comment 2 Jonas Helming CLA 2015-06-23 04:34:45 EDT
I think the ILoggerProvider does not really fit, as it requires a Class<?>. The "root" logger for the application is currently not instantiated with any specific class. I therefore suggest to:

- Check if a Logger is existing in the context (service or app context)
- If so, use this one
- If not, instantiate the default one as before

This would enable to replace the Logger just by registering an OSGi service or a context function.
Comment 3 Jonas Helming CLA 2016-01-04 10:34:08 EST
Would the proposed solution solve your issue?