示例#1
0
 public static ILoggingBuilder AddSyslog(this ILoggingBuilder loggingBuilder, SysLogSettings settings)
 {
     loggingBuilder?.AddProvider(
         SyslogLoggerProviderExtensions.CreateSyslogLoggerProvider(settings)
         );
     return(loggingBuilder);
 }
示例#2
0
        private static SyslogLoggerProvider CreateSyslogLoggerProvider(string host, int port, Func <string, LogLevel, bool> filter = null)
        {
            SyslogLoggerProvider provider = SyslogLoggerProviderExtensions.CreateSyslogLoggerProvider(
                IPAddress.Parse(host ?? "127.0.0.1"),
                port,
                filter);

            return(provider);
        }
示例#3
0
 public static ILoggingBuilder AddSyslog(this ILoggingBuilder loggingBuilder, IPAddress host, int port, Func <string, LogLevel, bool> filter = null)
 {
     loggingBuilder?.AddProvider(
         SyslogLoggerProviderExtensions.CreateSyslogLoggerProvider(host, port, filter));
     return(loggingBuilder);
 }
示例#4
0
 public static ILoggerFactory AddSyslog(this ILoggerFactory factory, IPAddress host, int port, Func <string, LogLevel, bool> filter = null)
 {
     factory?.AddProvider(
         SyslogLoggerProviderExtensions.CreateSyslogLoggerProvider(host, port, filter));
     return(factory);
 }