Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Payara 4.x and 5.x Hibernate log configuration
PostPosted: Wed Sep 20, 2017 4:46 am 
Newbie

Joined: Fri Mar 28, 2008 5:48 am
Posts: 5
Hi all,
I'm having a (very hard) time trying to configure log level on a webapp (war) with latest hibernate-release-5.2.10.Final.
(
Logging is completely fine in development jar project : no wildfly, no payara nor glassfish, just plain Java and unit test.
like in Vlad's High-Performance Java Persistence book projects.
In that case , no trouble at all with directives like <logger name="org.hibernate" level="info"/> in logback.xml or logback-test.xml.
Even logj4 is OK

)
Trouble raise only when deploying a war to an appserver
It used to be so simple back in hibernate 3.x days. Why this no-brainer evolves in complexity ?
Well, what I want to do is this.

I have a server (both payara 4 and wildfly-10.1.0.Final )
I also tried glassfish5 and payara5 previews.

These are hacking servers. I use them to try and test different proof of concept. Nowadays, as everyone else, I turn towards docker but this is not relevant)
My needs is to embed the hibernate libs and dependencies (so that I don't mess up others app on my server) and being able to tell the server : please just for this currently deployed hack show me hibernate full logs.
(Even if I know about Vlad's blog post =[url]The best way to log JDBC statements https://vladmihalcea.com/2016/05/03/the ... tatements/[/url]. The use case is not the same )

How can I achieve this on payara ? And on wildfly ?
On those two major application server I've been banging my head for hours.
Must have miss something but guys, really, even if I'm an idiot on this
please remember how it was all so simple and smooth, no matter you were under jboss or glassfish server ?
Do we really gain anything with the changes made in this area ?
So now it is still really easy to use logback or log4j on hibernate in a junit or testng project,
but the internet (and SO) is full of questions (and no clear, updated answer) about how to tune it when packaged in a war.

I need it, but more than that I really think it's needed by lot of people and may be, should find a place in the documentation or in the sample projects delivered with the distribution because one should not waste time on something that dumb.
Thanks for your help.


Top
 Profile  
 
 Post subject: Re: Payara 4.x and 5.x Hibernate log configuration
PostPosted: Wed Sep 20, 2017 10:36 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1588
Location: Romania
Quote:
It used to be so simple back in hibernate 3.x days. Why this no-brainer evolves in complexity?


From a Hibernate perspectcive, it's very simple. That's exactly why it works so easy on your dev env.

What it is complicated is the application server environment using multiple class loaders and having a different log config being used instead of the one you need.

Quote:
How can I achieve this on payara ? And on wildfly ?


You need to check the Payara and the Wildfly docs or ask them about your use case on their forums. They surely know it better. What if you have a problem with a different library you might use, like Apache Camel? It's not the framework, but the application server who provides the bootstrapping logic.

Quote:
Do we really gain anything with the changes made in this area ?


Related to logs, there haven't been many changes since Hibernate 4. Related to features, yes, [Hibernate 5 is packed with lots of new stuff that can help you hanlde your Persistence layer requieremnts](https://stackoverflow.com/questions/319 ... 8#35427268).

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.