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(); }
static Logger() { Method = new FileLogMethod(); Configuration = new LogConfiguration(); }