cancel
Showing results for 
Search instead for 
Did you mean: 

turn off sql logs

cutout33
Champ in-the-making
Champ in-the-making
Hello,

I upgraded my application to hibernate 4 and since then my logs are overwhilmed with a query on ACT_RU_JOB, if I set

hibernate.show_sql=false

it stops but then it stops my application sql too!

is there a way to turn this off for activiti alone?

thanks in advance
6 REPLIES 6

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Activiti uses mybatis, not hibernate…

cutout33
Champ in-the-making
Champ in-the-making
am not sure but this is not a query I have made and it is just keep running, it does not stop! it runs every other second.

Hibernate:
    select
        RES.*      
    from
        ACT_RU_JOB RES      
    LEFT OUTER JOIN
        ACT_RU_EXECUTION PI
            ON PI.ID_ = RES.PROCESS_INSTANCE_ID_    
    where
        (
            RETRIES_ > 0
        )      
        and (
            DUEDATE_ is null
            or DUEDATE_ <= ?
        )      
        and (
            LOCK_OWNER_ is null
            or LOCK_EXP_TIME_ <= ?
        )      
        and (
            (
                RES.EXECUTION_ID_ is null
            )        
            or          (
                PI.SUSPENSION_STATE_ = 1
            )           
        )       LIMIT ? OFFSET ?

I thought it is an activiti query because it is on activiti table 😕

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Oh, yes. That is an activiti query… It queries for jobs to be executed…

cutout33
Champ in-the-making
Champ in-the-making
OK then, how can I stop it in the logs, it is killing me!

jbarrez
Star Contributor
Star Contributor
Like Ronald says, we don't use Hibernate.

If you are using Activiti: simply edit your logging.properties file and set the level higher. or tweak the log level of the mybatis logger.

lsjunior
Champ in-the-making
Champ in-the-making
The problem is that you application uses Hibernate and  showSql property is active.
Disabling Hibernate logging solves your problem.

In Hibernate properties/persistence.xml:
<code>
hibernate.show_sql = false or <property name="hibernate.show_sql" value="false" />
</code>

In Spring:
<code>
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  <property name="showSql" value="false" />
  …
</bean>
</code>