|
1 | 1 | using System;
|
2 | 2 | using System.Collections.Generic;
|
| 3 | +using System.Linq; |
3 | 4 | using Microsoft.Extensions.Configuration;
|
4 | 5 | using Serilog;
|
5 | 6 | using Serilog.Debugging;
|
6 | 7 | using Serilog.Extensions.Logging.File;
|
7 |
| -using System.Linq; |
| 8 | +using Serilog.Formatting; |
8 | 9 | using Serilog.Formatting.Compact;
|
9 | 10 | using Serilog.Formatting.Display;
|
10 |
| -using Serilog.Formatting; |
11 | 11 |
|
12 | 12 | namespace Microsoft.Extensions.Logging
|
13 | 13 | {
|
@@ -44,7 +44,7 @@ public static ILoggerFactory AddFile(this ILoggerFactory loggerFactory, IConfigu
|
44 | 44 | /// Adds a file logger initialized from the supplied configuration section.
|
45 | 45 | /// </summary>
|
46 | 46 | /// <param name="loggerFactory">The logger factory.</param>
|
47 |
| - /// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the |
| 47 | + /// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the |
48 | 48 | /// filename is calculated. May include environment variables.</param>
|
49 | 49 | /// <param name="minimumLevel">The level below which events will be suppressed (the default is <see cref="LogLevel.Information"/>).</param>
|
50 | 50 | /// <param name="levelOverrides">A dictionary mapping logger name prefixes to minimum logging levels.</param>
|
@@ -98,7 +98,7 @@ public static ILoggingBuilder AddFile(this ILoggingBuilder loggingBuilder, IConf
|
98 | 98 | /// Adds a file logger initialized from the supplied configuration section.
|
99 | 99 | /// </summary>
|
100 | 100 | /// <param name="loggingBuilder">The logging builder.</param>
|
101 |
| - /// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the |
| 101 | + /// <param name="pathFormat">Filname to write. The filename may include {Date} to specify how the date portion of the |
102 | 102 | /// filename is calculated. May include environment variables.</param>
|
103 | 103 | /// <param name="minimumLevel">The level below which events will be suppressed (the default is <see cref="LogLevel.Information"/>).</param>
|
104 | 104 | /// <param name="levelOverrides">A dictionary mapping logger name prefixes to minimum logging levels.</param>
|
@@ -143,7 +143,7 @@ private static Serilog.Core.Logger CreateLogger(string pathFormat,
|
143 | 143 | var configuration = new LoggerConfiguration()
|
144 | 144 | .MinimumLevel.Is(Conversions.MicrosoftToSerilogLevel(minimumLevel))
|
145 | 145 | .Enrich.FromLogContext()
|
146 |
| - .WriteTo.Async(w => w.RollingFile( |
| 146 | + .WriteTo.Async(w => w.File( |
147 | 147 | formatter,
|
148 | 148 | Environment.ExpandEnvironmentVariables(pathFormat),
|
149 | 149 | fileSizeLimitBytes: fileSizeLimitBytes,
|
|
0 commit comments