Exemple #1
0
 /// <summary>
 /// Enable NLog as logging provider in .NET Core.
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="options">NLog options</param>
 /// <returns>ILoggerFactory for chaining</returns>
 public static ILoggerFactory AddLogger(this ILoggerFactory factory, NLogProviderOptions options)
 {
     ConfigureHiddenAssemblies();
     using (var provider = new NLogLoggerProvider(options))
     {
         factory.AddProvider(provider);
     }
     return(factory);
 }
Exemple #2
0
 /// <summary>
 /// New factory with options.
 /// </summary>
 /// <param name="options"></param>
 public NLogLoggerFactory(NLogProviderOptions options)
 {
     _provider = new NLogLoggerProvider(options);
 }
Exemple #3
0
 public NLogLogger(Logger logger, NLogProviderOptions options)
 {
     _logger  = logger;
     _options = options ?? NLogProviderOptions.Default;
 }
 /// <summary>
 /// New provider with options
 /// </summary>
 /// <param name="options"></param>
 public NLogLoggerProvider(NLogProviderOptions options)
 {
     Options = options;
 }