Esempio n. 1
0
 protected internal override LoggerSettings GetSettings(bool reload = false)
 {
     if (reload)
     {
         _settings = _settings.Reload();
         ReloadFileLoggerOptions(_settings);
     }
     return(_settings);
 }
Esempio n. 2
0
        protected void ReloadFileLoggerOptions(FileLoggerSettings settings)
        {
            lock ( _fileSync ) {
                bool resetStream = _rollOver != settings.RollOver;
                _rollOver = settings.RollOver;
                if (settings.FileName != _fileBaseName)
                {
                    _fileBaseName = settings.FileName;
                    resetStream   = true;
                }

                if (resetStream && _file != null)
                {
                    Interlocked.Exchange(ref _file, null)?.Dispose();
                }
            }
            _settings = settings;
            ReloadLoggerOptions(settings);
        }
Esempio n. 3
0
 public FileLoggerProvider(FileLoggerSettings settings)
     : base(settings)
 {
     ReloadFileLoggerOptions(settings);
 }