HTTP-JSON Configuration

Your log data must not contain any personal data, such as names, email addresses, etc. It is your responsibility to ensure this data is filtered out before being sent to AppSignal, and when identifying a person is necessary that your application uses alternative forms of identification such as a user ID, hash, or pseudonym.

Endpoint

You can POST logs to AppSignal. Your logs must be formatted in NDJSON and sent to the following endpoint:

shell
https://appsignal-endpoint.net/logs/json?api_key=YOUR_LOG_SOURCE_API_KEY

NDJSON

Our HTTP-JSON endpoint expects the logs to be sent in an NDJSON format to our endpoint. NDJSON stands for Newline Delimited JSON, which means that each log line is it's own JSON object, for example:

shell
{"timestamp": "2022-06-02T04:17:25.783Z", "message": "foo", [...]} {"timestamp": "2022-06-02T04:17:26.000Z", "message": "bar", [...]}

Required Data

Below is an example of a (prettified) NDJSON message. You can read more about the data AppSignal requires in the Required Fields section.

Example message

Warning: This is formatted using newlines for readability. Your client must send the log line as a single line, without newlines.

json
{ "timestamp": "2022-06-02T04:17:25.783Z", "group": "organisations", "severity": "warn", "message": "This is a test message", "hostname": "frontend1", "attributes": { "org": "appsignal", "step": 1, "seen_terms": true, "entries": 10.01 } }

Required Fields

AppSignal will silently drop any message that does not contain the fields below or any incorrect values.

The NDJSON payload you send to AppSignal must contain the following fields:

timestamp

A RFC 3339 formatted timestamp with a 3-digit nanosecond precision.

shell
YYYY-MM-DDThh:mm:ss.sss 2022-01-12T07:20:50.520Z

group

One-word string that allows the user to separate log lines by a certain context (e.g., logs for a specific part of your application, group could be "admin", "payments", "database", or "background").

severity

The severity field accepts the following values: unknown, trace, debug, info, notice, warn, error, critical, alert and fatal.

message

Plaintext message.

hostname

Hostname of the server sending the message.

attributes

Attributes that can be used to filter or search the message, with the following rules:

  • Attributes cannot be nested or contain arrays
  • The maximum key size is 50 characters
  • The maximum amount of attributes is 100
  • The following primitives are accepted as values:
    • String: ideally used as "tags," e.g. one-word values, with a maximum of 100 characters
    • Integer: 10
    • Double: 0.01
    • Boolean: true/false