logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy McBride" <andy.mcbr...@pcmsgroup.com>
Subject Re: o.a.log4j.servlet
Date Wed, 15 Dec 2004 00:34:43 GMT
  
>
>Also, does anyone know if there is a way to 
>programmatically detect the web
>container the web app is running under?  I am seeing a 
>need to have
>different behavior between JBoss and Tomcat, and I was 
>just wondering if
>there is a standard way to detect this.
>
>-Mark
>

Mark, 

The ServletContext has a getServerInfo() method which 
according the javadoc: 

Returns the name and version of the servlet container on 
which the servlet is running. 
The form of the returned string is 
servername/versionnumber. For example, the JavaServer Web 
Development Kit may return the string JavaServer Web Dev 
Kit/1.0. 
The servlet container may return other optional 
information after the primary string in parentheses, for 
example, JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 
4.0 x86)


So the output "should" be easy to parse but I wouldn't 
like to put money on every server vendor complying with 
this contract!

I must admit I'm curious to know what need you forsee to 
have to accomodate different behaviour depending on 
container vendor?  The main point of the J2EE spec is to 
provide a vendor-neutral API for applications to code to. 
 
The cost of maintaining specific behaviour dependant on 
server vendor would be huge with the current abundance of 
server vendors.  

Cheers

Andy
The information contained in this e-mail is intended only for the person or
entity to which it is addressed and may contain confidential and/or
privileged material.  If You are not the intended recipient of this e-mail,
the use of this information or any disclosure, copying or distribution is
Prohibited and may be unlawful.  If you received this in error, please
contact the sender and delete the material from any computer.  The views
expressed in this e-mail may not necessarily be the views of The PCMS Group
plc and should not be taken as authority to carry out any instruction
contained.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message