Skip to content

Help with injecting Nlog through Microsoft.Extensions.Logging #1684

Closed Answered by MrBean2016
MrBean2016 asked this question in Q&A
Discussion options

You must be logged in to vote

Finally I figured out. Maybe this will help someone else.

           serviceCollection.AddLogging(loggingBuilder =>
           {
               loggingBuilder.ClearProviders();
               loggingBuilder.AddNLog(NLog.LogManager.GetCurrentClassLogger().Factory.Configuration);
           }

         new DicomSetupBuilder()
             .RegisterServices(s =>
             { 
                 s.AddFellowOakDicom().AddImageManager<WPFImageManager>();
                 s.AddLogging(logging => logging.AddNLog());
             })
             .Build();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MrBean2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant