cannot disable log file provider

42 views
Skip to first unread message

d.al...@astalegale.net

unread,
Mar 7, 2018, 12:23:52 PM3/7/18
to KalikoCMS Developer Forum
Hi Fredric,

Is there any way to disable the log writing on file?

We have some issues regarding the file writing, so we've decided to disable it at all, but unsuccessful

We tried to comment the section "fileLogger" in the web.config, like this:
<loggers>
<!--<fileLogger filename="|DataDirectory|cms-log-%yyyy%mm.txt" treshold="Major" />-->
<debugLogger treshold="Info" />
</loggers>


But we still getting the following error message:


[DirectoryNotFoundException: Could not find a part of the path 'D:\root\DVL\MyProject\MySite.Site\'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +271
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1291
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +144
System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +126
System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +103
System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) +30
System.IO.File.InternalAppendAllText(String path, String contents, Encoding encoding) +63
Kaliko.LogProviders.FileLogProvider.Write(LogItem item) +39
Kaliko.Logger.WriteToProviders(Severity serverity, LogItem logItem) +145
KalikoCMS.Serialization.JsonSerialization.DeserializeTypedJson(String json) +218


Reading your code if none file provider is configured, none log writing should be expected, but not seems be true.


Thanks in advance.

Best regards,
Davide

Fredrik Schultz

unread,
Mar 7, 2018, 4:37:06 PM3/7/18
to KalikoCMS Developer Forum
Hi,
I've verified the problem and found the root cause (which is an issue in log provider registration).

Will fix this issue and deploy a new nuget for the logger, issue registered at:

Thanks for reporting!

d.al...@astalegale.net

unread,
Mar 8, 2018, 6:51:22 AM3/8/18
to KalikoCMS Developer Forum
Thank you Fredrik, along this bug fixing can I suggest to add another variable in order to compose the filename log?

As well as |DataDirectory| returns the "App_Data" folder we need something to get the servername, a variabile called |MachineName| or |ServerName| for instance.

Do you think that it is possible?

Thanks again in advance

regards,
Davide

Fredrik Schultz

unread,
Mar 19, 2018, 2:22:57 AM3/19/18
to KalikoCMS Developer Forum
Hi,
I've fixed the configuration issue as well as adding |MachineName| as a placeholder for the server name.
You'll find a beta version of the nuget package attached to this post, I'll upload it to nuget.org after some additional testing.
Kaliko.Logger.1.2.0-beta1.nupkg

d.al...@astalegale.net

unread,
Mar 19, 2018, 4:04:45 AM3/19/18
to KalikoCMS Developer Forum
Thank you very much Fredrik, I'll try it right away!

best regards,
Davide

d.al...@astalegale.net

unread,
Mar 19, 2018, 9:57:36 AM3/19/18
to KalikoCMS Developer Forum
Hi Fredrik,

I've tested the new version and for our purposes works as expected.

Please, let us know when you'll release this version over Nuget.

Thanks again!

regards,
Davide

Reply all
Reply to author
Forward
0 new messages