TraceTagFilter
The TraceTagFilter can be used to trace some information on each log line. The configured elements will be traced for all filters and servlets mapped between the TraceTagFilter and the back end. If a ch.nevis.navajo.tracing.TraceId.Format
is configured, the elements configured in the TraceTagFilter will just be logged after the trace-id (separated by a dot). If no ch.nevis.navajo.tracing.TraceId.Format
is configured, then those elements will appear right after the thread-id.
Classname
ch::nevis::nevisproxy::filter::audit::TraceTagFilter
Library
libNPAuditFilters.so.1
Configuration
Tag
- Type: string
- Usage Constraints: required, conditional
- Default: none
- Supported pragmas: break
- Conditional string with attributes and variables which will be logged on each log line. You can use
ENV:<environment-variable>
;HEADER:<header-name>
;AUTH:<auth-attribute-name>
;SESSION:<session-attribute>
etc.
Examples
To trace the session-id on each log line, you can configure the filter like this:
<filter>
<filter-name>TraceTagFilter</filter-name>
<filter-class>ch::nevis::nevisproxy::filter::audit::TraceTagFilter</filter-class>
<init-param>
<param-name>Tag</param-name>
<param-value>
ENV:bcx.servlet.session.HttpSessionId
</param-value>
</init-param>
</filter>
This sample will log this, if a backend is down:
2017 07 28 10:00:30.050 isi3web IW4HttpCon 31634.139671601661696.7b92-abc-15d88360be7.7b92000a05d1ZgsaGq7GjMC1cOK50gaCBCRzHrwRjiFaNBQLVZs1IAAFSN 3-ERROR : HINT: check the init-param 'InetAddress' or 'OutboundProxy' (if applicable) for this Http(s)ConnectorServlet
2017 07 28 10:00:30.054 isi3web IW4HttpCon 31634.139671601661696.7b92-abc-15d88360be7.7b92000a05d1ZgsaGq7GjMC1cOK50gaCBCRzHrwRjiFaNBQLVZs1IAAFSN 3-ERROR (GW50): HttpConnectorServlet_1_0::handleRequest:(HttpConnectorServlet) failed: resource='nevis.ch:443' state='CONNECTING' IOException ('bc::net::PlainSocketImpl_1_0::connect - Connection refused (nevis.ch/10.0.209.5/10.0.209.5:443)')
Where 7b92000a05d1ZgsaGq7GjMC1cOK50gaCBCRzHrwRjiFaNBQLVZs1IAAFSN
is the session ID.