This content has been marked as final. Show 1 reply
I haven't used RMI for some time but I solved a very similar problem with RMI some time ago by utilising ThreadLocal. Each RMI method set up a ThreadLocal variable containing the name of the user, the method name and the parameter values. This TheadLocal content was then used in all logging. When a thread handed over control to a task which was placed in a queue for later execution the context in the ThreadLocal value was copied into the task and used in the logging.
At the time I would have preferred would have been to pass this 'context' explicitly along the line but the powers that be did not want to make such an intrusive change. Were they right ? Who knows!
Of course this approach would mean a significant change to your system.