I have a requirement to send log values to an internal webservice for reporting on bandwidth and other analytics. I've researched this on the forum and have found several threads about this, and it seems like there are 3 main ways to do this:
1. Put the webservice call in the onLog method of a custom ILogNotify class
2. Put the webservice call in the disconnect or SessionDestroy event in a custom module
3. Log4j Appender (I've ruled this out for my scenario)
So, first off, I noticed several warnings from you guys about calling a webservice for logging because of performance issues, but I'm hoping to solve those problems by doing the following:
1. Only logging certain types of events to the webservice
2. Calling the webservice asynchronously using an ExecutorService and a CachedThreadPool
Ok, now to my questions:
From my research of old forum posts, it seemed like a custom ILogNotify class was the way to go, but I ran into the following issue. Along with all the other properties that get logged, I need to send a few extra things to the webservice, like the username of the user watching the video. I have a custom module that pulls a encrypted token off of the request URL and then extracts some information (like the username) from it, so I need to know how to make the username available to my ILogNotify code from my module. How can I do that?
Should I really be using an ILogNotify class for this? It seems like it would fit better in the onDisconnect or onHTTPSessionDestroy event within my existing module. I looked at doing it this way, but it's not clear to me how to get all the same values that are being logged from within the module. Can I get all the same values from within a module as the WMSLoggerFactory.getGlobalLogValue() exposes in the ILogNotify onLog() method?
I would prefer to write this functionality into my module if possible. Please let me know what you think.