Skip to content

Commit 828e197

Browse files
authored
Stop logging all finished requests to reduce log noise (nodejs#176)
Thought I'd do a rounds of much needed cleanup on this bot, starting with the logs. So far we have been logging absolutely *all* finished requests which results in a lot of noise in logs. Local example: ``` $ npm start .. 12:13:32.529Z INFO bot: Listening on port 3000 12:13:34.468Z INFO bot: request finish (req_id=8812b800-6bde-11e8-add8-f393315a261f, duration=3.191551, req.query={}, req.remoteAddress=::1, req.remotePort=63894) GET /ping HTTP/1.1 host: localhost:3000 user-agent: curl/7.54.0 accept: */* -- HTTP/1.1 200 OK X-Powered-By: Express X-Request-Id: 8812b800-6bde-11e8-add8-f393315a261f Date: Sat, 09 Jun 2018 12:13:34 GMT Connection: keep-alive Content-Length: 4 ``` Personally cannot remember once where this request information has actually been valuable. If it turns out I'm wrong, we could easily enable this again if needed for debugging purposes. /cc @nodejs/github-bot
1 parent c1c2ad3 commit 828e197

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ if (logsDir) {
2525

2626
// bunyanMiddleware gives us request id's and unique loggers per incoming request,
2727
// for satefy reasons we don't want to include the webhook GitHub secret in logs
28-
app.use(bunyanMiddleware({ logger, obscureHeaders: ['x-hub-signature'] }))
28+
app.use(bunyanMiddleware({
29+
logger,
30+
level: 'trace',
31+
obscureHeaders: ['x-hub-signature']
32+
}))
2933

3034
require('./lib/github-events')(app)
3135

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"basic-auth": "^1.0.4",
1818
"body-parser": "^1.15.0",
1919
"bunyan": "^1.8.1",
20-
"bunyan-middleware": "^0.3.1",
20+
"bunyan-middleware": "0.8.0",
2121
"debug": "^2.2.0",
2222
"dotenv": "^2.0.0",
2323
"express": "^4.13.4",

0 commit comments

Comments
 (0)