awesomeeng / awesome-log

Logging for enterprise ready nodejs applications.
MIT License
34 stars 4 forks source link

Map child log messages to parent fields #20

Closed 0LEG0 closed 3 years ago

0LEG0 commented 3 years ago

Is it possible to specify the parent log fields once so that they apply to all child loggers?

For example: I'd specified fields: "timestamp,level,text,args" for parent logger, but still can see in log "pid" field from child process 2021-08-12T09:42:55.415Z : INFO : jms.js : 2021-08-12T09:42:55.419Z : #18162 : INFO : jmstelnet.js : Module jmstelnet loading... ___^^^^^^^^^ I'd like to skip this field by parent logger.

Thanks.

arei commented 3 years ago

You have to specify the list of fields in the child process as well I think. It would be non-trivial to get the child to ask the parent for the list of fields and figure it out that way. Doable, but not something that's going to get done any time soon.

0LEG0 commented 3 years ago

Probably it is possible to send a configuration message from the parent process to the child with the .captureSubProcess method.