Tuesday, March 4, 2014

Troubleshooting and performance using ServiceLogger

ServiceLogger is a new lightweight trace that can be used in mainly in Production environment. This feature available in 7.0.0.4 onwards.

Add the  following code to web.xml file for the Stores.war project. This is for logging of JSP execution times with ServiceLogger requires a new Servlet Filter is registered in web.xml file.


<filter>
  <filter-name>JspExecutionServiceLoggingFilter</filter-name>
<filter-class>com.ibm.commerce.webcontroller.JspExecutionServiceLoggingFilter</filter-class>
  <init-param>
    <param-name>ServletName</param-name>
    <param-value>JspExecutionServiceLoggingFilter</param-value>
  </init-param>
</filter>


<filter-mapping>
  <filter-name>JspExecutionServiceLoggingFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>

Enabling the Logger in the WAS Admin Console:-

com.ibm.commerce.foundation.logging.ServiceLogger={fine,finer,finest}
 
The difference with this logger is that it will write more or less depending on the logging level selected {fine,finer,finest}. This  fine grained control allows to minimize the performance impact for use in production and other environments.

No comments:

Post a Comment