public static void SetLogFilePath(string logFilePath)
        {
            if (logger != null)
            {
                IDisposable disp = logger;
                logger = null;
                disp.Dispose();
            }

            if (logFilePath != null)
            {
                logFilePath = Path.GetFullPath(logFilePath);
                if (File.Exists(logFilePath))
                    File.Delete(logFilePath);
                FileLogger newLogger = new FileLogger(logFilePath);
                newLogger.AddEntry(new CsvLogEntry("Name", "ElapsedMillis"));
                logger = newLogger;
            }
        }
 /// <summary>
 /// Initializes a new instance of the LogFileTraceListener class.
 /// </summary>
 /// <param name="logFileName">The log file name to write to.</param>
 /// <param name="facility">The facility name.</param>
 public LogFileTraceListener(string logFileName, string facility)
 {
     logger = new FileLogger(logFileName, logFileName + ".old", LOG_FILE_SIZE_THRESHOLD);
     this.facility = facility;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the LogFileTraceListener class.
 /// </summary>
 /// <param name="logFileName">The log file name to write to.</param>
 /// <param name="facility">The facility name.</param>
 public LogFileTraceListener(string logFileName, string facility)
 {
     logger        = new FileLogger(logFileName, logFileName + ".old", LOG_FILE_SIZE_THRESHOLD);
     this.facility = facility;
 }