Beispiel #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);
                        }
                    }
                });
            }
        }
Beispiel #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());
                        }
                    }
                });
            }
        }
Beispiel #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>();
        }
Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #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();
        }