1
0
mirror of synced 2024-11-05 11:09:17 +00:00
Tapeti/Tapeti.Serilog/TapetiSeriLogger.cs

47 lines
1.5 KiB
C#
Raw Normal View History

using System;
using ISeriLogger = Serilog.ILogger;
2019-01-24 21:52:21 +00:00
// ReSharper disable UnusedMember.Global
namespace Tapeti.Serilog
{
public class TapetiSeriLogger: ILogger
{
private readonly ISeriLogger seriLogger;
public TapetiSeriLogger(ISeriLogger seriLogger)
{
this.seriLogger = seriLogger;
}
public void Connect(TapetiConnectionParams connectionParams)
{
seriLogger.Information("Tapeti: trying to connect to {host}:{port}/{virtualHost}",
connectionParams.HostName,
connectionParams.Port,
connectionParams.VirtualHost);
}
public void ConnectFailed(TapetiConnectionParams connectionParams, Exception exception)
{
seriLogger.Error(exception, "Tapeti: could not connect to {host}:{port}/{virtualHost}",
connectionParams.HostName,
connectionParams.Port,
connectionParams.VirtualHost);
}
public void ConnectSuccess(TapetiConnectionParams connectionParams)
{
seriLogger.Information("Tapeti: successfully connected to {host}:{port}/{virtualHost}",
connectionParams.HostName,
connectionParams.Port,
connectionParams.VirtualHost);
}
public void HandlerException(Exception e)
{
seriLogger.Error(e, "Tapeti: exception in message handler");
}
}
}