Search code examples
javaweb-applicationslogging3-tier

3-tier architecture, web application and user logging


In a web application that respects a 3-tier architecture, who is responsible for the implementation of a user logging module: the presentation tier or the application one?

I'm asking that question because a user logging module isn't really part of the logic tier of an application, but neither of the presentation one.


Solution

  • Logging is cross-cutting concern, so doesn't belong in any one tier. I advise you to avoid creating a logging module if at all possible. It is unlikely to add any value and will just duplicate existing logging frameworks. Just use something like SLF4J consistently.