Skip to content

matfire/adonis-logsnag

Repository files navigation

Adonis Logsnag

NPM Version GitHub License A package to expose a logsnag instance inside AdonisJS's http handler.

Install

install the package by using

npm install @matfire/adonis-logsnag

Configure

configure the package using ace

node ace configure @matfire/adonis-logsnag

This will create a logsnag.ts config file in the config folder, along with adding a couple validation rules for your .env file. Once all this is done, you'll need to add some variable to the .env:

  • LOGSNAG_TOKEN: your logsnag token
  • LOGSNAG_PROJECT: your logsnag project id

Use

Once the module is enabled, it will inject a logsnag instance into your HttpContext: you can use like you would any logsnag instance. One way to get that instance would be:

class AppController {
  index({logsnag}: HttpContext) {
    logsnag.track() // or anything else logsnag can do
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published