• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

How to make Log4j2 take over apache.catalina logging?

 
Ranch Hand
Posts: 559
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi expert,

I run my web app again and I saw the following lines appear :



I'd like to know how to make Log4j2 logger take over the logging and disabled the catalina logging (not sure if they can co-exist though )

Any advice is greatly appreciated.


 
Sheriff
Posts: 4674
308
IntelliJ IDE Clojure Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Catalina output you see there is the log output from the Tomcat application. I'm not aware of a way, or even a need, to mess with the way Tomcat logs its output.
 
Saloon Keeper
Posts: 21133
134
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something that the Tomcat docs do not make clear. Each webapp is completely and totally responsible for its own logging using whatever log framework it wants.

Tomcat also does logging, but it only logs Tomcat log messages and knows nothing about what the webapps are doing.

You can construct a custom Tomcat that uses log4j, but the standard image that ships uses juli logging. For details, see the Tomcat docs.
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!