README
log4js meili appender
use in koa
import log4js from 'koa-log4';
// filter setup
app.use(log4js.koaLogger(log4js.getLogger('meili'), {
format: function(ctx, func) {
return func(`{
"userId": ":user-id",
"userType": 2,
"userNick": ":user-nick",
"traceId": ":trace-id",
"objectIds": "",
"objectType": "",
"operateType": "",
"beforeData": "",
"afterData": "",
"remarks": "",
"userIp": ":user-ip",
"userAgent": ":user-agent",
"referer": ":referrer",
"url": ":url",
"uri": ":uri",
"serverIp": ":server-ip",
"method": ":method",
"requestParams": ":requestParams"
}`);
},
level: 'auto',
nolog: '\\.(gif|jpe?g|png)