express-bunyan-logger icon indicating copy to clipboard operation
express-bunyan-logger copied to clipboard

Log without brackets

Open adammockor opened this issue 9 years ago • 2 comments

Hello,

I use express-bunyan-logger as child logger of bunyan. My config is:

var logExpressConfig = {
  type: 'app-express'
};

var logExpressExcludes = [
  'user-agent',
  'body',
  'short-body',
  'req-headers',
  'res-headers',
  'req',
  'res',
  'incoming',
  'response-hrtime'
]

var logger = bunyan.createLogger(logConfig);

var expressLogger = logger.child(logExpressConfig);

module.exports = logger;

module.exports.expressLogger = {
  logger: expressLogger,
  excludes: logExpressExcludes,
}
var expressLogger = require('../logger.js').expressLogger;
var logger = require('express-bunyan-logger')(expressLogger);
app.use(logger);

Is there way to get rid of brackets from console? Output is formated with bunyan -o short. I'm sorry if this is not problem of this package.

13:07:57.038Z  INFO app: ::1 <-- GET /login HTTP/1.1 304 - http://localhost:3000/ Chrome 41.0 Mac OS X 10.10.3 253.729234 ms (req_id=180869c9-c85d-4082-99fb-08efa77685ee, type=app-express, remote-address=::1, ip=::1, method=GET, url=/login, referer=http://localhost:3000/, http-version=1.1, response-time=253.729234, status-code=304)

adammockor avatar Apr 13 '15 13:04 adammockor

Brackets are added by bunyan command.

zdila avatar Jan 26 '17 09:01 zdila

I was not clear enough, I want to not to display content inside brackets. But I am not sure how.

But maybe this is not an issue anymore, since I saw excludes option in readme. I will check later.

adammockor avatar Jan 26 '17 15:01 adammockor