log4j configuration
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Wed Apr 16, 2014 2:07 am
log4j configuration
Post by pmurali26@gmail.com »
Hey, Did you get a solution to configure the lo4j. I am usng 14.2 oxygen xml developer and need guidance in setting up the loggers. Any help is highly appreciated!!
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: log4j configuration
Hi,
I split the topic. The original poster on the initial topic left the message more than 10 years ago (Sep 19, 2003) and refers to a very old version (Oxygen 2.x) of the Eclipse plugin.
What problems have you encountered in v14.2 that you want to enable logging?
Enabling logging is the last resort and is necessary only when encountering a problem or error that is not correctly handled by the application.
Note that Oxygen runs very slow while logging is enabled, so we only recommend enabling it for debugging purposes (definitely not in production work).
In addition, the generated log is not very user friendly, so it may be difficult to interpret. We recommend discussing the problem with our support team and letting them interpret the logs whenever possible.
Having said that, you can enable logging in Oxygen with a 'log4j.properties' file placed in the Oxygen installation directory (or Oxygen plugin 'lib' folder for the Eclipse plugin).
The 'log4j.properties' file must specify the logger configuration:
This logger configuration places the generated log files (oxygen.log.*), of maximum ~12MB each, in a folder named 'oxygenLog' from your Desktop.
Regards,
Adrian
I split the topic. The original poster on the initial topic left the message more than 10 years ago (Sep 19, 2003) and refers to a very old version (Oxygen 2.x) of the Eclipse plugin.
What problems have you encountered in v14.2 that you want to enable logging?
Enabling logging is the last resort and is necessary only when encountering a problem or error that is not correctly handled by the application.
Note that Oxygen runs very slow while logging is enabled, so we only recommend enabling it for debugging purposes (definitely not in production work).
In addition, the generated log is not very user friendly, so it may be difficult to interpret. We recommend discussing the problem with our support team and letting them interpret the logs whenever possible.
Having said that, you can enable logging in Oxygen with a 'log4j.properties' file placed in the Oxygen installation directory (or Oxygen plugin 'lib' folder for the Eclipse plugin).
The 'log4j.properties' file must specify the logger configuration:
Code: Select all
log4j.rootCategory= debug, R2
log4j.appender.R2=org.apache.log4j.RollingFileAppender
log4j.appender.R2.File=${user.home}/Desktop/oxygenLog/oxygen.log
log4j.appender.R2.MaxFileSize=12000KB
log4j.appender.R2.MaxBackupIndex=20
log4j.appender.R2.layout=org.apache.log4j.PatternLayout
log4j.appender.R2.layout.ConversionPattern=%r %p [ %t ] %c - %m%n
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Wed Sep 12, 2018 1:25 am
Re: log4j configuration
I want to include logging to a file for errors in my plugin. You said I could include log4j.properties file in my plugin lib directory but that does not seem to work. It only works if I put the log4j.properties file in the oxygen installation folder. How can I make it part of my plugin installation?
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: log4j configuration
Hi,
About this remark:
Coming back to your problem:
You have an Oxygen plugin which uses Log4j logging. Oxygen also uses Log4j logging and loads its configuration from the "OXYGEN_INSTALL_DIR\log4j.properties" file. This is not configurable, you cannot tell Oxygen to load the logging information from another place.
But maybe what you could do in your plugin's Java code would be to have some static block which adds an appender to the log system and that appender can also be a file appender:
Regards,
Radu
About this remark:
Oxygen is also available as a plugin for the Eclipse workbench so this particular advice was given in that context and does not have anything to do with your particular request.You said I could include log4j.properties file in my plugin lib directory but that does not seem to work.
Coming back to your problem:
You have an Oxygen plugin which uses Log4j logging. Oxygen also uses Log4j logging and loads its configuration from the "OXYGEN_INSTALL_DIR\log4j.properties" file. This is not configurable, you cannot tell Oxygen to load the logging information from another place.
But maybe what you could do in your plugin's Java code would be to have some static block which adds an appender to the log system and that appender can also be a file appender:
Code: Select all
/**
* Logger for logging.
*/
private static Logger logger = Logger.getLogger("my.plugin.logger");
{
logger.removeAllAppenders();
logger.addAppender(new FileAppender(...)));
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service