I'm currently trying to track down the source of some lazy loading calls in hibernate, and the easiest way to do so would be to turn on hibernate SQL logging whenever the lazy loading is going to occur and then ideally trigger a stack trace output whenever the logger is used. Right now I'm using Hibernate 3.5.2 which uses SLF4j and using Log4j as my logging implementation.
I suppose I could use AOP to surround every logging call and check if its a call to the SQL logger, but this seems kind of heavy handed and I wanted to know if there was a simpler approach that I was missing before I went down that road.