koa-logline
Minimal, dependency-free logging middleware for Koa web apps.
Install
npm install --save koa-logline
API
Returns an async function that plugs into a Koa middleware stack.
The stream
argument is an optional stream to write request logs to. If not provided, it defaults to stdout
.
Log lines are written in the Common Log Format.
Usage
Default logging to stdout
:
const koa = const logline = const app = app app
Logging to syslog using the syslog2 library:
const koa = const logline = const syslog = const app = const log = app app
Alternatives
This package was written for a very specific use case and may not be right for yours. If you require more configurability or flexibility, search NPM for ‘koa log’ and check out the alternatives.
License
Copyright 2018 Digivizer Pty Ltd.
This project is open source under the terms of the ISC license. See the LICENSE
file included with this software distribution for more information.