Difference between revisions of "Xtext Project Plan/Features/Logging"
(New page: === Required Features === * completely transparent logging * use same logger API in frontend and backend / IDE vs standalone mode * levels WARN, ERROR and FATAL will be logged to the Eclip...) |
|||
Line 1: | Line 1: | ||
+ | == User Information == | ||
+ | |||
+ | === How do I use Logging in Xtext? === | ||
+ | |||
+ | == Developer Information == | ||
=== Required Features === | === Required Features === | ||
* completely transparent logging | * completely transparent logging |
Revision as of 09:41, 29 July 2008
Contents
User Information
How do I use Logging in Xtext?
Developer Information
Required Features
- completely transparent logging
- use same logger API in frontend and backend / IDE vs standalone mode
- levels WARN, ERROR and FATAL will be logged to the Eclipse Error Log
Researched options
The followng options were researched:
- Commons Logging (not feasible due to the fact only ONE configuration can be used throughout the ENTIRE application)
- Log4J bundle from the Eclipse Orbit (still, only one bundle can configure the Log system)
Solution
- Use Log4j, but create a custom Log4j bundle (org.eclipse.xtext.log4j)
- org.eclipse.xtext.logging contains EclipseLogAppender
- Mapping from logger name to Eclipse bundle is achieved by extending the extension point org.eclipse.xtext.logging.loggermap (loggername contains a regex) :
<extension point="org.eclipse.xtext.logging.loggermap"> <mapentry bundleId="org.eclipse.xtext" loggername="org\.eclipse\.xtext\..*"> </mapentry> <mapentry bundleId="org.eclipse.xtext.reference.ui" loggername="org\.eclipse\.xtext\.reference\.ui\..*"> </mapentry> <mapentry bundleId="org.eclipse.xtext.ui" loggername="org\.eclipse\.xtext\.ui\..*"> </mapentry> </extension>