Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we integrate elmah logging in servicestack

I am new to servicestack and elman logging.

Can any body suggest how do we integrate elmah in service stack applications.

Thank you...

like image 510
user2278861 Avatar asked Apr 14 '13 04:04

user2278861


People also ask

How do I create an ELMAH Error log?

In a nutshell, it involves four simple steps: 1 Download ELMAH and add the Elmah.dll assembly to your web application, 2 Register ELMAH's HTTP Modules and Handler in Web.config, 3 Specify ELMAH's configuration options, and 4 Create the error log source infrastructure, if needed. More ...

What is ELMAH in ASP NET?

ELMAH provides a simple, yet powerful mechanism for logging errors in an ASP.NET web application. Like Microsoft's health monitoring system, ELMAH can log errors to a database and can send the error details to a developer via email.

Where can I find more information on ELMAH's Error filtering capabilities?

For more information on ELMAH's error filtering capabilities, refer to the Error Filtering section in the ELMAH Articles. ELMAH provides a simple, yet powerful mechanism for logging errors in an ASP.NET web application.

How do I log to ELMAH using a proxy?

Since ASP.NET Core no longer support proxy configuration through web.config, you can log to elmah.io by configuring a proxy manually: In this example, the elmah.io client routes all traffic through http://localhost:8000.


1 Answers

If you have an existing logging solution then you can use the ServiceStack.Logging.Elmah project. It is available via NuGet.

Exceptions, errors and fatal calls will be logged to Elmah in addition to the originally intended logger. For all other log types, only the original logger is used.

So if you are already using Log4Net then you can just configure Elmah like this

ElmahLogFactory factory = new ElmahLogFactory(new Log4NetFactory());

If you don't want to wrap in over an existing log then you can just research adding Elmah to any ASP.NET website. There is no reason it wouldn't work just because you are using ServiceStack.

like image 179
kampsj Avatar answered Jan 02 '23 04:01

kampsj