Disabling Spring log, to have readable logs

前端 未结 5 1231
醉梦人生
醉梦人生 2020-12-05 07:45

How can I disable Spring logs to have log outputs that I can easily read or someone else can read. An answer to a similar question at, how to disable spring bean loading log

5条回答
  •  猫巷女王i
    2020-12-05 08:32

    I was also facing this same issue. Springframework logging was not getting removed even after log4j configuration. Then I found that its logging depends on commons-logging.

    You have to disable commons-logging from the dependency in pom.xml file of the web app.

    Even after removing commons-logging from pom.xml please check the dependency hierarchy available in Eclipse or STS IDE. This will help in knowing if somehow its getting added because of some other dependency management which we may not be knowing.

    After removing dependency just add log4j.logger.org.springframework=ERROR to your log4j configuration. This will help.

提交回复
热议问题