Last updated
Was this helpful?
Last updated
Was this helpful?
There few ways you may extend Aidbox logs:
X-Correlation-Id
to add correlation id.
X-Audit-Req-Body
to log request body,
X-Audit
to add custom attributes to logs,
POST /$loggy
to add your own log into Aidbox stream.
You may send X-Correlation-Id
header and Aidbox will propagate it to w/req
& w/resp
log events.
By default aidbox doesn't log request body, because in most cases it's redudant. It may contain sensitve information (like passwords) or it may be pretty big and clog the log.
If you want to add custom data to logs, you can use X-Audit
header in the format base64(json)
— all properties from this json will be merged with w/req
and w/resp
events.
Aidbox provides POST /$loggy
endpoint that accepts logs with the defined structure from your application. These logs are ingested into the elastic log. You can find examples below.
In case you want Aidbox to log request body (e.g. ) you can provide X-Audit-Req-Body: true
header in the request.
type
Yes
string
It is a special keyword for your logs like "ui", "ui-error", "backend-crush"
message
Yes
JSON
It contains information that you want to log. It should be noted that we record your log data only from the message property
v
No
string
It means your app version.
fx
No
string
fx or event on your side from which you want to log data or error.