2

I have gone through Elmah documentation, it says it is for asp.net but it do not say anything that if can be used or not for non IIS applications.

It is a sort of mystery for me now because we are considering using it in a new project. I found this (Using ELMAH in a console application) thread where some people say it can be used but others say they left trying that.

Our interest in Elmah is that it handles nu-handled exceptions.

Can you please tell if you have tried this was it successful or what was conclusion.

Community
  • 1
  • 1
user576510
  • 5,777
  • 20
  • 81
  • 144
  • 1
    The answer in the QA you reference states a way on how to do it. So the answer is **yes it was successful**. Suggest you give that code a try and let us know if you run into any problems. – Jeremy Thompson Sep 10 '14 at 02:33

1 Answers1

3

ELMAH is developed for handling exception in a web context. With that said, there's no problem logging from something like a console application or a winforms.

I've written a blog post about logging to ELMAH through SeriLog, but there are appenders for pretty much every logging framework:

https://docs.elmah.io/logging-to-elmah-io-from-serilog/

The example show how to log to elmah.io, but you can log to any data store that ELMAH supports.

ThomasArdal
  • 4,999
  • 4
  • 33
  • 73