Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load config file provider from json not load #94

Open
augustovilarinhoneto opened this issue Apr 28, 2023 · 2 comments
Open

Load config file provider from json not load #94

augustovilarinhoneto opened this issue Apr 28, 2023 · 2 comments

Comments

@augustovilarinhoneto
Copy link

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 augustovilarinhoneto changed the title Load config file provider from json Load config file provider from json not Load Apr 28, 2023
@augustovilarinhoneto augustovilarinhoneto changed the title Load config file provider from json not Load Load config file provider from json not load Apr 28, 2023
@exilon
Copy link
Owner

exilon commented Apr 30, 2023

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

@augustovilarinhoneto
Copy link
Author

Yes i added it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants