So we have an old application which have been running on production on 
Tomcat7 for over 5 years and we tried to use the following configuration to 
avoid excessive debug log but it seems not working:

akka {
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
  loglevel = "DEBUG"
  stdout-loglevel = "INFO"
  jvm-exit-on-fatal-error = off
  log-config-on-start = on
}

play {
  akka {
    loggers = ["akka.event.slf4j.Slf4jLogger"]
    loglevel = "DEBUG"
    logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
    stdout-loglevel = "OFF"
  }
}

On development, this works correctly but on production, this continue to 
log debug hibernate messages to catalina.out which would generate very 
large amount of log due to the feature we recently implemented that process 
very large number of data at the same time. We also checked and logback 
seems to be working correctly on Tomcat7 in production as the 
application.log gets the correct log based on configuration below but Akka 
somehow continue to send logs to catalina.out or stdout.

The application-logger.xml also contains the necessary codes to supposedly 
stop hibernate debug logs from appearing but it seems not working:

<configuration>

    <conversionRule conversionWord="coloredLevel" 
converterClass="play.api.Logger$ColoredLevel" />

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
        <file>${application.home}/logs/application.log</file>
        <encoder>
            <pattern>%d - %coloredLevel - [%thread] - %logger - 
%message%n%xException</pattern>
        </encoder>
    </appender>

    <logger name="play" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="application" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="akka" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="akka.event.slf4j.Slf4jLogger" level="INFO" 
additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.springframework" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.mchange" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.apache" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.hibernate" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.hibernate.engine" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.hibernate.event" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <logger name="org.hibernate.hql" level="INFO" additivity="false">
        <appender-ref ref="FILE" />
    </logger>

    <root level="OFF">
        <appender-ref ref="FILE" />
    </root>

</configuration>

catalina.out logs

1154433 [application-akka.actor.default-dispatcher-39] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - committed 
JDBC Connection
1154433 [application-akka.actor.default-dispatcher-39] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - 
re-enabling autocommit
1154433 [application-akka.actor.default-dispatcher-39] DEBUG 
org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl  - HHH000420: 
Closing un-released batch
1154433 [application-akka.actor.default-dispatcher-39] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Releasing JDBC 
connection
1154433 [application-akka.actor.default-dispatcher-39] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Released JDBC 
connection
1154433 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.spi.AbstractTransactionImpl  - begin
1154434 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Obtaining JDBC 
connection
1154434 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Obtained JDBC 
connection
1154434 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - initial 
autocommit status: true
1154434 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - disabling 
autocommit
1154438 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.spi.AbstractTransactionImpl  - committing
1154438 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - committed 
JDBC Connection
1154438 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction  - 
re-enabling autocommit
1154438 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Releasing JDBC 
connection
1154438 [application-akka.actor.default-dispatcher-40] DEBUG 
org.hibernate.engine.jdbc.internal.LogicalConnectionImpl  - Released JDBC 
connection

The following environment variable are also set which they seem to be 
working:

-Dlogback.configurationFile=application-logger.xml
-Dlogger.resource=application-logger.xml
-Dlogback.debug=true



We also checked and one option was to upgrade to Akka 2.4 but is there a 
way to get rid of this debug log without having to upgrade first? The 
application is quite old and we aren't ready to move to Java 8 yet.

Thanks


-- 
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>> 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/akka-user/01416a99-be9e-4ed3-bff9-d4d11baf2299%40googlegroups.com.

Reply via email to