Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SQLite for logging

I want to use SQLite as database backend for WCF service logging. Everything looks good, but how can I extract database log file from real system and don't get database locked for inspecting/analyzing of logs? This system seems to be very load extensive and everytime I try to take database log file it takes away locked.

like image 730
kseen Avatar asked Sep 01 '25 04:09

kseen


1 Answers

You can now use SQLite's Write-Ahead Logging mode to enable a SQLite database to be read and written to concurrently.

There are advantages and disadvantages to using WAL instead of a rollback journal. Advantages include:

  1. WAL is significantly faster in most scenarios.
  2. WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.
  3. Disk I/O operations tends to be more sequential using WAL.
  4. WAL uses many fewer fsync() operations and is thus less vulnerable to problems on systems where the fsync() system call is broken.
like image 90
Nick Whaley Avatar answered Sep 02 '25 17:09

Nick Whaley