Socket
Socket
Sign inDemoInstall

koa-log4

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-log4

log4js-node support Koa-middleware


Version published
Weekly downloads
126
decreased by-50.97%
Maintainers
1
Weekly downloads
 
Created
Source

koa-log4js

A wrapper for log4js-node which support Koa logger middleware. Log message is forked from Express (Connect) logger file.

Note

This branch is use to Koa v2.x. To use Koa v0.x & v1.x, please check the master branch.

Installation

for koa v0.x & v1.x
$ npm i --save koa-log4@1
for koa v2.x
$ npm i --save koa-log4@2

The default logger is for koa v2.x

$ npm i --save koa-log4

Usage

Config koa-log4js is same as the original log4js-node.

Normal log4js way

This way is same as the original log4js-node.

const log4js = require('koa-log4')

const log = log4js.getLogger('index')
log.info('index do some awesome things')

Koa-middleware way

Similar to use Express (Connect) logger middleware.

const log4js = require('koa-log4')
app.use(log4js.koaLogger(log4js.getLogger("http"), { level: 'auto' }))

Full Example

Check this repo for full example with Koa v2.

Others

See here for more info.

Keywords

FAQs

Package last updated on 15 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc