Are you looking to keep the logs in the same file, or, are you looking to put your log entries in a new file?
If you're interested in just keeping a single file, and if you've got access to change your code that is writing to the database, then, what I would do is "create table if not exists Logs (LogDate, LogMessage)", then do the insert. Then you can purge previous logs with a simple DROP TABLE whenever you want to clean things up. No worries about OS file handling, unless you have a burst of log entries, file sizes are going to pretty much stay the same size, etc, since you'll be just freeing pages up internally in the database. As others have mentioned, if you plan on a log per day, then, you'll need to close the file handle, reopen with a new file and database. On Mon, Oct 3, 2016 at 5:18 AM, Luca Ferrari <fluca1...@infinito.it> wrote: > Hi all, > in one of my application I use a sqlite3 database as a log of > activity. As you can imagine the file grows as time goes by, so I'm > figuring I've to substitute it with an empty one once a good size is > reached. > What is the right way to do it without having to stop the application > (and therefore without knowing when a new I/O operation will be > issued)? > Does sqlite3 provide some facility that could come into help (e.g., > connected databases)? > > Thanks, > Luca > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users