Skip to content

AntSworD/logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Different with koa-logger - Diy your logger

The Logger which diy by yourself have to defined a method that name log or info.

const logger = require('koa-diy-logger')
const Koa = require('koa')
const diyLogger = require('log4js').getLogger();

const app = new Koa()
app.use(logger(diyLogger))

koa-logger

npm version build status

Development style logger middleware for koa.

Notice: koa-logger@2 supports koa@2; if you want to use this module with koa@1, please use koa-logger@1.

<-- GET /
--> GET / 200 835ms 746b
<-- GET /
--> GET / 200 960ms 1.9kb
<-- GET /users
--> GET /users 200 357ms 922b
<-- GET /users?page=2
--> GET /users?page=2 200 466ms 4.66kb

Installation

$ npm install koa-diy-logger

Example

const logger = require('koa-logger')
const Koa = require('koa')

const app = new Koa()
app.use(logger())

Notes

Recommended that you .use() this middleware near the top to "wrap" all subsequent middleware.

License

MIT

About

Development style logging middleware

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%