Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 static Logger()
 {
     Method = new FileLogMethod();
       Configuration = new LogConfiguration();
 }