diff --git a/Zen.Storage/Cache/Local.cs b/Zen.Storage/Cache/Local.cs index 8bd1b29..503f773 100644 --- a/Zen.Storage/Cache/Local.cs +++ b/Zen.Storage/Cache/Local.cs @@ -6,7 +6,13 @@ namespace Zen.Storage.Cache { public static class Local { - public static readonly string BasePath = Base.Current.Options?.CachePath ?? $"{Host.DataDirectory}{Path.DirectorySeparatorChar}cache{Path.DirectorySeparatorChar}"; + public static readonly string BasePath; + + static Local() + { + BasePath = Base.Current.Options?.CachePath ?? Path.Combine(Host.DataDirectory, "cache"); + Base.Current.Log.KeyValuePair("Local Cache BasePath", BasePath, Base.Module.Log.Message.EContentType.StartupSequence); + } public static string WriteString(string key, string source) { return Write(key, new MemoryStream(Encoding.UTF8.GetBytes(source))); } @@ -21,6 +27,8 @@ public static string Write(string key, Stream source) var targetFile = Path.Combine(BasePath, key); Directory.CreateDirectory(Path.GetDirectoryName(targetFile)); + Log.KeyValuePair("Local Cache Write", targetFile, Base.Module.Log.Message.EContentType.Debug); + using (var fileStream = File.Create(targetFile)) { source.Seek(0, SeekOrigin.Begin);