File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/Serilog.Extensions.Logging Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -27,3 +27,4 @@ deploy:
27
27
tag : v$(appveyor_build_version)
28
28
on :
29
29
branch : master
30
+
Original file line number Diff line number Diff line change 4
4
using System ;
5
5
using Microsoft . Extensions . Logging ;
6
6
using Serilog . Extensions . Logging ;
7
+ using System . ComponentModel ;
7
8
8
9
namespace Serilog
9
10
{
@@ -12,6 +13,21 @@ namespace Serilog
12
13
/// </summary>
13
14
public static class SerilogLoggerFactoryExtensions
14
15
{
16
+ /// <summary>
17
+ /// Add Serilog to the logging pipeline.
18
+ /// </summary>
19
+ /// <param name="factory">The logger factory to configure.</param>
20
+ /// <param name="logger">The Serilog logger; if not supplied, the static <see cref="Serilog.Log"/> will be used.</param>
21
+ /// <returns>The logger factory.</returns>
22
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
23
+ public static ILoggerFactory AddSerilog (
24
+ this ILoggerFactory factory ,
25
+ ILogger logger )
26
+ {
27
+ if ( factory == null ) throw new ArgumentNullException ( nameof ( factory ) ) ;
28
+ return factory . AddSerilog ( logger , false ) ;
29
+ }
30
+
15
31
/// <summary>
16
32
/// Add Serilog to the logging pipeline.
17
33
/// </summary>
You can’t perform that action at this time.
0 commit comments