Problem: Logging parameter values for prepared statements using dynamic setting of log levels.
I'm aware of monitoring hibernate generated SQL including parameter and return values by setting the log level of org.hibernate.SQL to DEBUG and org.hibernate.type to TRACE.
My problem is that i like to activate monitoring dynamically when needed. Actually I'm using a JMX Bean to set the level of loggers. While setting the log level of org.hibernate.SQL to DEBUG results in logging of prepared statements as expected, the setting of logger for org.hibernate.type to TRACE does not trigger the logging of parameter values.
I guess that during bootstrapping the mechanism for logging parameters is activated if and only if the log level org.hibernate.type is set to trace. Starting with a less verbose level and changing to TRACE-Level afterwards will not active the logging of parameters.
My question is: Is there a workaround or a programmatic pattern to activate parameter logging during runtime?
Probably, this question was asked before, but I couldn't find a correspondic topic.
|