0.2.0 • Published 1 year ago

@matfire/adonis-logsnag v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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
  }
}
0.2.0

1 year ago

0.1.0

1 year ago