Extending Aidbox Logs
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.
X-Correlation-Id
You may send X-Correlation-Id
header and Aidbox will propagate it to w/req
& w/resp
log events.
X-Audit-Req-Body
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.
In case you want Aidbox to log request body (e.g. FHIR Search over POST) you can provide X-Audit-Req-Body: true
header in the request.
X-Audit Header
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.
$loggy Endpoint
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.
$loggy Input Params
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.
Example
Last updated