HTTP Configuration
The HTTP endpoint is the most flexible endpoint to send logs to AppSignal. You can format the message in multiple ways as described below.
If you are using a language that has an integration library for AppSignal, we recommend using one of the integration libraries instead of the HTTP endpoint.
If you are creating a custom integration, we recommend using the HTTP-JSON endpoint to guarantee the messages are formatted exactly as intended.
Endpoint
You can POST
logs to AppSignal. Your logs must be formatted in JSON
, Logfmt
or Plaintext
and sent to the following endpoint:
https://appsignal-endpoint.net/logs?api_key=YOUR_LOG_SOURCE_API_KEY
ReplaceYOUR_LOG_SOURCE_API_KEY
with the key provided when creating a log source.
We will use the time our servers receive the POST
request as the log timestamp. The default severity will be INFO
. You can send the hostname
, severity
and group/appname
parameters by appending them to the URL, for example:
https://appsignal-endpoint.net/logs?group=app&hostname=frontend1&severity=debug&api_key=YOUR_LOG_SOURCE_API_KEY
You can send multiple log lines by separating each log line with a-formatted message overrides the hostname newline character: \n
Structured messages
In order to add additional metadata to a log line, you can send a structured message.
Plaintext
By default the source is created with the Plaintext
formatter selected,
you can send any string as the message part of the log line, for example:
Will result in two log lines with the message This is a log message
and And this is another message
respectively.
Logfmt
When Logfmt
is selected as the message format, you can send a log line with key-value pairs separated by a space, for example:
Will result in two log lines with the message This is a log message
and This is another log message
respectively, and the following attributes:
JSON
When JSON
is selected as the message format, you can send a log line with a JSON object, for example:
We expect either a msg
or message
key for the log line message, and any other keys will be added as attributes. If no msg
or message
key is provided, we'll use the entire (unparsed) JSON object as the message. Attributes will still be parsed and added to this line.
You can read more about the specifics of message formatting in our formatting documentation.