All docs This doc
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The access logs contain entries for service and REST API invocations and for Management Console access. The service/API invocation log resides in the <ESB_HOME>/repository/logs folder and has a default name of http_access_<YYYY>_<MM>_<DD>.log, such as http_access_2013_01_01.log for activity on January 1, 2013. Similarly, the Management Console access log is written to the file <ESB_HOME>/repository/logs/http_access_management_console_<YYYY>_<MM>_<DD>.log. Both access logs are rotated daily.

To customize the Management Console access log, including the location where the file is written and the format, you can edit the ESB_HOME>/repository/conf/tomcat/catalina-server.xml  file. In the catalina-server.xml file, under valves you can find the following access log configuration where you can modify the  org.apache.catalina.valves.AccessLogValve attributes.

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs"
               prefix="http_access_management_console_" suffix=".log"
               pattern="combined" />

The access log entries for service/API invocations use a modified version of the Apache combined log format, as follows:

  %{X-Forwarded-For}i %h %l %u %t "%r" %s %b "%{Referrer}i" "%{User-Agent}i"

The X-Forwarded-For header is appended to the beginning of the usual combined log format in order to correctly identify the original node that sent the request when requests may go through a proxy such as a load balancer. The X-Forwarded-For header must be present in the incoming request for this to be logged. 

You can disable the access logs for service/API invocations if you need to improve performance. For more information, see Performance Tuning.

You can log synapse/axis2 API requests in a configurable file using the <ESB_HOME>/repository/conf/ file.

If you want to log synapse/axis2 API requests in a custom directory, add the  access_log_dire ctory property to the <ESB_HOME>/repository/conf/ file and specify the path to the custom directory. For example,  access_log_dire ctory="/logs/wso2esblogs"Similarly, you can configure the following properties in the <ESB_HOME>/repository/conf/ file based on how you want to log  synapse/axis2 API requests.

  • Default access log pattern
    e.g., access_log_pattern=%{X-Forwarded-For}i %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"

  • combinded log pattern
    e.g.,  access_log_pattern=%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"

  • common log pattern
    e.g.,  access_log_pattern=%h %l %u %t \"%r\" %s %b

  • file prefix
    e.g.,  access_log_prefix=http_access_

  • file suffix
    e.g.,  access_log_suffix=.log

  • file date format
    e.g.,  access_log_file_date_format=yyyy-MM-dd

  • No labels