Skip to content

Make Tomcat Log Stuff to Console (in Eclipse)

December 7th, 2016 - SoftwareTutorial(1 min)

TL;DR: in your project’s src/main/resources add the CONSOLE setting to the file.

While trying to add features to a web application, I stumbled on an odd situation: my Eclipse Console would show only log messages for tomcat processes, none of my logs. I’ve tried to add a logger properties in Tomcat itself in ${CATALINA_BASE}/lib, but I had no luck.

The solution is to use your app’s own (in src/main/resources) and enable CONSOLE logger. My file looks like this now:

# Logger file

log4j.rootLogger=INFO, CONSOLE

# Console logger
log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %5p %c{1}:%L - %x - %m%n

# 3rd party components

# My application

where is my application’s package name (e.g. com.laurivan.helloworld).


Share on
Linked in

A little experiment: