Example #1
0
        private ILogObserver LogWriterFactory(string filePath)
        {
            var writer = new LogFileWriter(new DefaultLogFormatter(), filePath);

            writer.Initialize();

            return(writer);
        }
        private void InitializeLogging()
        {
            var logFileWriter = new LogFileWriter(new DefaultLogFormatter(), appConfig.RuntimeLogFilePath);

            logFileWriter.Initialize();
            logger.LogLevel = LogLevel.Debug;
            logger.Subscribe(logFileWriter);
        }
Example #3
0
        private void InitializeLogging()
        {
            var logFileWriter = new LogFileWriter(new DefaultLogFormatter(), logFilePath);

            logFileWriter.Initialize();
            logger.LogLevel = logLevel;
            logger.Subscribe(logFileWriter);
        }
Example #4
0
        private void InitializeLogging()
        {
            var runtimeLog    = $"{appSettings.LogFilePrefix}_Runtime.log";
            var logFileWriter = new LogFileWriter(new DefaultLogFormatter(), runtimeLog);

            logFileWriter.Initialize();
            logger.Subscribe(logFileWriter);
        }
        private void InitializeLogging()
        {
            var appDataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), nameof(SafeExamBrowser));
            var logFolder     = Path.Combine(appDataFolder, "Logs");
            var logFilePrefix = DateTime.Now.ToString("yyyy-MM-dd\\_HH\\hmm\\mss\\s");
            var logFilePath   = Path.Combine(logFolder, $"{logFilePrefix}_Service.log");
            var logFileWriter = new LogFileWriter(new DefaultLogFormatter(), logFilePath);

            logFileWriter.Initialize();
            logger.LogLevel = LogLevel.Debug;
            logger.Subscribe(logFileWriter);
        }