You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2005/03/02 02:30:53 UTC

Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves ValveBase.java

luehe@apache.org wrote:
> luehe       2005/02/23 11:27:56
> 
>   Modified:    catalina/src/share/org/apache/catalina/authenticator
>                         FormAuthenticator.java NonLoginAuthenticator.java
>                         SSLAuthenticator.java SingleSignOn.java
>                catalina/src/share/org/apache/catalina/realm
>                         DataSourceRealm.java JDBCRealm.java JNDIRealm.java
>                         RealmBase.java UserDatabaseRealm.java
>                catalina/src/share/org/apache/catalina/valves ValveBase.java
>   Log:
>   No change in functionality.
>   
>   Added new "containerLog" instance var to RealmBase and ValveBase, which is
>   initialized as "container.getLogger()" inside setContainer().
>   
>   This will make it easier to do something like
>   
>     containerLog = LogFactory.getLog(container.logName()+".RealmBase");
>   
>   in the future, as suggested by Bill Barker.

Actually, this is probably a bad idea (or at least the implementation is 
bad): the logger must be retrieved only when the context class loader of 
the application is set. This means no retrieving the logger in 
ValveBase.setContainer, since this is first called in StandardContext().

Rémy (who's having a lot of fun with logging at the moment)

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves ValveBase.java

Posted by Jan Luehe <Ja...@Sun.COM>.

Remy Maucherat wrote:
> Jan Luehe wrote:
> 
>>Remy Maucherat wrote:
>>
>>
>>>Actually, this is probably a bad idea (or at least the implementation is 
>>>bad): the logger must be retrieved only when the context class loader of 
>>>the application is set.
>>
>>This is where I'm not following: ;-)
>>I don't see any dependency on the context's context class loader when
>>calling ContainerBase.getLogger(), which is implemented like this:
>>
>>  logger = LogFactory.getLog(logName());
>>
>>A context's context class loader is required only for loading webapp
>>resources.
> 
> 
> The configuration for that logger should be doable at the webapp level 
> (to summarize, I'd like to be able to have my logger configured using 
> either /WEB-INF/classes/logging.properties or 
> common/classes/logging.properties if the first one does not exist). The 
> logging implementation gets which config it should lookup for the logger 
> based on what the context CL is when calling getLogger. So the context 
> CL needs to be set properly (or getLogger has to be called again).

Got it. Thanks!

Jan




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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves ValveBase.java

Posted by Remy Maucherat <re...@apache.org>.
Jan Luehe wrote:
> 
> Remy Maucherat wrote:
> 
>>Actually, this is probably a bad idea (or at least the implementation is 
>>bad): the logger must be retrieved only when the context class loader of 
>>the application is set.
> 
> This is where I'm not following: ;-)
> I don't see any dependency on the context's context class loader when
> calling ContainerBase.getLogger(), which is implemented like this:
> 
>   logger = LogFactory.getLog(logName());
> 
> A context's context class loader is required only for loading webapp
> resources.

The configuration for that logger should be doable at the webapp level 
(to summarize, I'd like to be able to have my logger configured using 
either /WEB-INF/classes/logging.properties or 
common/classes/logging.properties if the first one does not exist). The 
logging implementation gets which config it should lookup for the logger 
based on what the context CL is when calling getLogger. So the context 
CL needs to be set properly (or getLogger has to be called again).

Rémy

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves ValveBase.java

Posted by Jan Luehe <Ja...@Sun.COM>.

Remy Maucherat wrote:
> luehe@apache.org wrote:
> 
>>luehe       2005/02/23 11:27:56
>>
>>  Modified:    catalina/src/share/org/apache/catalina/authenticator
>>                        FormAuthenticator.java NonLoginAuthenticator.java
>>                        SSLAuthenticator.java SingleSignOn.java
>>               catalina/src/share/org/apache/catalina/realm
>>                        DataSourceRealm.java JDBCRealm.java JNDIRealm.java
>>                        RealmBase.java UserDatabaseRealm.java
>>               catalina/src/share/org/apache/catalina/valves ValveBase.java
>>  Log:
>>  No change in functionality.
>>  
>>  Added new "containerLog" instance var to RealmBase and ValveBase, which is
>>  initialized as "container.getLogger()" inside setContainer().
>>  
>>  This will make it easier to do something like
>>  
>>    containerLog = LogFactory.getLog(container.logName()+".RealmBase");
>>  
>>  in the future, as suggested by Bill Barker.
> 
> 
> Actually, this is probably a bad idea (or at least the implementation is 
> bad): the logger must be retrieved only when the context class loader of 
> the application is set.

This is where I'm not following: ;-)
I don't see any dependency on the context's context class loader when
calling ContainerBase.getLogger(), which is implemented like this:

  logger = LogFactory.getLog(logName());

A context's context class loader is required only for loading webapp
resources.

Jan


> This means no retrieving the logger in 
> ValveBase.setContainer, since this is first called in StandardContext().



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