RestComm / jain-sip

Disclaimer: This repository is a git-svn mirror of the project found at http://java.net/projects/jsip whose original repository is developed collaboratively by the Advanced Networking Technologies Division at the National Institute of Standards and Technology (NIST) - an agency of the United States Department of Commerce and by a community of individual and enterprise contributors. TeleStax, Inc. will perform some productization work, new features experimentation branches, etc for its TelScale jSIP product that doesn't concern the community from the main repository hence this git repository.
http://www.restcomm.com/
142 stars 151 forks source link

Implment NDC/MDC vars for easy logging #55

Closed jaimecasero closed 8 years ago

jaimecasero commented 8 years ago

Things like call-id, tx-id, or session id would be useful to have in all log traces, so a call maybe track properly along all the assigned threads...

https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/NDC.html

https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html

jaimecasero commented 8 years ago

my idea is to implement it as thread interceptor in executor service

[11:30] as a background activity forthe SipAppSEssion concurrency enhancement

[11:30] there are some nice hooks , so we can take advantage of threadlocals

[11:30] which is required for proper context vars

[11:31] the hooks at that level ensure proper set/unset logic

[11:31] any other way to tackle taht is deemed to fail

[11:31] have seen it many times

[11:31] development conventions doesnt work here https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html#afterExecute(java.lang.Runnable,%20java.lang.Throwable)