-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation for NET to use Microsoft.Extensions.Logging API.
Add impl for Application Insights logging.
- Loading branch information
Showing
139 changed files
with
954 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
...ppInsights/AzureAppInsightsLogProvider.cs → ...ppInsights/AzureAppInsightsLogProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 9 additions & 30 deletions
39
dotnet/src/dotnetcore/GxClasses/Services/LogService/GXLogService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,25 @@ | ||
using System; | ||
using GeneXus.Application; | ||
using GxClasses.Helpers; | ||
using GeneXus.Configuration; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace GeneXus.Services.Log | ||
{ | ||
public interface IGXLogProvider : ILoggerFactory | ||
{ | ||
ILoggerFactory GetLoggerFactory(); | ||
} | ||
|
||
public static class GXLogService | ||
{ | ||
private static string LOG_SERVICE = "Log"; | ||
|
||
private static string AZURE_APPLICATION_INSIGHTS_LOG = "AZUREAPPLICATIONINSIGHTS"; | ||
private const string LOG_OUTPUT_ENVVAR = "GX_LOG_OUTPUT"; | ||
public static ILoggerFactory GetLogFactory() | ||
{ | ||
IGXLogProvider gxLogProvider = null; | ||
GXService providerService = GXServices.Instance?.Get(LOG_SERVICE); | ||
string logoutput = Environment.GetEnvironmentVariable(LOG_OUTPUT_ENVVAR); | ||
if (logoutput == null) { | ||
|
||
if (providerService != null) | ||
{ | ||
try | ||
{ | ||
#if !NETCORE | ||
Type type = Type.GetType(providerService.ClassName, true, true); | ||
#else | ||
Type type = AssemblyLoader.GetType(providerService.ClassName); | ||
#endif | ||
gxLogProvider = (IGXLogProvider)Activator.CreateInstance(type, new object[] { providerService }); | ||
return gxLogProvider.GetLoggerFactory(); | ||
} | ||
catch (Exception e) | ||
{ | ||
throw e; | ||
} | ||
Config.GetValueOf("LOG_OUTPUT", out string logProvider); | ||
logoutput = logProvider; | ||
} | ||
if (logoutput == AZURE_APPLICATION_INSIGHTS_LOG) | ||
return GeneXus.Services.Log.AzureAppInsightsLogProvider.GetLoggerFactory(); | ||
else | ||
{ | ||
return null; | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.