rocketraman commented on issue #71:
URL: 
https://github.com/apache/logging-log4j-kotlin/issues/71#issuecomment-2004452537

   > OK. Personally, I see little value in adding context data to a logger. 
That simply wouldn't fit with any use cases I work with. However, it might if 
Logger names were more generic instead of using class names as is done now by 
convention.
   
   @rgoers For context (pun intended, hah!), I've recently run into this 
situation in a project which manages TCP/IP connections and a related protocol. 
The `Connection` class represents a particular network connection with a UUID 
and remote socket (context!). It uses a standard class-name based logger.
   
   The `Connection` resource class can be called from multiple threads, each of 
which can do some operation on the connection. I want the logger in the 
`Connection` object to contain the UUID and remote socket in the context, which 
is very useful when using logs to answer the question "what is everything that 
has happened to this particular connection?".
   
   The context would *also* contain information about the thread (or in my 
case, coroutine) that called the method on the connection. Which is very useful 
when answering the question "**why** did this happen to this particular 
connection?".
   
   This is the first project in which I've used MDC extensively, and when 
encountering this gap I was honestly surprised it didn't already have a good 
solution. It seems like a common use case to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to