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 44using System ;
55using Microsoft . Extensions . Logging ;
66using Serilog . Extensions . Logging ;
7+ using System . ComponentModel ;
78
89namespace Serilog
910{
@@ -12,6 +13,21 @@ namespace Serilog
1213 /// </summary>
1314 public static class SerilogLoggerFactoryExtensions
1415 {
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+
1531 /// <summary>
1632 /// Add Serilog to the logging pipeline.
1733 /// </summary>
Original file line number Diff line number Diff line change 11{
2- "version" : " 1.3.0 -*" ,
2+ "version" : " 1.3.1 -*" ,
33 "description" : " Serilog provider for Microsoft.Extensions.Logging" ,
44 "authors" : [ " Microsoft" , " Serilog Contributors" ],
55 "packOptions" : {
You can’t perform that action at this time.
0 commit comments