Is there an easy way to extract the log to a text file?
I read about the database file, but working with that sounds a bit daunting. We have a monitoring page and it would be helpful if i could post the log file to see who exceeded their quota, system errors, etc..
SoftPerfect Bandwidth Manager
Extracting the Log to a text file
Started by thetechfirm
Extracting the Log to a text file 12 May 2018, 21:46 |
Registered: 6 years ago Posts: 9 |
Re: Extracting the Log to a text file 12 May 2018, 23:55 |
Admin Registered: 18 years ago Posts: 3 570 |
There isn't really anything difficult in working with the database and you can extract data from it with simple SQL statements.
For example, to convert the list of events to a text file, try the following:
Another way to do it is to connect to the database directly from your web-page (depending on what scripting language is available) without using an intermediate text file. You can use the SQLiteSpy tool to explore the database.
For example, to convert the list of events to a text file, try the following:
- Download the SQLite command line shell and extract sqlite3.exe.
- In a command prompt execute something like this:
sqlite3 -csv "C:\ProgramData\SoftPerfect\Bandwidth Manager\Bandwidth Manager.DB" "SELECT * FROM EVENT ORDER BY ID" > somefile.txt
Another way to do it is to connect to the database directly from your web-page (depending on what scripting language is available) without using an intermediate text file. You can use the SQLiteSpy tool to explore the database.
Re: Extracting the Log to a text file 13 May 2018, 11:03 |
Registered: 6 years ago Posts: 9 |
Re: Extracting the Log to a text file 14 May 2018, 21:30 |
Registered: 6 years ago Posts: 9 |
Re: Extracting the Log to a text file 15 May 2018, 09:53 |
Admin Registered: 11 years ago Posts: 950 |
Re: Extracting the Log to a text file 15 May 2018, 11:05 |
Registered: 6 years ago Posts: 9 |
Re: Extracting the Log to a text file 15 May 2018, 11:28 |
Admin Registered: 18 years ago Posts: 3 570 |
Absolutely, just run it like this to clear the log:
Alternatively, if you only want to remove log records older than a week:
sqlite3 "C:\ProgramData\SoftPerfect\Bandwidth Manager\Bandwidth Manager.DB" "DELETE FROM EVENT"
Alternatively, if you only want to remove log records older than a week:
sqlite3 "C:\ProgramData\SoftPerfect\Bandwidth Manager\Bandwidth Manager.DB" "DELETE FROM EVENT WHERE MESSAGE_TIME < datetime('now', '-7 days', 'localtime')"