Logging & Audit
Aidbox produces structured logs on every signifact event to the internal stream which you may direct to different ways:
Aidbox logs can be used in audit. Please, see our article on auditing for more info.

You can get current logs through REST API by GET /_logs - response will be Chunked Transfer Encoding stream of new line separated JSON objects:
GET /_logs
# resp
{"d":3,"sql":"\nselect true from _box where id = 'self'\nand resource @>\njsonb_build_object(\n 'participant',\n jsonb_build_array(json_build_object('user', json_build_object('id', ?::text )))\n) ","db_prm":["github-32066"],"ts":"2019-04-18T13:35:43Z","w":"w3","ev":"db/q","tn":"edgeniquola","ctx":"d0625fcf-f1a7-4b78-bbdf-b4ec87b6fb57"}
{"d":8,"sql":"SELECT \"patient\".* FROM \"patient\" LIMIT ? OFFSET ?","db_prm":["100","0"],"ts":"2019-04-18T13:35:43Z","w":"w3","ev":"db/q","tn":"edgeniquola","ctx":"d0625fcf-f1a7-4b78-bbdf-b4ec87b6fb57"}
Please, pay attention, that you will not see the response for GET /_logs request in the Aidbox REST console. Use the terminal, or the browser console instead.

Aidbox sends logs into stdout if one of these env variables defined: AIDBOX_STDOUT_JSON, AIDBOX_STDOUT_PRETTY.

If you prefer to write logs into the file system, in the .env file specify AIDBOX_LOGS environment variable with a relative path to the desired location.
Another option is to store logs in the ElasticSearch. Please, read the details here​
Copy link
Edit on GitHub
On this page
Logs API
Configure logging
Stdout log
Log to file