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 » Wed Apr 16, 2014 6:30 pm

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: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: log4j configuration

Post by adrian » Thu Apr 17, 2014 12:27 pm


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.layout.ConversionPattern=%r %p [ %t ] %c - %m%n
This logger configuration places the generated log files (oxygen.log.*), of maximum ~12MB each, in a folder named 'oxygenLog' from your Desktop.

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Posts: 2
Joined: Wed Sep 12, 2018 1:25 am

Re: log4j configuration

Post by c094728 » Thu Mar 21, 2019 11:14 pm

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: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: log4j configuration

Post by Radu » Fri Mar 22, 2019 11:01 am


About this remark:
You said I could include log4j.properties file in my plugin lib directory but that does not seem to work.
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.

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.addAppender(new FileAppender(...)));
Radu Coravu
<oXygen/> XML Editor

Post Reply