Answer the question
In order to leave comments, you need to log in
How to prevent Spring MVC from writing logs to my log file?
I am learning Spring MVC. To write logs I use
log4j In AppStartListener I initialize the logger. log4j.xml is located in the resources folder The
logger is configured to output to a file. Next, I use the standard logger
DOMConfigurator.configure("loj4j.xml");
private static final Logger log = Logger.getLogger(LoginServlet.class);
...
log.trace("trace message");
Answer the question
In order to leave comments, you need to log in
For XML you need to add
<logger name="org.springframework">
<level value="Warn" />
<appender-ref ref="consoleAppender"/>
</logger>
log4j.logger.org.springframework=INFO
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question