# Serilog Enricher for exceptions

**URL:** <https://forum.umbraco.com/t/serilog-enricher-for-exceptions/5754>\
**Category:** Questions\
**Tags:** v13\
**Created:** [September 9, 2025, 8:20am UTC](https://forum.umbraco.com/t/serilog-enricher-for-exceptions/5754 "2025-09-09T08:20:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![markusjoha](https://forum.umbraco.com/user_avatar/forum.umbraco.com/markusjoha/32/141_2.png) [@markusjoha](https://forum.umbraco.com/u/markusjoha)\
**Post date:** [September 15, 2025, 2:19pm UTC](https://forum.umbraco.com/t/serilog-enricher-for-exceptions/5754/6 "2025-09-15T14:19:58Z")

</div>

Thanks @mistyn8!

I did spend about 4 hours trying to get something to work for **unhandled exception**.

About your examples:

1. 

```auto
.Enrich.FromGlobalLogContext()

```

Not an option as it would require me to reconfigure the logger that Umbraco uses, which feels “overkill” just to be able to add an enricher.

If I were to replace the logging initialization, it would be easy to just add my enrichers like so

```auto
.Enrich.With<MyCustomEnricher>()

```

1. 

```auto
using (_logger.BeginScope(scopeProps))
{
     _logger.LogInformation("Account register: {Email} registering for a new account", model.ContactDetails.Email);
}

```

Since I do not control the code that performs the logging (it’s part of Serilog) I cannot create a new scope when unhandled exceptions are logged.

1. 

```auto
LovellEnricher : ILogEventEnricher

```

Yes, this is what I’m doing. The problem was never to implement the enricher but to get it to fire for unhandled exceptions.

If you have a working sample on how to add a custom enricher that runs on unhandled exceptions without replacing the default i logger declaration, it would be cool to see 😀

I’ve got a workaround that works, so I’m quite happy. But it would be nice if there were a hook to register enrichers during the setup.

---

_[View the full topic](https://forum.umbraco.com/t/serilog-enricher-for-exceptions/5754)._
