Tracking failed imap setup steps for app insights.

This commit is contained in:
Burak Kaan Köse
2025-02-16 13:23:45 +01:00
parent 3ddc1a6229
commit f7836eedce
11 changed files with 422 additions and 331 deletions

View File

@@ -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;
}
}

View File

@@ -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; }
}

View File

@@ -1,8 +0,0 @@
namespace Wino.Core.Domain.Interfaces;
public interface ILogInitializer
{
void SetupLogger(string fullLogFilePath);
void RefreshLoggingLevel();
}

View 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);
}