5
How do I configure the properties of log4j? In my application, I am receiving the following message:
log4j:WARN No appenders could be found for logger (org.docx4j.jaxb.Context).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Searching the internet, I found the following suggestion:
https://tomcat.apache.org/tomcat-5.5-doc/config/systemprops.html#Specification
However, how do I change to false the property below?
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES
Below is my configuration file for log4j.properties
:
# Set root logger level to DEBUG and its only appender to A1. log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender. log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout. log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.A1.Target=System.out
# An alternative logging format:
# log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n
#Prevent internal log4j DEBUG messages from polluting the output. log4j.logger.org.apache.log4j.PropertyConfigurator=INFO log4j.logger.org.apache.log4j.config.PropertySetter=INFO log4j.logger.org.apache.log4j.FileAppender=INFO
Put your configuration, you are using log4J 1 or 2 ?
– Wellington Avelino
I’m using log4j-1.2.17
– Duds
Do you have trouble switching to logj2? A few months ago I had a lot of problems with the 1 I switched to the 2 and ended the problems :D, put its configuration I put an answer to how to configure it.
– Wellington Avelino
I have no problems. I just edited my question by adding the property file, hopefully this is it. If you can help me set it up, I really appreciate it! :D
– Duds
Did you solve it? @Duds
– Wellington Avelino
Now it’s worked out! Thank you so much @Wellington Avelino
– Duds
If the answer was helpful, mark as right to help other users.
– Wellington Avelino