Airlock Microgateway includes a default access log configuration sufficient for most use cases.
Nevertheless, it is possible to customize the access log format using the Envoy format dictionary style. Both standard Envoy command operators and Airlock Microgateway custom command operators may be used in the configuration.
The CR Telemetry reference documentation contains the default access log configuration. It can be used as a starting point for customization.
Example:
Following our example settings, a formatted log message for a request looks like this:
{
"@timestamp": "2023-01-06T13:45:20.146204824Z",
"log": {
"level": "info",
"logger": "access"
},
"request": {
"protocol": "HTTP/1.1"
}
}
The different log types, such as access or application logs, can be printed using the kubectl logs
as mixed output. You may filter the printed logs according to your needs for better orientation.
- Use
kubectl logs <POD> -c airlock-microgateway-engine
to print the logs for the engine container in a pod. For more options, see kubectl logs reference. - Use
grep <query>
to filter the log-message output according to your requirements. - With the jq-JSON processor (or equivalent) installed, you may pipe the logs output to the processor for better formatting and readability. See JQ for further information.
See also the API Reference documentation link at the end of this article.