Traditionally, you will use built-in caching in Hibernate mode and do some profiling during development to tweak everything until you get the expected behavior. To enable cache logging, change the log level, for example when using log4j.xml :
<logger name="org.hibernate.cache"> <level value="DEBUG" /> </logger>
Please note that I do not recommend using this on a working platform (this can be very verbose and therefore can slow down execution).
See the logging documentation for more details.
source share