public static LoggerConfiguration TCPSink( this LoggerSinkConfiguration loggerConfiguration, string uri, ITextFormatter textFormatter = null, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { var sink = new TCPSink(BuildUri(uri), textFormatter ?? new LogstashJsonFormatter()); return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel)); }
public static LoggerConfiguration TCPSink( this LoggerSinkConfiguration loggerConfiguration, IPAddress ipAddress, int port, ITextFormatter textFormatter = null, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { var sink = new TCPSink(ipAddress, port, textFormatter ?? new LogstashJsonFormatter()); return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel)); }
public static LoggerConfiguration TCPSink( this LoggerSinkConfiguration loggerConfiguration, ITextFormatter textFormatter = null, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { GetTcpAddress(); if (!string.IsNullOrEmpty(TcpAddressHost)) { var sink = new TCPSink(BuildUri($"tcp://{TcpAddressHost}:{TcpAddressProt}"), textFormatter ?? new LogstashJsonFormatter()); return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel)); } else { return(new LoggerConfiguration()); } }