The LogDNA factory implementation is not usable in real time application because if LogDNA server is unreachable the implementation do not time outs!
public static class Logger
{
private static ILoggerFactory _factory;
public static void ConfigureLogger(ILoggerFactory factory)
{
//Ignore exceptions while serializing
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
Error = (serializer, err) => { err.ErrorContext.Handled = true; }
};
try
{
//ToDo Here is the problem, AddLogDNA method halts execution and never time outs!
factory.AddLogDNA(new LogDNAOptions("digestion-key")
{
HostName = AppConstants.ServerName,
LogLevel = LogLevel.Debug
});
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
The LogDNA factory implementation is not usable in real time application because if LogDNA server is unreachable the implementation do not time outs!