[hibernate-dev] logging

Hardy Ferentschik hardy at hibernate.org
Fri Apr 15 14:16:02 EDT 2011


Forgot to answer this question.
I like the idea of different channels, but not sure how complex it will  
get.
How many channels did you have in mind?

Also, the more complex the higher the chances that you use the logging  
framework in
unintended ways.

--Hardy


On Tue, 12 Apr 2011 15:25:53 +0200, Steve Ebersole <steve at hibernate.org>  
wrote:

> @MessageLogger( projectCode = "HHH" )
> public interface CoreAdminMessageLogger extends BasicLogger {
>      @LogMessage(level=INFO)
>      @Message(value="Hello %s", id=1)
>      void sayHello(String name);
>      ...
> }
>
> @MessageLogger( projectCode = "HHH" )
> public interface CoreDevMessageLogger extends BasicLogger {
>      @LogMessage(level=INFO)
>      @Message(value="Loading the HelloComponent implementation %s",  
> id=501)
>      void loadingHelloComponent(String implementationName);
>      ...
> }
>
> CoreAdminMessageLogger adminLog = Logger.getMessageLogger(
>          CoreAdminMessageLogger.class,
>          "org.hibernate.core.hello"
> );
>
> CoreDevMessageLogger devLog = Logger.getMessageLogger(
>          CoreDevMessageLogger.class,
>          this.getClass()
> );
>
> I realize this all seems over-engineered in many ways.  I do see *some*
> benefit.  I guess the decision I need help weighing is whether this
> amount of benefit out-weighs the "complexity".




More information about the hibernate-dev mailing list