Hi,
There is no direct support out of the box, but you can do so by obtaining JdbcServices from the service registry (see [1] for details) and turn logging to System.out on/off via setLogToStdout() on the associated SqlStatementLogger. You could then expose this functionality as JMX service, REST API or whatever suits best with your means of application management.
Hth,
--Gunnar
[1] https://github.com/hibernate/hibernate-orm/blob/master/documentation/src/main/asciidoc/topical/registries/ServiceRegistries.adoc
_________________ Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/
|