Sarma (1) [Avatar] Offline
I have a problem in my application that all the log files have to be separated into different folders based on the user information. I will get the user info to each and every method which calls the logger. But right now the user info is not sent to the logger and also it is not possible to add one more parameter(context) to the logger since I have to change in many number of files which is highly difficult. Using AspectJ I am able to write a pointcut and an advice when a logger is called. I am also able to get the userinfo into the advice but not able to set the context to the logger. The logger has all static methods. Every method in the logger calls FilePropertyManager.getProperty which returns the file name along with the context. Again the getProperty method in FilePropertyManager is static. Now is there any way to send the context from the advice to either the LogManager or to the FilePropertyManager and set the context properly. I cannot change the method signatures either in LogManager or in FilePropertyManager. If there is a solution for this in AspectJ, I want to whether it is works well when different users access the application at the same time.