JsReport - Logger don't write in file
-
Hi,
I've a .NET Core WebApp running JsReport as utility on IIS.
I have a problem with logs, JsReport don't output logs to file according to json configuration.PS : IIS app pool has every needed rights.
#region JsReport services.AddJsReport(new LocalReporting() .UseBinary(JsReportBinary.GetBinary()) .KillRunningJsReportProcesses() .Configure(cfg => cfg .AllowedLocalFilesAccess() .FileSystemStore() .BaseUrlAsWorkingDirectory()) .AsUtility() .Create()); #endregion
{ "logger": { "file": { "transport": "file", "level": "debug", "filename": "logs/jsreport.log" }, "error": { "transport": "file", "level": "debug", "filename": "./logs/jsreport-test.log" } }, "discover": true, "assets": { "allowedFiles": "**/*.*", "searchOnDiskIfNotFoundInStore": true, "rootUrlForLinks": "file:////D:/[...]/[...]/jsreport", "publicAccessEnabled": false }, "templatingEngines": { "timeout": 80000, "strategy": "http-server", "numberOfWorkers": 4 }, "chrome": { "timeout": 60000, "strategy": "chrome-pool", "numberOfWorkers": 4 }, "extensions": { "scripts": { "allowedModules": [ "bwip-js" ] } } }
I've already try with relative or full path it doesn't work too.
Any idea would be welcoming.Thanks in advance !
-
Anyone can help me ?
-
Unfortunately at the moment logs config doesn't work when using
AsUtility
. You need to useAsWebServer
in order to get the logs persisted this way.
https://jsreport.net/learn/dotnet-local#utility-or-web-server
-
@jan_blaha You have save me a lot of time from understand what was going on.
So, another question. I have the same problem to get JsReport using temp directory declared in jsreport.config.json.I guess it's also when using AsUtility ?
PS : There is any plan to get logs working when using AsUtility ?
Thanks in advance,
Have a good day.
-
So, another question. I have the same problem to get JsReport using temp directory declared in jsreport.config.json.
When using jsreport binary/jsreport local it is too late to set tempDirectory in the config file.
Because some files needs to be unpacked before the config file is loaded.
You should use this code to set the tempDirectorynew LocalReporting().TempDirectory("my temp path")
PS : There is any plan to get logs working when using AsUtility ?
Yes I believe it should work so we are going to fix it once.
-
Thanks !