[FOLIO-1491] Add and configure log4j.properties for Maven-based builds Created: 18/Jan/17  Updated: 09/Jan/20

Status: Open
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: David Crossley Assignee: David Crossley
Resolution: Unresolved Votes: 0
Labels: platform-backlog
Remaining Estimate: Not Specified
Time Spent: 1 day, 2 hours, 45 minutes
Original estimate: Not Specified

Issue links:
Relates
relates to RMB-511 Use log4js MDC class, rather than slf4j Closed
Sprint:
Development Team: Core: Platform

 Description   

Many of the builds issue warnings about:
...
log4j:WARN Please initialize the log4j system properly.



 Comments   
Comment by David Crossley [ 18/Jan/17 ]

Warnings such as this:
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
can be addressed just by adding the configuration in the normal place:
src/main/resources/log4j.properties
so that it gets automatically found on the classpath.

However, for warnings such as this:
log4j:WARN No appenders could be found for logger (org.raml.parser.loader.FileResourceLoader).
and this:
log4j:WARN No appenders could be found for logger (org.raml.parser.utils.StreamUtils).
the normal solution does not work.

Thanks to https://github.com/raml-org/raml-java-parser/issues/33
using the "properties-maven-plugin" to set the "log4j.configuration" system property, it works in all cases.

Comment by David Crossley [ 18/Jan/17 ]

Using this also helping to track the problem:
mvn -Dlog4j.debug clean install

Generated at Thu Feb 08 23:13:43 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.