From 9c6f997c2adb7e4e550232e5f71fdc58b7c46062 Mon Sep 17 00:00:00 2001 From: Andrew Pietila Date: Tue, 28 Mar 2023 23:45:03 -0500 Subject: [PATCH] Fix logging. --- app.js | 8 ++------ lib/log.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index e97e633..9a69689 100644 --- a/app.js +++ b/app.js @@ -13,12 +13,8 @@ const log = require('./lib/log'); dot: true, }); app.use(log4js.connectLogger(log.accessLog, { - level: log4js.levels.INFO, - format: (req, res, formatter) => { - formatter( - ':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"' - ); - } + level: 'auto', + format: ':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"' })); const pathMatches = []; app.use((req, _res, next) => { diff --git a/lib/log.js b/lib/log.js index 5ab74bc..5f97311 100644 --- a/lib/log.js +++ b/lib/log.js @@ -15,5 +15,5 @@ log4js.configure({ module.exports = { default: log4js.getLogger('default'), - accessLog: log4js.getLogger('accessLog') + accessLog: log4js.getLogger('access') };