Reputation: 1545
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
Reputation: 11
The silver bullet here is
ElmahExtensions.RaiseError(exception);
(Reference)
Upvotes: 0
Reputation: 13266
Have you tried HttpContext.RiseError(new InvalidOperationException("Test"));
as mentioned in the https://github.com/ElmahCore/ElmahCore/#rise-exception ?
Upvotes: 0