File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/Serilog.Extensions.Logging Expand file tree Collapse file tree 2 files changed +17
-1
lines changed 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>
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 1.3.0 -*" ,
2
+ "version" : " 1.3.1 -*" ,
3
3
"description" : " Serilog provider for Microsoft.Extensions.Logging" ,
4
4
"authors" : [ " Microsoft" , " Serilog Contributors" ],
5
5
"packOptions" : {
You can’t perform that action at this time.
0 commit comments