Example #1
0
        void Run()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

            if (Environment.UserInteractive)
            {
                SensuClient.Start();
                Console.CancelKeyPress += delegate
                {
                    _log.Info("Cancel Key Pressed. Shutting Down.");
                };
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SensuClient() };
                ServiceBase.Run(servicesToRun);
            }
        }
Example #2
0
        static void Main()
        {
            _log = LogManager.GetCurrentClassLogger();
#if DEBUG
            LogManager.GlobalThreshold = LogLevel.Trace;
#endif
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

            if (Environment.UserInteractive)
            {
                SensuClient.Start();
                Console.CancelKeyPress += delegate
                {
                    _log.Info("Cancel Key Pressed. Shutting Down.");
                };
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SensuClient() };
                ServiceBase.Run(servicesToRun);
            }
        }