예제 #1
0
        /// <summary>
        /// Inicia a sincronizaçao com o servidor
        /// </summary>
        public static void Run()
        {
            if (_stopCalled)
            {
                return;
            }

            if (_run == null || _run.Status != TaskStatus.Running)
            {
                _run = Task.Factory.StartNew(() =>
                {
                    lock (Lock)
                        _isRunning = true;

                    while (_isRunning)
                    {
                        try
                        {
                            Runner();
                        }
                        catch (Exception ex)
                        {
                            NetStashLog log = new NetStashLog(_server, _port, "NetStash", "NetStash");
                            log.InternalError("Logstash communication error: " + ex.Message);
                        }
                    }
                });
            }
        }
예제 #2
0
        public static void Run()
        {
            if (stopCalled)
            {
                return;
            }

            if (run == null || run.Status != TaskStatus.Running)
            {
                run = Task.Factory.StartNew(() =>
                {
                    lock (_lock)
                        isRunning = true;

                    while (isRunning)
                    {
                        try
                        {
                            Runner();
                        }
                        catch (Exception ex)
                        {
                            NetStashLog log = new NetStashLog(logstashIp, logstashPort, currentappversion, user, Log.NetStashLog.TypeNet);
                            log.InternalError("Logstash communication error: " + ex.Message, System.Reflection.MethodBase.GetCurrentMethod());
                        }
                    }
                });
            }
        }
예제 #3
0
        public LogstashTcpLoggerProvider(LogstashOptions options)
        {
            var appName = AppDomain.CurrentDomain.FriendlyName;

            _disposed    = false;
            _netStash    = new NetStashLog(options.Host, options.Port, appName, options.AppName ?? appName);
            _extraValues = options.ExtraValues ?? new Dictionary <string, string>();
        }
예제 #4
0
        static void Main()
        {
            NetStashLog log = new NetStashLog("172.168.2.850", 5355, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileVersionInfo.FileVersion, "user", TypeNet.Net461);

            log.Error("Testing", System.Reflection.MethodBase.GetCurrentMethod());

            Thread.Sleep(500);

            log.Stop();
        }
예제 #5
0
        static void Main(string[] args)
        {
            NetStashLog log = new NetStashLog("172.168.2.102", 5356, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileVersionInfo.FileVersion, "hola");

            log.Error("Testing", System.Reflection.MethodBase.GetCurrentMethod());

            Thread.Sleep(500);

            log.Stop();
        }
예제 #6
0
        static void Main(string[] args)
        {
            NetStashLog log = new NetStashLog("brspomelkq01.la.imtn.com", 1233, "NSTest", "NSTestLog");
            Dictionary <string, string> vals = new Dictionary <string, string>();

            log.Error("Testing", vals);

            Thread.Sleep(50000);

            log.Stop();
        }