🔔Sending events

Start sending events to Minilog in 5 minutes

1️⃣ Create a project

Go to your projects page and click the button + Create Project

Give it a unique short name (lowercase letters, digits, and the characters '.', '_', and '-')

2️⃣ Create a project token

After creating your first project, go to Settings > Tokens

Give the token a unique short name then click on Create

You can now copy the token by clicking the copy button next to the token.

For security reasons, only the last few characters of the token is shown

3️⃣ Setup Discord Webhook

On Discord, create a new server or, on an existing server, click on Edit Channel

In the channel settings, click on Integrations then Create Webhook

A new webhook will be created. Give it a name then click on Copy Webhook URL

On Minilog, go to your project, Settings > Alerts, then paste the webhook in the Discord text field, then click Save

🎉 Send your first event

To send an event to Minilog, make an authenticated HTTP POST request to the Event API.

The HTTP request can fail (no internet, quota exceeded), make sure to handle exceptions according to your programming language.

HTTP requests can take some time to complete (a few hundred milliseconds), make sure to not block your main process while sending logs.

await fetch("https://api.minilog.dev/v1/events/<project-name>", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <project-token>",
  },
  body: JSON.stringify({
    channel: "cron-jobs",
    title: "Cron Job Success",
    description: "The daily backup job completed successfully",
    icon: "⏰",
    tags:{
        job_name: "daily_backup",
        duration: "15 minutes",
        status: "success",
        next_run: "2024-09-05 02:00 UTC"
    }
  }),
});

As of today, we do not provide language specific libraries.

Last updated