14
14
15
15
using System ;
16
16
using System . ComponentModel ;
17
+ using System . IO ;
17
18
using System . Text ;
18
19
using Serilog . Configuration ;
19
20
using Serilog . Core ;
@@ -238,6 +239,15 @@ public static LoggerConfiguration File(
238
239
/// Ignored if <paramref see="rollingInterval"/> is <see cref="RollingInterval.Infinite"/>.
239
240
/// The default is to retain files indefinitely.</param>
240
241
/// <returns>Configuration object allowing method chaining.</returns>
242
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
243
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
244
+ /// <exception cref="ArgumentNullException">When <paramref name="outputTemplate"/> is <code>null</code></exception>
245
+ /// <exception cref="IOException"></exception>
246
+ /// <exception cref="InvalidOperationException"></exception>
247
+ /// <exception cref="NotSupportedException"></exception>
248
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
249
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
250
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
241
251
public static LoggerConfiguration File (
242
252
this LoggerSinkConfiguration sinkConfiguration ,
243
253
string path ,
@@ -299,6 +309,15 @@ public static LoggerConfiguration File(
299
309
/// Ignored if <paramref see="rollingInterval"/> is <see cref="RollingInterval.Infinite"/>.
300
310
/// The default is to retain files indefinitely.</param>
301
311
/// <returns>Configuration object allowing method chaining.</returns>
312
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
313
+ /// <exception cref="ArgumentNullException">When <paramref name="formatter"/> is <code>null</code></exception>
314
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
315
+ /// <exception cref="IOException"></exception>
316
+ /// <exception cref="InvalidOperationException"></exception>
317
+ /// <exception cref="NotSupportedException"></exception>
318
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
319
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
320
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
302
321
public static LoggerConfiguration File (
303
322
this LoggerSinkConfiguration sinkConfiguration ,
304
323
ITextFormatter formatter ,
@@ -339,6 +358,14 @@ public static LoggerConfiguration File(
339
358
/// the default is "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}".</param>
340
359
/// <returns>Configuration object allowing method chaining.</returns>
341
360
/// <remarks>The file will be written using the UTF-8 character set.</remarks>
361
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
362
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
363
+ /// <exception cref="IOException"></exception>
364
+ /// <exception cref="InvalidOperationException"></exception>
365
+ /// <exception cref="NotSupportedException"></exception>
366
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
367
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
368
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
342
369
[ Obsolete ( "New code should not be compiled against this obsolete overload" ) , EditorBrowsable ( EditorBrowsableState . Never ) ]
343
370
public static LoggerConfiguration File (
344
371
this LoggerAuditSinkConfiguration sinkConfiguration ,
@@ -367,6 +394,15 @@ public static LoggerConfiguration File(
367
394
/// to be changed at runtime.</param>
368
395
/// <returns>Configuration object allowing method chaining.</returns>
369
396
/// <remarks>The file will be written using the UTF-8 character set.</remarks>
397
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
398
+ /// <exception cref="ArgumentNullException">When <paramref name="formatter"/> is <code>null</code></exception>
399
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
400
+ /// <exception cref="IOException"></exception>
401
+ /// <exception cref="InvalidOperationException"></exception>
402
+ /// <exception cref="NotSupportedException"></exception>
403
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
404
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
405
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
370
406
[ Obsolete ( "New code should not be compiled against this obsolete overload" ) , EditorBrowsable ( EditorBrowsableState . Never ) ]
371
407
public static LoggerConfiguration File (
372
408
this LoggerAuditSinkConfiguration sinkConfiguration ,
@@ -393,6 +429,15 @@ public static LoggerConfiguration File(
393
429
/// <param name="encoding">Character encoding used to write the text file. The default is UTF-8 without BOM.</param>
394
430
/// <param name="hooks">Optionally enables hooking into log file lifecycle events.</param>
395
431
/// <returns>Configuration object allowing method chaining.</returns>
432
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
433
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
434
+ /// <exception cref="ArgumentNullException">When <paramref name="outputTemplate"/> is <code>null</code></exception>
435
+ /// <exception cref="IOException"></exception>
436
+ /// <exception cref="InvalidOperationException"></exception>
437
+ /// <exception cref="NotSupportedException"></exception>
438
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
439
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
440
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
396
441
public static LoggerConfiguration File (
397
442
this LoggerAuditSinkConfiguration sinkConfiguration ,
398
443
string path ,
@@ -428,6 +473,15 @@ public static LoggerConfiguration File(
428
473
/// <param name="encoding">Character encoding used to write the text file. The default is UTF-8 without BOM.</param>
429
474
/// <param name="hooks">Optionally enables hooking into log file lifecycle events.</param>
430
475
/// <returns>Configuration object allowing method chaining.</returns>
476
+ /// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
477
+ /// <exception cref="ArgumentNullException">When <paramref name="formatter"/> is <code>null</code></exception>
478
+ /// <exception cref="ArgumentNullException">When <paramref name="path"/> is <code>null</code></exception>
479
+ /// <exception cref="IOException"></exception>
480
+ /// <exception cref="InvalidOperationException"></exception>
481
+ /// <exception cref="NotSupportedException"></exception>
482
+ /// <exception cref="PathTooLongException">When <paramref name="path"/> is too long</exception>
483
+ /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission to access the <paramref name="path"/></exception>
484
+ /// <exception cref="ArgumentException">Invalid <paramref name="path"/></exception>
431
485
public static LoggerConfiguration File (
432
486
this LoggerAuditSinkConfiguration sinkConfiguration ,
433
487
ITextFormatter formatter ,
0 commit comments