0

Is there any way by which we can block the logging of printstacktrace in catalina.out file.

i want to record the other logs in this file but i dont want to record the printstacktrace related logs.

Currently we are using log4j version 1 and tomcat server version 8.5.9

Deepti
  • 9
  • 5
  • as per my understanding you dont want to log exception stacktrace, am i correct ? – Abhijit Humbe Jan 12 '18 at 00:44
  • yes i want to exclude logging of exception stacktrace in catalina.out file. – Deepti Jan 12 '18 at 06:38
  • If you use log4j > 1.2.16, you can use the EnhancedPatternLayout layout. Example (with a log4j.properties file), define it as the layout of your appender, and then add %throwable{0} in the conversion pattern: log4j.appender.XXX.layout=org.apache.log4j.EnhancedPatternLayout log4j.appender.XXX.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c:%L - %m%n%throwable{0} – Abhijit Humbe Jan 12 '18 at 18:01

0 Answers0