Enabling agent traffic logging
Enable agent audit logging, including requests and responses.
Steps
-
Edit the
<PA_HOME>/conf/log4j2.xml
file. -
In the Logger section, uncomment the
AppenderRef
element for the agent audit log HAR file.Example:
<!-- Audit Log Configuration--> ... <Logger name="agentaudit" level="INFO" additivity="false"> <AppenderRef ref="AgentAuditLog-File"/> <!--<AppenderRef ref="AgentAuditLog-Database-Failover"/>--> <!--<AppenderRef ref="AgentAuditLog-SQLServer-Database-Failover"/>--> <!--<AppenderRef ref="AgentAuditLog-PostgreSQL"/>--> <!--<AppenderRef ref="AgentAudit2Splunk"/>--> <AppenderRef ref="AgentAuditLog-HarFile"/> </Logger>
-
In the Appenders section, uncomment the
RollingFile
element for the engine audit log HAR file.Example:
<Appenders> ... <RollingFile name="AgentAuditLog-HarFile" fileName="${sys:pa.home}/log/pingaccess_agent_audit_har.log" filePattern="${sys:pa.home}/log/pingaccess_agent_audit_har.%d{yyyy-MM-dd}.log" ignoreExceptions="false"> <StatusCodeRegExFilter regex=".*"/> <HarLogLayout> <KeyValuePair key="AUDIT.metadata" value="true"/> <KeyValuePair key="AUDIT.http-client" value="true"/> <KeyValuePair key="AUDIT.http-app" value="true"/> </HarLogLayout> <Policies> <TimeBasedTriggeringPolicy /> </Policies> </RollingFile> </Appenders>
-
Optional: To filter the entries to add to the log file, edit the value of the
StatusCodeRegExFilter
element. -
Optional: To specify what information to log, add or edit the values in the
HarLogLayout
section of theRollingFile
element.You can add or edit metadata, client response, and app response values. For more information, see Traffic logging reference.
Result
Logging begins when the configuration reloads. The configuration reloads at regular intervals according to the monitorInterval
value.