@matfire/adonis-logsnag

0.2.0 • Public • Published

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

Package Sidebar

Install

npm i @matfire/adonis-logsnag

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

8.25 kB

Total Files

16

Last publish

Collaborators

  • matfire