> In parts of our application, we are using log4j Logger objects in a
> non-static context.  We have a user class, which gets a Logger based upon
> the user id this User object represents as well as the HttpSession to which
> this user belongs:
> Logger logger = Logger.getLogger( "session." + user + "." + session );
> 
> However, my understanding is that log4j will keep a reference to this
> specific logger in case it can get used again.  But, because this logger is
> so unique and there is a high probability that a logger with this exact name
> will never again be used, is there a way to tell log4j to close this logger?

This is not a direct answer to your question, but you might consider
putting the session information into a Nested Diagnostic Context
rather than using a separate logger for each user session.  

I haven't tackled that yet with my app, but it seems like the sensible
way to go.  NDCs are designed to be ephemeral.

--mkb



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to