Open DullingWine opened 5 years ago
Any update on this ?
Is this a duplicate of #1596 and/or addressed by #1989?
Is this a duplicate of #1596 and/or addressed by #1989?
Further review of this issue I don't believe it to be a duplicate of the above metadata issue. Although the root problem is likely to be similar.
I think I'm running into the exact same thing in 3.8.1. I got excited and thought the main point of labels was that you could override them in children, but nothing seems to happen...
@E5-Aaron I am not familiar with the implementation of the label format. Although I don't believe it's intended to behave in the manner of which you're desiring.
I figured out the way the meta object was merged in the child is "up" a level compared to the initial configuration of the logger. So, I abandoned use of the 'label' formatter in the parent entirely, and used a printf formatter that uses a label element instead.
Then I can override the label in a child logger via
const l = logger.child({ label: 'foo' });
any news ?
Hello
Try as a I might I can't get a child logger to override format properties in a parent logger. Ideally what I would like to do is have a parent logger set all of the format properties but the label and then set that in a child logger (which I will vend on a per class basis). But I find i can't even set the entire format object at the child property, let alone override properties in a parent logger. Am wondering whether I simply have the wrong end of the stick with child loggers or whether this is a bug?
The basic root looks like this:
if I define a child logger like this:
with:
and then I log with this logger, it won't print out the timestamp or the label ( it will print out undefined for both)
Even if I define the format in the rootLogger, like this:
Then I still can't get a child logger to show a label, not matter how i try to combine etc.
Is this bug? Or am I just not "doing it right"?
Thanks