QuickLogger icon indicating copy to clipboard operation
QuickLogger copied to clipboard

Load config file provider from json not load

Open augustovilarinhoneto opened this issue 2 years ago • 2 comments

I'm not able to load the file provider via json, there is some flag or configuration that needs to be done beforehand. I'm doing it like this, but it's not loading the file settings.

Logger.Providers.Clear; GlobalLogFileProvider.LoadFromFile('c:\logFileProvider.json');

Below the json file:

{"GlobalLogFileProvider": { "Enabled": true, "FileName": "\AppComanda\log\SrvAppComanda.log", "AutoFileNameByProcess": false, "MaxRotateFiles": 1, "MaxFileSizeInMB": 1, "DailyRotate": true, "RotatedFilesPath": "\AppComanda\log\rotlog", "CompressRotatedFiles": true, "ShowEventType": true, "ShowHeaderInfo": true, "UnderlineHeaderEventType": false, "AutoFlush": false, "Name": "TLogFileProvider", "LogLevel": "[etInfo,etSuccess,etWarning,etError,etCritical,etException]", "TimePrecission": true, "MaxFailsToRestart": 2, "MaxFailsToStop": 5, "CustomMsgOutput": true, "CustomFormatOutput" : "%{DATE} %{TIME} - [%{LEVEL}] : %{MESSAGE} (%{MYTAG1} / %{MYTAG2})", "UsesQueue": true, "SendLimits": { "TimeRange": "slNoLimit", "LimitEventTypes": "[etInfo]", "MaxSent": 0 }, "AppName": "SrvAppComanda", "Environment": "", "PlatformInfo": "", "IncludedInfo": "[iiAppName,iiHost,iiUserName,iiOSVersion]" } }

I'm using Delphi: 10.2

augustovilarinhoneto avatar Apr 28 '23 19:04 augustovilarinhoneto

did you add provider to logger? Logger.Providers.Add(GlobalLogFileProvider);

exilon avatar Apr 30 '23 21:04 exilon

Yes i added it.

augustovilarinhoneto avatar May 02 '23 11:05 augustovilarinhoneto