Logging user activity in web app

It’s actually pretty simple to achieve using MDC/NDC functionality built into Log4J (SLF4J and Logback only support MDC). Implementing MDC filter First, implement a servlet filter that will add username to MDC/NDC. Logback provides convenient MDCInsertingServletFilter, Spring framework also adds Log4jNestedDiagnosticContextFilter to the store. Look at them but you will need a custom one like … Read more