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

parentLogger.child(options) does not inherit 'hostname' field of parent #303

Closed
RBLU opened this issue Oct 14, 2015 · 1 comment
Closed

Comments

@RBLU
Copy link

RBLU commented Oct 14, 2015

The child() call is setting the 'hostname' field in client with os.hostname() instead of inheriting from parent. So when the parent uses a non-default 'hostname' the child does not inherit this field.

For us this caused quite a bit of confusion when log messages would be "missing" on our central logserver (because of the usual filter by hostname they never showed up, they had the physical hostname in there, where we expected the hostname that was specifically set in all parent loggers).

Same applies to PID, but there it did not hurt us.

is this intentional or a bug?

@RBLU RBLU changed the title parentLogger.child(options) overwrites 'hostname' field of parent parentLogger.child(options) does not inherit 'hostname' field of parent Oct 14, 2015
@kfiroo
Copy link

kfiroo commented Nov 18, 2015

I'm having the same issue. I believe it's a bug.
My current solution is to wrap the 'create child' method and ensure the hostname param is passed to the child logger.
I guess you can do the same with the PID.

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

No branches or pull requests

3 participants