I build my "superWebApp" with the next technology stack:
persistence provider - Hibernate 4.x
webMvc and beans container - Spring 4.x
web containter - Tomcat 7.5.x
I have a task to write all logs to db. And it would be a pain to do it for each logging framework separately. That's why I need to redirect all logs to single framework and then using a DBAppender wouldn't be a problem.
I was thinking about log4j2, since I use it to write logs in "superWebApp". So is there any idea how to redirect all logs from hibernate and spring to log4j2? (it would be good to redirect tomcat loogs too)?
If it is not possible, maybe there is another logging framework that can be central?
From Logging Spring using Log4j2, we must use log4j-slf4j-impl.
I have tested it with Spring 4 also struts 2 and it works fine.
This worked perfectly for me: