• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Date Time columns in Tomcat 5 Log

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My old Tomcat Server used to have logging in this format (/logs/catalina.log)
INFO | jvm 1 | 2014/01/05 04:42:35 | Recal Basket

A similar line in a new Server install (Apache Tomcat/5.5.25) shows up as:
Recal Basket

So the columns with INFO, jvm 1, date and time are missing.
What kind of logging set up is required to get these columns back in? I particularly need date and time for log entries generated by "System.out.println".
Thanks!
 
Bartender
Posts: 20847
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ro Vi wrote:I particularly need date and time for log entries generated by "System.out.println".



You won't get them. System.out.println writes verbatim to stdout (which is redirected to catalina.out). No extra decorations, including timestamps.

If you want the amenities of logging, you have to incorporate a logger in your web application. Which one you choose is up to you, and every web app must configure its own logging.

The timestamped log entries in catalina.out are written by JULI (java.util.logging), which has been configured to send its output to stdout (redirected to catalina.out). That applies only to the Tomcat server itself, however. As I said, each webapp has to set up its own logging system.

Complex webapps often have to incorporate a logging aggregator as well (such as slf4j), since third-party libraries often use different loggers.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!