Redirect logs to stdout
stdoutinstead of to separate files, allowing the logs to be read directly from each container by an external logging service (for example, Elastic Stack or Splunk).
2 minute read
The trace log behavior can be modified through the
trace.xml file or the system environment variables.
NoteThe environment variables override the
trace.xmlfile settings. This enables the logging behavior of individual containers to be defined at runtime.
Redirect trace logs using the trace.xml file
INSTALL_DIR/apigateway/system/conf/trace.xml file as follows:
- Disable the trace file on disk by commenting out the following line:
<!--<FileRolloverTrace maxfiles="500" filename="%s\_%Y%m%d%H%M%S.trc"/>-->
- Enable JSON output by changing the
jsonOutputproperty value to
<FileTrace filename="@stdout" jsonOutput="true"/>
Redirect trace logs using system environment variables
Ensure the following environment variables are passed to the container:
Open traffic logs
The open traffic log behavior can be modified through the Policy Studio settings or system environment variables.
NoteThe environment variables override the Policy Studio settings. This enables the logging behavior of individual containers to be defined at runtime.
Redirect open traffic logs using Policy Studio
Select the Server Settings node in the Policy Studio tree, click Logging > Open Traffic Event Log, and select Use console/traces from the Event Log Output field.
Redirect open traffic logs using system environment variables
Ensure the following environment variable is passed to the container:
For more information on trace logging and open traffic logging, see the API Gateway Administrator Guide. This guide also describes the open logging JSON schema.
For more information on the environment variables that you can specify at runtime, see Environment variables reference.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.