Exemplo n.º 1
0
        /// <summary>
        /// Adds a sink that writes log events as to a Splunk instance via TCP.
        /// </summary>
        /// <param name="loggerConfiguration">The logger config</param>
        /// <param name="connectionInfo"></param>
        /// <param name="formatter">Custom formatter to use if you e.g. do not want to use the JsonFormatter.</param>
        /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
        /// <returns></returns>
        public static LoggerConfiguration SplunkViaTcp(this LoggerSinkConfiguration loggerConfiguration, SplunkTcpSinkConnectionInfo connectionInfo,
                                                       ITextFormatter formatter, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum)
        {
            var sink = new TcpSink(connectionInfo, formatter);

            return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a sink that writes log events as to a Splunk instance via TCP.
        /// </summary>
        /// <param name="loggerConfiguration">The logger config</param>
        /// <param name="connectionInfo"></param>
        /// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
        /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
        /// <param name="renderTemplate">If true, the message template is rendered</param>
        /// <returns></returns>
        public static LoggerConfiguration SplunkViaTcp(this LoggerSinkConfiguration loggerConfiguration, SplunkTcpSinkConnectionInfo connectionInfo,
                                                       LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, IFormatProvider formatProvider = null, bool renderTemplate = true)
        {
            var sink = new TcpSink(connectionInfo, formatProvider, renderTemplate);

            return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel));
        }
        public static LoggerConfiguration SplunkViaTcp(
            this LoggerSinkConfiguration loggerConfiguration,
            IPAddress hostAddresss,
            int port,
            LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
            IFormatProvider formatProvider         = null,
            bool renderTemplate = true)
        {
            var sink = new TcpSink(hostAddresss, port, formatProvider, renderTemplate);

            return(loggerConfiguration.Sink(sink, restrictedToMinimumLevel));
        }
Exemplo n.º 4
0
        private void InitComponents()
        {
            Form             = new PlayerForm();
            statusController = new StatusController();
            actionController = new ActionController();

            InitConnectionPool();

            if (Config.Global.TcpSinkActive)
            {
                tcpSink = new TcpSink(Config.Global.TcpSinkPort); //, 3000);  // TODO B4RELEASE: remove timeout from TcpSink
                tcpSink.Activate();
            }
        }