Search code examples
logginghsqldbrdbms

HSQLDB - Internal logging to database tables


Is it possible to have internal event and statement logging inside database tables?

This would be useful, instead of having .app.log and .sql.log files, so that the logs could be transparently encrypted and queried as tables.


Solution

  • You can do this with AFTER INSERT, AFTER UPDATE and AFTER DELETE triggers defined on the tables you want to log. See http://hsqldb.org/doc/guide/triggers-chapt.html#trc_after_triggers