Ticket #210 (closed task: fixed)

Opened 2 years ago

Last modified 2 years ago

configure properly log4j for preventing error messages

Reported by: dumoulin Owned by: romain.reuillon
Priority: normal Milestone: 1.0
Component: core Version: 0.3
Severity: minor Keywords:
Cc: romain.reuillon@…

Description

As log4j isn't correctly configured, we have such a message when we start openmole:

log4j:WARN No appenders could be found for logger (org.apache.commons.configuration.ConfigurationUtils).
log4j:WARN Please initialize the log4j system properly.

It can be fixed programmatically with this code:

org.apache.log4j.Logger.getRootLogger().addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c - %F:%L - %m%n")));

So we have to put the corresponding log4j.xml configuration file to fix permanently that.

See also these docs:

Change History

Changed 2 years ago by DefaultCC Plugin

  • cc romain.reuillon@… added

Changed 2 years ago by romain.reuillon

  • status changed from new to closed
  • resolution set to fixed

Log4 j used by the apache configuration lib used by the workspace bundle. The message has been fixed by adding the configuration of log4j to the workspace bundle activator.

Changed 2 years ago by dumoulin

  • status changed from closed to reopened
  • resolution fixed deleted

It isn't fixed, as I'm looking for a way to configure loggers with properties or xml file, not programmatically because it needs to rebuild the project.

Changed 2 years ago by dumoulin

Log4j couldn't be configured as simple as putting a log4j.properties file in a bundle. Creating a fragment is required.

Changed 2 years ago by dumoulin

  • status changed from reopened to closed
  • resolution set to fixed

As log4j is only used by the module workspace, it is fine to configure it programmatically. In my last commit r2796, I've limited the configuration to the class org.apache.commons.configuration.ConfigurationUtils which uses log4j.

Note: See TracTickets for help on using tickets.

logo cemagref

logo iscpif

logo lifegrid

logo region auvergne

logo patres project