H2 and query logging?

前端 未结 1 1010
天命终不由人
天命终不由人 2021-02-05 19:12

Is there a way to get a \"query log\" out of H2, like you can with e.g. MySQL? The closest match so far is the TRACE_LEVEL_FILE option, but it it not good for debugging the indi

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 20:11

    The TRACE_LEVEL_FILE is the best option. There are 4 levels:

    • 0 (disabled)
    • 1 (only errors)
    • 2 (errors and info messages, including SQL statements)
    • 3 (debug level; including SQL statements and parameter values)
    • 4 (log using SLF4J)

    So I guess 2 would be the right level in your case.

    There is also a simple way to analyze the trace file, documented in Database Profiling.

    0 讨论(0)
提交回复
热议问题