Beispiel #1
0
 public TelegrafSyslogProvider(
     string hostname,
     string appName,
     SyslogSettings syslogSettings,
     TransportProtocol transport,
     string server,
     int port,
     TcpSenderSettings senderSettings
     )
 {
     _syslogSettings = syslogSettings;
     _hostName       = hostname;
     _procId         = appName;
     _messageSender  = MessageSenderFactory.CreateFromSettings(transport, server, port, _syslogSettings.UseOctetCounting, senderSettings);
     _loggers        = new ConcurrentDictionary <string, ILogger>();
 }
        protected TelegrafSyslogLogger(string name, string host, Syslog.Framework.Logging.TransportProtocols.IMessageSender messageSender, string procId, SyslogSettings syslogSettings)
        {
            if (!string.IsNullOrWhiteSpace(name) && !IsValidPrintAscii(name, ' '))
            {
                throw new ArgumentException("Invalid parameter value", nameof(name));
            }
            if (!string.IsNullOrWhiteSpace(host) && !IsValidPrintAscii(host, ' '))
            {
                throw new ArgumentException("Invalid parameter value", nameof(host));
            }
            if (!string.IsNullOrWhiteSpace(procId) && !IsValidPrintAscii(procId, ' '))
            {
                throw new ArgumentException("Invalid parameter value", nameof(procId));
            }

            _settings      = syslogSettings;
            _name          = name;
            _host          = host;
            _messageSender = messageSender;
            _processId     = procId ?? GetProcId()?.ToString();
        }
 public Syslog5424v1Logger(string name, string host, Syslog.Framework.Logging.TransportProtocols.IMessageSender messageSender, string procId, SyslogSettings syslogSettings)
     : base(name, host, messageSender, procId, syslogSettings)
 {
     _structuredData = FormatStructuredData(syslogSettings.StructuredData);
 }
 public Syslog3164Logger(string name, string host, Syslog.Framework.Logging.TransportProtocols.IMessageSender messageSender, string procId, SyslogSettings syslogSettings)
     : base(name, host, messageSender, procId, syslogSettings)
 {
 }