Hibernate Logging

Logs are your best friend when it comes to Hibernate and its plethora of obscure error codes and situations. Hibernate is incredible until it's not. However, we definitely encourage you to tweak your server whenever you need deeper understanding of what's going on under the hood.

ORM Util Logging

We have provided a handy method in our ORM Utility object to help you set the logging level of hibernate globally and redirect the output of those logs to CommandBox (Lucee only for now). This must be done once the application loads in order to seed the levels and configuration and done only once. Therefore we recommend you update your Application.cfc with the following in the onApplicationStart() method

The setupHibernateLogging( level ) method accepts a logging level so you can control the output of the logs.

Level
Description

ALL

All levels including custom levels.

DEBUG

Designates fine-grained informational events that are most useful to debug an application.

INFO

Designates informational messages that highlight the progress of the application at coarse-grained level.

WARN

Designates potentially harmful situations.

ERROR

Designates error events that might still allow the application to continue running.

FATAL

Designates very severe error events that will presumably lead the application to abort.

OFF

The highest possible rank and is intended to turn off logging.

TRACE

Designates finer-grained informational events than the DEBUG.

This basic setup will get you to almost 90% of all your logging needs.

Lucee Location Logs

The log files for hibernate are located in the following locations for Lucee:

Please note that if you use the setupHibernateLogging() then all the log output shoudl appear in the CommandBox out logs.

Adobe Logging

In Adobe engines you can also tweak the log4j configuration to get even more out of your logs. Let's start with the most important question, where are they?

Ok, now the file we need to update to fine tune our logging is:

The file is self explanatory and we have reviewed the log4j levels before, so just get in there and make stuff happen. Here is our full debugging resource we use for ContentBox CMS Development:

Last updated

Was this helpful?