logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Levitt <dave.lev...@gmail.com>
Subject Servlet 2.5 compatibility - Log4jServletContainerInitializer
Date Tue, 21 Jan 2014 16:15:45 GMT
I'm trying to add log4j 2.x to a Servlet 2.5 web app.

One goal is to also be able to deploy the artifact on a Servlet 3.x
container as the servers are migrated [from JBoss 5.x to 7].

When testing on JBoss 7.1, an exception is thrown from
Log4jServletContainerInitializer [line 49] as the servlet context gets the
major version [3.x] from the container instead of the 'effective' major
version [from the artifact's web.xml file].

The comment in the [2,0 RC1] onStartup method says "… For consistency
across all containers, if the effective Servlet major version of the
application is less than 3.0, this initializer does nothing."

So, should the code be invoking servletContainer.getEffectiveMajorVersion()
??

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message