Why ebean.properties doesn't work in play 2.4?

985 views Asked by At

I used ebean in my project, and I want to show sql with ebean, however,

ebean.ddl.generate=true

ebean.ddl.run=true

ebean.debug.sql=true

ebean.debug.lazyload=false

ebean.loggingToJavaLogger=true

ebean.logging=all

ebean.logging.logfilesharing=all

ebean.logging.directory=/logs

ebean.logging.iud=sql

ebean.logging.query=sql

ebean.logging.sqlquery=sql

ebean.logging.txnCommit=none

the config doesn't work at all.

And I also configured db.***.logSql = true in application.conf and <logger name="logger.org.jdbcdslog.StatementLogger" level="INFO"/> in logback.xml (jdbcdslog.jar has been downloaded)

2

There are 2 answers

0
Leo On BEST ANSWER

Due to play2.4 has deprecated the log config in application.conf, we need to config in the logback.xml with <logger name="org.avaje.ebean.SQL" level="TRACE"/>, thats enough.

0
Rob Bygrave On

None of those ebean.logging properties are valid.

Refer to http://ebean-orm.github.io/docs/logging ... for information on all the logging configuration but you probably should including transaction logging and summary logging as well.

  <!-- SQL and bind values -->
  <logger name="org.avaje.ebean.SQL" level="TRACE"/>

  <!-- Transaction Commit and Rollback events -->
  <logger name="org.avaje.ebean.TXN" level="TRACE"/>

  <!-- Summary level details -->
  <logger name="org.avaje.ebean.SUM" level="TRACE"/>