Debug logging

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
 
Resin provides a number of diagnostic messages using the JDK logging facility. Full debug logging is enabled with an empty name (meaning match all names) and a level of 'finer'. Since this will produce many messages, it is useful to put the messages in a a seperate file.
 
Resin provides a number of diagnostic messages using the JDK logging facility. Full debug logging is enabled with an empty name (meaning match all names) and a level of 'finer'. Since this will produce many messages, it is useful to put the messages in a a seperate file.
  
== Full debug logging of the server and all applications ==
+
= Full debug logging of the server and all applications =
  
 
The following configuration creates a debug log for each day, and when a problem occurs the debug log is used to help find out what the problem is. Since the <[[log]]> entry is in resin.conf, the log will capture messages from the server itself and all applications. The resulting log messages are found in the file $RESIN_HOME/log/debug.log.
 
The following configuration creates a debug log for each day, and when a problem occurs the debug log is used to help find out what the problem is. Since the <[[log]]> entry is in resin.conf, the log will capture messages from the server itself and all applications. The resulting log messages are found in the file $RESIN_HOME/log/debug.log.
Line 9: Line 9:
 
  <resin>
 
  <resin>
 
   ...
 
   ...
   <log name='' level='finer' path='log/debug.log'
+
   <log name="" level="finer" path="log/debug.log"/>
        timestamp="[%H:%M:%S.%s]"
+
        rollover-period='1D'/>
+
 
   ...
 
   ...
 
  </resin>
 
  </resin>
Line 17: Line 15:
 
More specific areas can be targetted with appropriate values for name. The documentation for <log> provides a table of useful values for name.
 
More specific areas can be targetted with appropriate values for name. The documentation for <log> provides a table of useful values for name.
  
== Full debug logging of one web application ==
+
= Full debug logging of one web application =
  
Often you can narrow down the logging requirements to a single web application. The log entry can be placed in <web-app-root>/WEB-INF/web.xml and only log messages from that web application will go to the log file.
+
Often you can narrow down the logging requirements to a single web application. The log entry can be placed in [[web.xml]] and only log messages from that web application will go to the log file.
  
 
The following configuration creates a debug log for each day in <web-app-root>/WEB-INF/work/debug.log.
 
The following configuration creates a debug log for each day in <web-app-root>/WEB-INF/work/debug.log.
  
 
Full debug logging of one application to <web-app-root>/WEB-INF/work/debug.log
 
Full debug logging of one application to <web-app-root>/WEB-INF/work/debug.log
<!-- <web-app-root>/WEB-INF/web.xml -->
 
  
 
  <web-app>
 
  <web-app>
 
   ...
 
   ...
   <log name='' level='finer' path='WEB-INF/work/debug.log'
+
   <log name="" level="finer" path="WEB-INF/work/debug.log"/>
        timestamp="[%H:%M:%S.%s]"
+
        rollover-period='1D'/>
+
 
   ...
 
   ...
 
  </web-app>
 
  </web-app>

Revision as of 06:32, 13 February 2006

Resin provides a number of diagnostic messages using the JDK logging facility. Full debug logging is enabled with an empty name (meaning match all names) and a level of 'finer'. Since this will produce many messages, it is useful to put the messages in a a seperate file.

Full debug logging of the server and all applications

The following configuration creates a debug log for each day, and when a problem occurs the debug log is used to help find out what the problem is. Since the <log> entry is in resin.conf, the log will capture messages from the server itself and all applications. The resulting log messages are found in the file $RESIN_HOME/log/debug.log.

Full debug logging of the server to $RESIN_HOME/log/debug.log

<resin>
  ...
  <log name="" level="finer" path="log/debug.log"/>
  ...
</resin>

More specific areas can be targetted with appropriate values for name. The documentation for <log> provides a table of useful values for name.

Full debug logging of one web application

Often you can narrow down the logging requirements to a single web application. The log entry can be placed in web.xml and only log messages from that web application will go to the log file.

The following configuration creates a debug log for each day in <web-app-root>/WEB-INF/work/debug.log.

Full debug logging of one application to <web-app-root>/WEB-INF/work/debug.log

<web-app>
  ...
  <log name="" level="finer" path="WEB-INF/work/debug.log"/>
  ...
</web-app>
Personal tools