Tracking failed imap setup steps for app insights.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SQLite;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
@@ -49,4 +50,25 @@ public class CustomServerInformation
|
||||
/// Default is 5.
|
||||
/// </summary>
|
||||
public int MaxConcurrentClients { get; set; }
|
||||
|
||||
public Dictionary<string, string> GetConnectionProperties()
|
||||
{
|
||||
// Printout the public connection properties.
|
||||
|
||||
var connectionProperties = new Dictionary<string, string>
|
||||
{
|
||||
{ "IncomingServer", IncomingServer },
|
||||
{ "IncomingServerPort", IncomingServerPort },
|
||||
{ "IncomingServerSocketOption", IncomingServerSocketOption.ToString() },
|
||||
{ "IncomingAuthenticationMethod", IncomingAuthenticationMethod.ToString() },
|
||||
{ "OutgoingServer", OutgoingServer },
|
||||
{ "OutgoingServerPort", OutgoingServerPort },
|
||||
{ "OutgoingServerSocketOption", OutgoingServerSocketOption.ToString() },
|
||||
{ "OutgoingAuthenticationMethod", OutgoingAuthenticationMethod.ToString() },
|
||||
{ "ProxyServer", ProxyServer },
|
||||
{ "ProxyServerPort", ProxyServerPort }
|
||||
};
|
||||
|
||||
return connectionProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
using System;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
|
||||
namespace Wino.Core.Domain.Exceptions;
|
||||
|
||||
public class ImapClientPoolException : Exception
|
||||
{
|
||||
public ImapClientPoolException()
|
||||
{
|
||||
}
|
||||
|
||||
public ImapClientPoolException(string message, CustomServerInformation customServerInformation, string protocolLog) : base(message)
|
||||
{
|
||||
CustomServerInformation = customServerInformation;
|
||||
ProtocolLog = protocolLog;
|
||||
}
|
||||
|
||||
public ImapClientPoolException(string message, string protocolLog) : base(message)
|
||||
{
|
||||
ProtocolLog = protocolLog;
|
||||
}
|
||||
|
||||
public ImapClientPoolException(Exception innerException, string protocolLog) : base(Translator.Exception_ImapClientPoolFailed, innerException)
|
||||
{
|
||||
ProtocolLog = protocolLog;
|
||||
}
|
||||
|
||||
public CustomServerInformation CustomServerInformation { get; }
|
||||
public string ProtocolLog { get; }
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface ILogInitializer
|
||||
{
|
||||
void SetupLogger(string fullLogFilePath);
|
||||
|
||||
void RefreshLoggingLevel();
|
||||
}
|
||||
10
Wino.Core.Domain/Interfaces/IWinoLogger.cs
Normal file
10
Wino.Core.Domain/Interfaces/IWinoLogger.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface IWinoLogger
|
||||
{
|
||||
void SetupLogger(string fullLogFilePath);
|
||||
void RefreshLoggingLevel();
|
||||
void TrackEvent(string eventName, Dictionary<string, string> properties = null);
|
||||
}
|
||||
Reference in New Issue
Block a user