title: HQL logging categories/selective hibernate HQL logging?
body: <p><em>All HQL</em> or <em>no HQL</em> logged is too blunt an instrument for me. Does anybody know of settings/parameters in hibernate which would allow me to prioritise/categorise HQL logging for different queries?</p>
  
  <p>For instance, I would ideally want to be able to set a category or "query type" marker on each query and regulate the ../WARN/INFO/DEBUG/.. logging level for each of my query types.</p>
  
  <p>I can see there are things like</p>
  
  <ul>
  <li><p>org.hibernate.event.spi.EventType, with contained events I could perhaps register listeners for and trigger logging on the listener according to my own settings somewhere.</p></li>
  <li><p>org.hibernate.Interceptor, which defines methods called for specific events in a session, which I could override for something similar.</p></li>
  </ul>
  
  <p>But I couldn't immediately find any such entry points corresponding to running queries. An easy way I could imagine/wish for would be to set an annotation field on @NamedQuery but I don't see anything obvious there either..</p>