openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: logging and diagnostic contexts
Date Sun, 06 Aug 2006 19:56:28 GMT
Hi Patrick,

On Aug 4, 2006, at 11:37 PM, Patrick Linskey wrote:

> Hi,
>
> OpenJPA's default logging implementation has a concept of a diagnostic
> context, roughly stolen from log4j. The basic idea is that in a
> configuration file, the user can specify a diagnostic context string
> that will be printed out with each log message. The result is that  
> if a
> user has multiple EntityManagerFactories running in the same JVM, she
> can distinguish between the different logging outputs, even if they  
> all
> just go to stderr.
>
> The JPA spec requires that persistence units are named uniquely. This
> presents us with an opportunity: we could check for the existence of
> multiple EMFs and, if found, automatically set the logging diagnostic
> context based on the name of the persistence unit.

I like this idea. One possible refinement.

How about looking for the diagnostic context string, and if missing,  
then use the PU name as the diagnostic context string? Then, if users  
really wanted to override it, they could.

Craig
>
> Thoughts?
>
> -Patrick
>
> -- 
> Patrick Linskey
> BEA Systems, Inc.
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message