A package to expose a logsnag instance inside AdonisJS's http handler.
install the package by using
npm install @matfire/adonis-logsnag
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
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
}
}