Beispiel #1
0
        /// <summary>
        /// Indicate that the file name changes daily
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        public static FileLogOptions DailyFile(this FileLogOptions options)
        {
            options.FileName = () =>
            {
                var now = DateTime.UtcNow;

                return($"{now.Year}-{now.Month}-{now.Day}");
            };

            return(options);
        }
Beispiel #2
0
 /// <summary>
 /// Indicate that we are a per instance file
 /// </summary>
 /// <param name="options"></param>
 public static FileLogOptions PerInstanceFile(this FileLogOptions options)
 {
     options.FileName = PerInstanceFileName;
     return(options);
 }
Beispiel #3
0
 public LogFileManager(FileLogOptions options)
 {
     _options = options;
 }
Beispiel #4
0
        /// <summary>
        /// Create a default setup of once a day log files.
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        public static Func <RxLoggerConfiguration, IObservable <RxLogEntry>, IObservable <Unit> > All(FileLogOptions options)

        {
            return((c, o) => o.Where(x => c.Formatting.HasFormatter(x)).
                   Select(r => c.Formatting.FormatterFor(r).Formatted(c, r)).
                   Write(new LogFileManager(options)));
        }