Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set Destructurers via GlobalLogContext #14

Open
iihnat opened this issue Jan 27, 2022 · 1 comment
Open

Unable to set Destructurers via GlobalLogContext #14

iihnat opened this issue Jan 27, 2022 · 1 comment
Labels
question Further information is requested

Comments

@iihnat
Copy link

iihnat commented Jan 27, 2022

I am trying to add DbUpdateExceptionDestructurer via GlobalLogContext. Please let me know if possible:


 var seriConfig = new LoggerConfiguration().Enrich.FromGlobalLogContext();
  Log.Logger = seriConfig.CreateLogger();
  var destructuringOptions = new DestructuringOptionsBuilder()
                 .WithDefaultDestructurers()
                 .WithDestructurers(new[] { new DbUpdateExceptionDestructurer() })
                 .WithIgnoreStackTraceAndTargetSiteExceptionFilter()
                 .WithDestructuringDepth(5)
                 .WithRootName("@x");

   GlobalLogContext.Push(new ExceptionEnricher(destructuringOptions)); 

@augustoproiete
Copy link
Member

@iihnat It should work... What error do you get?

@augustoproiete augustoproiete added the question Further information is requested label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants