I am working on a big project that uses a custom built logger library. Multiple microservices are using the same logger libary. All the logs printed in the console are of json type. These logs have some specific fields added to the json payload using the custom logger lib.
I am connecting to mongodb, kafka, websocket etc using external jars. They mostly use .slf4. The logs printed by these external libraries are in json format but the additional properties are not added as they depend on simple loggers.
Is there a way to intercept and enrich logs or whatever is printed in the console. I need to add my project specific properties to these logs as well.
Trying to find a way to intercept the logs before being printed on the console.