Пример #1
0
        public static void Register(IStartupContext startupContext, bool updateApp, bool inConsole)
        {
            var appFolderInfo = new AppFolderInfo(startupContext);

            LogManager.Configuration = new LoggingConfiguration();

            if (Debugger.IsAttached)
            {
                RegisterDebugger();
            }

            RegisterExceptron();

            if (updateApp)
            {
                RegisterLoggly();
                RegisterUpdateFile(appFolderInfo);
            }
            else
            {
                if (inConsole && (OsInfo.IsMono || new RuntimeInfo(null, new ServiceProvider(new ProcessProvider())).IsUserInteractive))
                {
                    RegisterConsole();
                }

                RegisterAppFile(appFolderInfo);
            }

            LogManager.ReconfigExistingLoggers();
        }
Пример #2
0
        public static void Register(IStartupContext startupContext, bool updateApp, bool inConsole)
        {
            if (_isConfigured)
            {
                throw new InvalidOperationException("Loggers have already been registered.");
            }

            _isConfigured = true;

            var appFolderInfo = new AppFolderInfo(startupContext);

            if (Debugger.IsAttached)
            {
                RegisterDebugger();
            }

            if (updateApp)
            {
                RegisterUpdateFile(appFolderInfo);
            }
            else
            {
                if (inConsole && RuntimeInfo.IsUserInteractive)
                {
                    RegisterConsole();
                }

                RegisterAppFile(appFolderInfo);
            }

            LogManager.ReconfigExistingLoggers();
        }
Пример #3
0
        public static void Register(IStartupContext startupContext, bool updateApp, bool inConsole)
        {
            var appFolderInfo = new AppFolderInfo(startupContext);

            LogManager.Configuration = new LoggingConfiguration();

            if (Debugger.IsAttached)
            {
                RegisterDebugger();
            }

            //Disabling for now - until its fixed or we yank it out
            //RegisterExceptron();

            if (updateApp)
            {
                RegisterLoggly();
                RegisterUpdateFile(appFolderInfo);
            }
            else
            {
                if (inConsole && (OsInfo.IsMono || RuntimeInfoBase.IsUserInteractive))
                {
                    RegisterConsole();
                }

                RegisterAppFile(appFolderInfo);
            }

            LogManager.ReconfigExistingLoggers();
        }
Пример #4
0
        public static void Register(IStartupArguments startupArguments, bool updateApp, bool inConsole)
        {
            var appFolderInfo = new AppFolderInfo(new DiskProvider(), startupArguments);

            LogManager.Configuration = new LoggingConfiguration();

            RegisterExceptron();

            if (updateApp)
            {
                RegisterLoggly();
                RegisterUpdateFile(appFolderInfo);
            }
            else
            {
                if (inConsole && (OsInfo.IsLinux || new RuntimeInfo(null).IsUserInteractive))
                {
                    RegisterConsole();
                }

                RegisterAppFile(appFolderInfo);
            }

            LogManager.ReconfigExistingLoggers();
        }
Пример #5
0
        private static IConfiguration GetConfiguration(StartupContext context)
        {
            var appFolder = new AppFolderInfo(context);

            return(new ConfigurationBuilder()
                   .AddXmlFile(appFolder.GetConfigPath(), optional: true, reloadOnChange: false)
                   .Build());
        }
Пример #6
0
        private static IConfiguration GetConfiguration(StartupContext context)
        {
            var appFolder = new AppFolderInfo(context);

            return(new ConfigurationBuilder()
                   .AddXmlFile(appFolder.GetConfigPath(), optional: true, reloadOnChange: false)
                   .AddInMemoryCollection(new List <KeyValuePair <string, string> > {
                new ("dataProtectionFolder", appFolder.GetDataProtectionPath())
            })
Пример #7
0
        public static void Register(IStartupContext startupContext, bool updateApp, bool inConsole)
        {
            if (_isConfigured)
            {
                throw new InvalidOperationException("Loggers have already been registered.");
            }

            _isConfigured = true;

            GlobalExceptionHandlers.Register();

            var appFolderInfo = new AppFolderInfo(startupContext);

            if (Debugger.IsAttached)
            {
                RegisterDebugger();
            }

            RegisterSentry(updateApp);

            if (updateApp)
            {
                RegisterUpdateFile(appFolderInfo);
                RegisterLogEntries();
            }
            else
            {
                if (inConsole && (OsInfo.IsNotWindows || RuntimeInfo.IsUserInteractive))
                {
                    RegisterConsole();
                }

                RegisterAppFile(appFolderInfo);
            }

            RegisterAuthLogger();

            LogManager.ReconfigExistingLoggers();
        }