diff --git a/src/LogentriesCore/AsyncLogger.cs b/src/LogentriesCore/AsyncLogger.cs index da3182b..64ccd81 100644 --- a/src/LogentriesCore/AsyncLogger.cs +++ b/src/LogentriesCore/AsyncLogger.cs @@ -470,6 +470,11 @@ public static bool IsNullOrWhiteSpace(String value) return true; } + public static bool isRunningOnMono() + { + return Type.GetType("Mono.Runtime") != null; + } + /* Retrieve configuration settings * Will check Enviroment Variable as the last fall back. * @@ -477,7 +482,7 @@ public static bool IsNullOrWhiteSpace(String value) private string retrieveSetting(String name) { string cloudconfig = null; - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (isRunningOnMono()) { cloudconfig = ConfigurationManager.AppSettings.Get(name); } @@ -604,7 +609,7 @@ protected virtual void WriteDebugMessages(string message) #endregion - #region publicMethods + #region Public Methods public virtual void AddLine(string line) {