Skip to content

Unable to set Destructurers via GlobalLogContext #14

@iihnat

Description

@iihnat

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)); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions