The Logging API covers 2 sub-APIs:
The Logging API is enabled globally by default, and can be disabled with the LOGGING_API
config option set to false
.
It is fully accessible to all the clients which have the logging/all
permission enabled.
The API endpoints rely on the base endpoint of each client.
In this documentation, we will designate the base endpoint by <base-endpoint>
.
To get the base endpoint of a client:
Access > API Consumers > Clients
page.(i)
icon of a client.Base endpoint
label. Use the GET
method on <base-endpoint>/logs
with the following params:
Param | Description |
---|---|
types | Optional JSON encoded array of logs types, including exception , xapi , api , ui , console , auth , stream . |
levels | Optional JSON encoded array of levels, including 0 (debug), 1 (info), 2 (notice), 3 (warning), 4 (error), 5 (critical), 6 (alert), 7 (emergency). |
min_level | Required int. Return logs from this level and higher. |
store | Optional slug of a store. |
Use the POST
method on <base-endpoint>/log-channels
with the following JSON props:
Param | Description |
---|---|
type | Required string: database , single , daily , slack , papertrail , syslog , errorlog , stderr . |
log_types | Optional JSON encoded array of logs types, including exception , xapi , api , ui , console , auth , stream . |
min_level | Required int: 0 (debug), 1 (info), 2 (notice), 3 (warning), 4 (error), 5 (critical), 6 (alert), 7 (emergency). |
Use the PUT
method on <base-endpoint>/log-channels/<channel-id>
with the same above content.
Use the GET
method on <base-endpoint>/log-channels
.
Use the GET
method on <base-endpoint>/log-channels/<channel-id>
.
Use the DELETE
method on <base-endpoint>/log-channels
.
Use the DELETE
method on <base-endpoint>/log-channels/<channel-id>
.