Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

AdonisJs logger to log http requests

Notifications You must be signed in to change notification settings

adonisjs/adonis-http-logger

Adonis Http Logger

Add-on to log your Http requests using Adonis inbuilt logger.

Greenkeeper badge

Add-on to log your Http requests using Adonis inbuilt logger.

Setup

Start by installing it from npm.

adonis install @adonisjs/http-logger

# yarn
adonis install @adonisjs/http-logger --yarn

Register provider

Register the provider inside start/app.js file.

const providers = [
  '@adonisjs/http-logger/providers/LoggerProvider'
]

That's all :)

Config

There is only one config setting, that is to define the environments in which the logger should run.

You have to modify the existing config/app.js file and the following setting.

module.exports = {
  http: {
    loggerEnv: ['development', 'production']
  }
}

By default, it will log in every environment.

Sane defaults

This module will internally make use of AdonisJs Logger provider, which means it will log messages using the default driver.

When json:true config is set. It will log request properties as a JSON object, so that you can easily query over them.

Check the following screenshot when json=true and logs are sent to Loggly.

About

AdonisJs logger to log http requests

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •