Are there any good references/patters for End-to-End logging approaches which can help piece together a complete transaction in a scenario where the flow of control passes through multiple architectural layers like a portal deployed on one machine to a ESB deployed on a second machine?
The aim is to log in a fashion where when an error is reported, one would be able to compile a running trace of the transactional thread from across multiple log files based on a single key. I believe the only solution is to pass the key value across all layers so that it can get into the log entry pattern in a predictable fashion. I would be interested in knowing how enterprise apps usually deal with this in a clean fashion.
The solution has to be based on LOG4J, rolling file logging plus maybe a small wrapper (hopefully not a framework) built around it.
Can the intelligent use of AOP/Aspects solve this problem somehow?