diff --git a/Assets/Logging/LogManager.cs b/Assets/Logging/LogManager.cs index 3d28f9a..4b0ffb5 100644 --- a/Assets/Logging/LogManager.cs +++ b/Assets/Logging/LogManager.cs @@ -1,6 +1,9 @@ using System; +using System.IO; using log4net; +using log4net.Config; using log4net.Core; +using UnityEngine; /// /// Wraps Log4Net to only be used when not bein in a WebGL environment. @@ -12,7 +15,7 @@ public static class LogManager public static log4net.ILog GetLogger(Type type) { -#if !UNITY_WEBGL +#if !UNITY_WEBGL || UNITY_EDITOR return log4net.LogManager.GetLogger(type); #else return new ConsoleLogger(); @@ -21,13 +24,12 @@ public static class LogManager public static void ConfigureLogging() { -#if !UNITY_WEBGL - log4net.GlobalContext.Properties["LogFileName"] = $"{Application.dataPath}" + +#if !UNITY_WEBGL || UNITY_EDITOR + log4net.GlobalContext.Properties["LogFileName"] = $"{Application.dataPath}" + "\\Logging\\SSOLog"; var fi = new FileInfo($"{Application.dataPath}" + "\\Logging\\Log4NetConfiguration.xml"); - XmlConfigurator.Configure(fi); - Log.Debug("Log4Net configured."); + XmlConfigurator.Configure(fi); #else UnityEngine.Debug.Log("When using WebGL, logging is restricted to the console and unity's built in logger."); #endif