You are not logged in.
Pages: 1
I am currently writing all my log data to a single log file using
with TSQLLog.Family do
begin { enable logging to file and to console }
TSQLLog.Family.FileExistsAction:= acAppend;
DestinationPath:= ServerDataPath + 'Logs\';
...
then
TSQLLog.Add.Log(sllInfo, 'My Log Entry');
I want to split things up into separate log files - 1x log file for DB Access, 1 file for logic engine etc
I am a confused how the Logging 'Family' works. It mentions in the code comments that this can be done and so looking for some help in how best to do this.
Thanks in advance...
Offline
Use a sub-class, one per log.
type
TMyDBLog = type (TSynLog);
TMyLogicLog = type(TSynLog);
then each class could have its own log family, so you can set a file for each.
But I don't advice to separate the logs.
Use a single log file, with proper event level, is more easy to maintain and to debug, because you can look of the links between the layers. Use the SynLogViewer to filter the log, and only look at what is of interrest (e.g. DB or logic).
Offline
Cheers ab
I plan to have these additional log files as an option to log some real-time data from various sources. It's coming every few seconds and is good debugging info but is clogging up the regular log file.
I'll give it a try and see how it goes.
Cheers
Offline
I like the idea of the SynLogViewer though
Offline
It is just my personal experience feedback after looking at terrabytes of logs (literally) on 500 mORMot servers working together (in my previous job).
Hhah - yes I can relate to that!
Offline
Pages: 1