Wallace B. McClure
Wallace B. McClure

Reputation: 1545

Elmah for .NET Core - manually logging

I've got an app that has elmah embedded in it for error logging. That app runs .net framework 4.x and uses a sql server backend. It is hosted up in azure.

I am porting the app the .net core and to connect to the same database and I need to store more information than just errors.

How does one manually enter an error into elmah under asp .net core?

Upvotes: 1

Views: 1527

Answers (2)

banks
banks

Reputation: 11

The silver bullet here is ElmahExtensions.RaiseError(exception); (Reference)

Upvotes: 0

Ramesh
Ramesh

Reputation: 13266

Have you tried HttpContext.RiseError(new InvalidOperationException("Test")); as mentioned in the https://github.com/ElmahCore/ElmahCore/#rise-exception ?

Upvotes: 0

Related Questions