Is it possible to do the following using ELMAH?
logger.Log(" something");
I’m doing something like this:
try
{
// Code that might throw an exception
}
catch(Exception ex)
{
// I need to log error here...
}
This exception will not be automatically logged by ELMAH, because it was handled.
Direct log writing method, working since ELMAH 1.0:
ELMAH 1.2 introduces a more flexible API:
There is a difference between the two solutions:
Raisemethod applies ELMAH filtering rules to the exception.Logmethod does not.Raiseis subscription based and is able to log one exception into the several loggers.