Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
241 views
in Technique[技术] by (71.8m points)

spring - log parameters values of the procedure called by Hibernate in the web application logs hosted in tomcat server

I encountered an error when calling a stored procedure in an oracle database by Hibernate. I use a web application based on spring 4 and Hibernate 5. I would like to log the parameters values of the called procedure in a local tomcat server where I deployed the application.

I use Slf4j/Logback for logging.

I configured Hibernate to log all the executed sql queries with values of its outbound parameters using this code :

<logger name="org.hibernate.SQL" level="DEBUG"/>
<logger name="org.hibernate.type.descriptor.sql" level="TRACE"/>

And this is ok.

Now I would like to log the parameters values of the procedure called by Hibernate.

I tried this configuration:

<logger name="org.hibernate.procedure." level="DEBUG"/>
<logger name="org.hibernate.procedure.internal" level="TRACE"/>
<logger name="oracle.jdbc.driver" level="DEBUG"/>

But it didn't work.

I figure out that we can't log the procedure paramters called in this post: can't log parameters values of procedure in sql server

but he doesn't mention that he was using Hibernate.

So I would like to know if there is a way to log the procedures parametes values with Hiberante?

And if it is not the case, I am just curious, why we can log the parameters values of the sql queries executed by Hibernate and not that of procedures?

Thanks in advance.

question from:https://stackoverflow.com/questions/65671991/log-parameters-values-of-the-procedure-called-by-hibernate-in-the-web-applicatio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...