Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log without brackets #27

Open
adammockor opened this issue Apr 13, 2015 · 2 comments
Open

Log without brackets #27

adammockor opened this issue Apr 13, 2015 · 2 comments

Comments

@adammockor
Copy link

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)
@zdila
Copy link

zdila commented Jan 26, 2017

Brackets are added by bunyan command.

@adammockor
Copy link
Author

adammockor commented Jan 26, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants