Log
Last updated
Last updated
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.
POST
https://api.logsnag.com/v1/log
Name | Type | Description |
---|---|---|
Content-Type* | String | application/json |
Authorization* | String | Bearer <TOKEN> |
Name | Type | Description |
---|---|---|
project* | String | Project name |
channel* | String | Channel name |
event* | String | Event name |
description | String | Event description |
icon | Emoji | Single Emoji ✨ |
notify | Boolean | Send push notification |
tags | key/value | Event tags |
parser | String | "markdown" or "text" |
user_id | String | User ID |
timestamp | Number | unix timestamp (seconds) |
Important: Fields ending with an * are required in your request!
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 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.
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.
Style | Syntax | Output |
---|---|---|
Bold | **bold** | bold |
Italic | *italic* | italic |
Link | [link](https://logsnag.com) | |
Inline Code | `code` |
|
Code Block | ```code``` |
|
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.