NET Logging Library
Database - SQLite
Basic Tasks > Database - SQLite

The SqLiteTarget uses and ODBC connection string to connect to your SQlite database.  It automatically creates a logging table on startup with the name of tblLog if it does not exist.  It automatically discards oldest entries after reaching a default of 10,000 log messages.  This behavior can be overridden.

 

It has these properties that can be configured:

tblLog Columns (Automatically Created)
LogID INTEGER PRIMARY KEY AUTOINCREMENT
LogDate TEXT
Message TEXT
Additional TEXT
ElapsedMilliseconds REAL
LogLevel TEXT
MachineName TEXT
UserName TEX
ProcessName TEXT
CallingMethod TEXT
LineNumber TEXT

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();

SqLiteTarget target = new SqLiteTarget();
target.ConnectionString = @"ProviderDriver=SQLite3 ODBC Driver;Database=E:\sqlite.db;";
target.TableName = "LogTable";
//Set to zero to not discard max entries
target.MaxEntries = 10000;
Log.Config.Targets.Add(target);

Log.Debug("This is a test");