I have java webapp (written in spring mvc) and running on tomcat. I want to log user's behavior into a separate log file (separate from what we're logging right now to catalina.out).
We're currently using Apache commons logging to obtain Log instances in our classes:
protected final Log logger = LogFactory.getLog(getClass());
I prefer to keep use LogFactory to access my customized logger (hence not creating a dependency on a specific logging package). Yet, I need to create my own handler (so that I route usage events to a separate file. e.g. usage.out), also need a custom formatter to format the logs. I wonder what is the best way to achieve this? What is the common practice?