@@ -140,7 +140,7 @@ public static LoggerConfiguration File(
140
140
/// <param name="retainedFileCountLimit">The maximum number of log files that will be retained,
141
141
/// including the current log file. For unlimited retention, pass null. The default is 31.</param>
142
142
/// <param name="encoding">Character encoding used to write the text file. The default is UTF-8 without BOM.</param>
143
- /// <param name="wrapper ">Optionally enables wrapping the output stream in another stream, such as a GZipStream .</param>
143
+ /// <param name="hooks ">Optionally enables hooking into log file lifecycle events .</param>
144
144
/// <returns>Configuration object allowing method chaining.</returns>
145
145
/// <remarks>The file will be written using the UTF-8 character set.</remarks>
146
146
public static LoggerConfiguration File (
@@ -158,7 +158,7 @@ public static LoggerConfiguration File(
158
158
bool rollOnFileSizeLimit = false ,
159
159
int ? retainedFileCountLimit = DefaultRetainedFileCountLimit ,
160
160
Encoding encoding = null ,
161
- StreamWrapper wrapper = null )
161
+ FileLifecycleHooks hooks = null )
162
162
{
163
163
if ( sinkConfiguration == null ) throw new ArgumentNullException ( nameof ( sinkConfiguration ) ) ;
164
164
if ( path == null ) throw new ArgumentNullException ( nameof ( path ) ) ;
@@ -167,7 +167,7 @@ public static LoggerConfiguration File(
167
167
var formatter = new MessageTemplateTextFormatter ( outputTemplate , formatProvider ) ;
168
168
return File ( sinkConfiguration , formatter , path , restrictedToMinimumLevel , fileSizeLimitBytes ,
169
169
levelSwitch , buffered , shared , flushToDiskInterval ,
170
- rollingInterval , rollOnFileSizeLimit , retainedFileCountLimit , encoding , wrapper ) ;
170
+ rollingInterval , rollOnFileSizeLimit , retainedFileCountLimit , encoding , hooks ) ;
171
171
}
172
172
173
173
/// <summary>
@@ -176,7 +176,7 @@ public static LoggerConfiguration File(
176
176
/// <param name="sinkConfiguration">Logger sink configuration.</param>
177
177
/// <param name="formatter">A formatter, such as <see cref="JsonFormatter"/>, to convert the log events into
178
178
/// text for the file. If control of regular text formatting is required, use the other
179
- /// overload of <see cref="File(LoggerSinkConfiguration, string, LogEventLevel, string, IFormatProvider, long?, LoggingLevelSwitch, bool, bool, TimeSpan?, RollingInterval, bool, int?, Encoding, StreamWrapper )"/>
179
+ /// overload of <see cref="File(LoggerSinkConfiguration, string, LogEventLevel, string, IFormatProvider, long?, LoggingLevelSwitch, bool, bool, TimeSpan?, RollingInterval, bool, int?, Encoding, FileLifecycleHooks )"/>
180
180
/// and specify the outputTemplate parameter instead.
181
181
/// </param>
182
182
/// <param name="path">Path to the file.</param>
@@ -197,7 +197,7 @@ public static LoggerConfiguration File(
197
197
/// <param name="retainedFileCountLimit">The maximum number of log files that will be retained,
198
198
/// including the current log file. For unlimited retention, pass null. The default is 31.</param>
199
199
/// <param name="encoding">Character encoding used to write the text file. The default is UTF-8 without BOM.</param>
200
- /// <param name="wrapper ">Optionally enables wrapping the output stream in another stream, such as a GZipStream .</param>
200
+ /// <param name="hooks ">Optionally enables hooking into log file lifecycle events .</param>
201
201
/// <returns>Configuration object allowing method chaining.</returns>
202
202
/// <remarks>The file will be written using the UTF-8 character set.</remarks>
203
203
public static LoggerConfiguration File (
@@ -214,11 +214,11 @@ public static LoggerConfiguration File(
214
214
bool rollOnFileSizeLimit = false ,
215
215
int ? retainedFileCountLimit = DefaultRetainedFileCountLimit ,
216
216
Encoding encoding = null ,
217
- StreamWrapper wrapper = null )
217
+ FileLifecycleHooks hooks = null )
218
218
{
219
219
return ConfigureFile ( sinkConfiguration . Sink , formatter , path , restrictedToMinimumLevel , fileSizeLimitBytes , levelSwitch ,
220
220
buffered , false , shared , flushToDiskInterval , encoding , rollingInterval , rollOnFileSizeLimit ,
221
- retainedFileCountLimit , wrapper ) ;
221
+ retainedFileCountLimit , hooks ) ;
222
222
}
223
223
224
224
/// <summary>
@@ -293,7 +293,7 @@ static LoggerConfiguration ConfigureFile(
293
293
RollingInterval rollingInterval ,
294
294
bool rollOnFileSizeLimit ,
295
295
int ? retainedFileCountLimit ,
296
- StreamWrapper wrapper )
296
+ FileLifecycleHooks hooks )
297
297
{
298
298
if ( addSink == null ) throw new ArgumentNullException ( nameof ( addSink ) ) ;
299
299
if ( formatter == null ) throw new ArgumentNullException ( nameof ( formatter ) ) ;
@@ -306,7 +306,7 @@ static LoggerConfiguration ConfigureFile(
306
306
307
307
if ( rollOnFileSizeLimit || rollingInterval != RollingInterval . Infinite )
308
308
{
309
- sink = new RollingFileSink ( path , formatter , fileSizeLimitBytes , retainedFileCountLimit , encoding , buffered , shared , rollingInterval , rollOnFileSizeLimit , wrapper ) ;
309
+ sink = new RollingFileSink ( path , formatter , fileSizeLimitBytes , retainedFileCountLimit , encoding , buffered , shared , rollingInterval , rollOnFileSizeLimit , hooks ) ;
310
310
}
311
311
else
312
312
{
@@ -315,7 +315,7 @@ static LoggerConfiguration ConfigureFile(
315
315
#pragma warning disable 618
316
316
if ( shared )
317
317
{
318
- if ( wrapper != null )
318
+ if ( hooks != null )
319
319
{
320
320
SelfLog . WriteLine ( "Unable to use output stream wrapper - these are not supported for shared log files" ) ;
321
321
}
@@ -324,7 +324,7 @@ static LoggerConfiguration ConfigureFile(
324
324
}
325
325
else
326
326
{
327
- sink = new FileSink ( path , formatter , fileSizeLimitBytes , buffered : buffered , wrapper : wrapper ) ;
327
+ sink = new FileSink ( path , formatter , fileSizeLimitBytes , buffered : buffered , hooks : hooks ) ;
328
328
}
329
329
#pragma warning restore 618
330
330
}
0 commit comments