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 individual queries, especially when they have variable parameters like most do.
Accessing the H2 Console H2 database has an embedded GUI console for browsing the contents of a database and running SQL queries. By default, the H2 console is not enabled in Spring. Then, after starting the application, we can navigate to http://localhost:8080/h2-console, which will present us with a login page.
SQLite is much more robust to corruption. Speed wise H2 was much faster in my case. With SQLite transactions are particularly costly, so you should prefer doing bulk operations within transactions or via batches.
MySQL is a server - based database - it runs as a separate process from your application, and is commonly used in production deployments. H2 is a lightweight database, which can run entirely in-memory, or with disk storage, either in your application's process (embedded) or in a separate process.
SQL SupportCompatibility modes for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL.
The TRACE_LEVEL_FILE
is the best option. There are 4 levels:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With