The MIT License (MIT)
@tdqs/koa-log4js koa middleware.
Installation
API documentation
Example
$ npm install @tdqs/koa-log4js
import * as Koa from 'koa';
import { resolve } from 'path';
import { koaLog } from '@tdqs/koa-log4js';
const app = new Koa();
app.use(koaLog({ mode: 'debug' })).listen(8080);
// default path /var/log/app.log
export interface IOption {
/** project name */
name: string;
/** FileAppender */
file: Partial<log4js.FileAppender>;
/** Layout */
layout: Partial<log4js.Layout>;
/** mode */
mode: 'debug' | 'default';
/** format */
format: string;
/** regexp url */
nolog: RegExp | string;
}
Following example could be found inside /tests
directory.