Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris

How to disable log messages when spring boot application run?

Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my log4j2.xml file:

When I used previous versions of Log4j2, only requests sent by my application were being written to my log file in my log folder on my computer. For example:

But when I switched to the new version of Log4j, because of the vulnerability, before the messages I showed above, when my spring boot project runs, its messages also written. I mean focus on following.

but I don't want to see these messages in my log file. I just want to write messages when request and response are generated, like before my configuration. How to solve this? I mean I want to only messages to the log file which my requests and responses.

and also this is my pom.xml file

Posts: 22727
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm surprised you didn't see this logging before. Your configuration defines a logger for, but every other logging uses the root logger configuration. That says to log it on info, and that's exactly what you're getting.

If you want to disable this logging, either change the level for the root logger to error or warn, or add a new logger for org.springframework with a level of error or warn to just decrease the Spring (Boot) logging.
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
    Bookmark Topic Watch Topic
  • New Topic