AppEnlight is now Open Source! Read more here...

Logging API Interface

All access to the API is secured by https protocol.

All data is expected to be sent via json payloads with the header Content-Type: application/json

All requests are normally authenticated by passing headers:

X-appenlight-api-key: APIKEY - server side requests

X-appenlight-public-api-key: PUBLIC_APIKEY - client side requests(javascript) - you want to use this for CORS support

The key values can be passed as query parameters for all endpoints as public_api_key=YOURPUBKEY. This might be required especially for JavaScript clients.

So all requests like:

will work too.

Anatomy of request to log API:

  "log_level": "WARNING",
  "message": "OMG ValueError happened",
  "namespace": "some.namespace.indicator",
  "request_id": "SOME_UUID",
  "permanent": false,
  "primary_key": "random_key",
  "server": "some.server.hostname",
  "date": "2011-09-25T21:46:38.955371",
  "tags": [["tag1","value"], ["tag2", 5]]
  "log_level": "ERROR",
  "message": "OMG ValueError happened2",
  "namespace": "some.namespace.indicator",
  "request_id": "SOME_UUID",
  "permanent": false,
  "server": "some.server.hostname",
  "date": "2011-09-25T21:46:38.955371"

A request to API is a list of log messages.

Each entry is a dictionary (array) of values.

At minimum, a request must contain:

  • A list with at least one entry
  • An entry should contain following keys: message
  • The whole HTTP body of an API request needs to be less than 1024kb

Possible keys of log object

Parameter Description
log_level optional saved up to 10 chars

Contains severity level for log entry

Example values: info, error, critical

message optional saved up to 4096 chars

Contains actual log message body

Example values: Something happened here

namespace optional saved up to 128 chars

Identifies the origin of log message

Example values: package.module, apache:logs

request_id optional saved up to 40 chars

Contains the UUID identifier of the request that generated the report, can be used to corellate log entries with reports/same transaction

Example values: 86982b00-5fbb-11e4-a252-0002a5d5c51b

permanent optional

Informs the server to store the log in a permanent per-month partition instead of a rotated per-day one

Example values: true

primary_key optional

Informs the server to overwrite old log entries with new data if the primary key matches and the entry date is newer than the existing one

Example values: "1234567"

server optional saved up to 128 chars

Specifies the name of the machine or instance that the application is running on

Example values:

date optional

Contains the log creation time of in UTC - will be used to calculate request duration, default: current UTC time of report arrival

Example values: 2013-12-05T21:46:38.955371