Log

Logs are the core of LogSnag. They are used to track events in your application. These events could be anything from user actions to server events, such as a database running out of space or a server crash.

Publish an event to LogSnag.

POST https://api.logsnag.com/v1/log

Headers

Request Body

{
    // Response
}

Important: Fields ending with an * are required in your request!

Icon

You may add an emoji icon to your logs to make identifying the type of event easier. For example, you could add an 💰 icon to a log that tracks a payment event. Optionally, you may use emoji shortcodes instead of the actual emoji character. For example, you could also use :moneybag:

Tags

Tags are key-value pairs that can add additional information to a log. For example, you could add a "plan" tag with a " premium " value to a log that tracks a payment event.

Note that tag keys may only contain lowercase alphabet characters and are optionally separated with - dashes. For example, plan and plan-type are valid tag keys, but Plan and plan_type are not. Values may be any string, boolean, or number.

Markdown

You may set the parser parameter to markdown to parse the description as markdown. This is useful for making your log descriptions more readable and adding links to external resources.

Historical Data

You may add historical logs to LogSnag by adding a timestamp parameter to your logs. The timestamp parameter should be a unix timestamp in seconds. Remember that you will not receive a push notification for historical logs.

Last updated