Just wanted to update to the new db logging by adding the following to
boot:
DB.addLogFunc {
case (query:DBLog, time) => {
LogBoot.loggerByName("query").info(">>> All queries took " + time + "ms: ")
query.statementEntries.foreach({ case DBLogEntry(stmt, duration) => LogBoot.loggerByName("query").info(" "+stmt + " took " + duration + "ms")})
LogBoot.loggerByName("query").info("<<< End queries")
}
}
But it seems all executed statements are logged twice. I have this
snippet:
def currentUser(xhtml: Group): NodeSeq = Text(User.currentUser.dmap(S.?("Anonym"))(user => user.firstName + " " + user.lastName))
This logs:
14:46:09.068 [tp-1029120287-4] INFO query - >>> All queries took 5ms:
14:46:09.068 [tp-1029120287-4] INFO query - Exec query "SELECT users.id, users.firstname, users.lastname, users.email, users.locale, users.timezone, users.password_pw, users.password_slt, users.account_id, users.superuser, users.uniqueid, users.validated FROM users WHERE id = 2 (scale -5)" : org.postgresql.jdbc4.Jdbc4ResultSet@77f31432 took 4ms
14:46:09.069 [tp-1029120287-4] INFO query - <<< End queries
14:46:09.069 [tp-1029120287-4] INFO query - >>> All queries took 8ms:
14:46:09.069 [tp-1029120287-4] INFO query - Exec query "SELECT users.id, users.firstname, users.lastname, users.email, users.locale, users.timezone, users.password_pw, users.password_slt, users.account_id, users.superuser, users.uniqueid, users.validated FROM users WHERE id = 2 (scale -5)" : org.postgresql.jdbc4.Jdbc4ResultSet@77f31432 took 4ms
14:46:09.069 [tp-1029120287-4] INFO query
- <<< End queries
Note the same resultset. The postgres logs also shows that only a single
statement is executed....
So, what did I miss?
/Jeppe