예제 #1
0
        public void Open(LogConfiguration configuration)
        {
            _configuration = configuration;
              _stream = null;
              _filename = GetLogFileName(DateTime.Now);

              var directory = GetDirectory();
              if (directory != null && !Directory.Exists(directory))
            Directory.CreateDirectory(directory);

              _stream = new FileStream(Path.Combine(directory, _filename), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
              Active = true;

              // Must come after opening since CheckExpiredFiles actually logs text
              CleanupExpiredFiles();
        }
예제 #2
0
파일: Logger.cs 프로젝트: mgefvert/Cronical
 static Logger()
 {
     Method = new FileLogMethod();
       Configuration = new LogConfiguration();
 }