projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.89k stars 2.39k forks source link

Enhancements: Extended Logging Support #1159

Open psramkumar opened 8 years ago

psramkumar commented 8 years ago

it is better to have extended Support for Logging

LOGGING CONTEXTUAL INFO IN AN ASYNCHRONOUS APPLICATION

Switching Contextual Info in Multithreaded Calls. and Clean up. SLF4J support with MDC (Mapped Diagnostic Context) but it is not good for Multithreaded environment.

rspilker commented 8 years ago

Sorry, but I have no idea what you are proposing here. Can you give us some links to documentation and provide an example of a piece of code that displays the desired behavior?

psramkumar commented 8 years ago

as we know now a days Trend is moving towards Micro service Architecture.

Troubleshooting with log file is too complex, especially in multi threaded environment. in Different Services, it is better to have logger to identify a transaction from end to end, with some custom Context Information.

i found slf4j MDC serves better but it will not support Multi treaded environment.

below is the sample scenario where logger is required in more intelligent fashion. http://www.blackpepper.co.uk/correlating-log-entries-using-log4j-and-the-mapped-diagnostic-context/

hope you understand the Use Case.

t1 commented 5 years ago

So this is an issue for Log4j, isn't it? And there is no easy solution. The framework used to create the threads need to support context propagation. HTH