[slf4j-user] Slightly OT: configuring Hibernate logging level and SLF4J using JDK 1.4 logger

Karsten Wutzke kwutzke at web.de
Thu Dec 9 17:42:40 CET 2010


Thanks for clarifying this.

I didn't start to use LOG4J because the configuration really killed me for something as "simple" as logging. Using a logging implementation requiring a command-line param appears even worse now. I might have made the wrong decision in using JUL. Maybe I should have a look at logback and see if it's easier to configure than LOG4J...

Is logback easier to configure than LOG4J?

>This is java.util.logging issue. 
>
>You can change log levels easy using a config file.
>
>handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
>.level=INFO # you can choose the default level
>org.hibernate.level=SEVERE
>
>java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
>java.util.logging.FileHandler.level=FINEST
>
>java.util.logging.FileHandler.pattern=/the/path/for/my.log
>
>
>You need to start your app with these parameter
>
>-Djava.util.logging.config.file=/path/for/the/config-file/logging.properties 
>
>
>> >It's not really a Hibernate or an SLF4J question. 
>> 
>> I disagree, because Hibernate causes all the INFO log entries and it DEPENDS on SLF4J. My choice
>> for the JDK logger was purely for simplicity. However, there must be a way to tell Hibernate to
>> only log starting from warning level. That's what I want to know. Configuring the JDK logger here
>> doesn't make much sense because Hibernate will use whatever I have chosen. If I switch to another
>> SLF4J logger implementation then the same problem would reappear, so your answer isn't really
>> helpful.
>> 
>> Thanks anyway
>> Karsten
>> 
>> >
>> >----- Original Message -----
>> >> From: "Karsten Wutzke" <kwutzke at web.de>
>> >> To: slf4j-user at qos.ch
>> >> Sent: Thursday, 9 December, 2010 12:26:27 PM
>> >> Subject: [slf4j-user] Slightly OT: configuring Hibernate logging level and SLF4J using JDK 1.4
>> logger >> Hello,
>> >> 
>> >> I've recently asked this on StackOverflow.com and I haven't yet found
>> >> an answer to my question:
>> >> 
>> >>
>>
>http://stackoverflow.com/questions/4394179/hibernate-how-do-you-adjust-the-default-logging-level-sjf4j-and-jdk-1-4-logger
>> >> 
>> >> As this is also a Hibernate question, I thought it might be a good
>> >> idea to ask here, because many people using SLF4J also use Hibernate.
>> >> 
>> >> So, can anyone help on this issue?
>> >> 
>> >> Thanks,
>> >> Karsten
>> >> 
>> >> PS: I've found many articles on LOG4J but I don't need/use it...
>> ___________________________________________________________
>> Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
>> Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02
>> _______________________________________________
>> slf4j-user mailing list
>> slf4j-user at qos.ch
>> http://qos.ch/mailman/listinfo/slf4j-user
>
> 
>_______________________________________________
>slf4j-user mailing list
>slf4j-user at qos.ch
>http://qos.ch/mailman/listinfo/slf4j-user
___________________________________________________________
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://movieflat.web.de


More information about the slf4j-user mailing list