Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.

correct mono runtime detection #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/LogentriesCore/AsyncLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,19 @@ 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.
*
*/
private string retrieveSetting(String name)
{
string cloudconfig = null;
if (Environment.OSVersion.Platform == PlatformID.Unix)
if (isRunningOnMono())
{
cloudconfig = ConfigurationManager.AppSettings.Get(name);
}
Expand Down Expand Up @@ -604,7 +609,7 @@ protected virtual void WriteDebugMessages(string message)

#endregion

#region publicMethods
#region Public Methods

public virtual void AddLine(string line)
{
Expand Down