You are not logged in.
Hi ab,
How to have all SQL statements executed by the framework to be logged? I tried several approach, but failed:
//TSynLog.Family.Level := LOG_VERBOSE; //I thought this will work but it's not.
TSynLog.Family.Level := [sllNone, sllInfo, sllDebug, sllTrace, sllWarning, sllError,
sllEnter, sllLeave,
sllLastError, sllException, sllExceptionOS, sllMemory, sllStackTrace,
sllFail, sllSQL, sllCache, sllResult, sllDB, sllHTTP, sllClient, sllServer,
sllServiceCall, sllServiceReturn, sllUserAuth,
sllCustom1, sllCustom2, sllCustom3, sllCustom4, sllNewRun,
sllDDDError, sllDDDInfo, sllMonitoring]; //not working...
TSynLog.Family.EchoToConsole := [sllSQL]; //not working...
//my other settings if they are useful here:
TSynLog.Family.AutoFlushTimeOut := 10;
TSynLog.Family.OnArchive := EventArchiveZip;
TSynLog.Family.ArchiveAfterDays := 7; // archive after 7 day
TSynLog.Family.DestinationPath := GetServerLogsFolder;
ForceDirectories(TSynLog.Family.DestinationPath);
I use the sqlite db. I serached all over the web but was not lucky, so post the question here.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
I declare my own inherited class (not necessary)
type
TubLog = class(TSQLLog)
protected
....
end;
declare a global variable
var
ubLog: TSynLogClass = TubLog;
reassign both mORMOt loggin class to my instance
initialization
SynDB.SynDBLog := ubLog;
mORMot.SQLite3Log := ubLog;
And when during application startup
with ubLog.Family do begin
...
Level := serverConfig.logging.levels; // you need at last sllDB, sllSQL here
end;
Offline
Thanks MPV! I'll try and let you know the result
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline