Both needs configuration files.
Log4Net
Pros
Log4Net
- Simple general purpose logging tool.
- Easy to integrate.
- Creates text file.
- Log levels: DEBUG, INFO, WARN, ERROR, FATAL.
Pros
- Highly configurable logging framework.
- Best used by calling explicitly through code.
- Can implement exception handling with handlers.
- Output: file, console, email.
- Thread-safe.
- Will not throw unexpected exceptions at run-time potentially causing application to crash.
- Not reliable.
ELMAH (Error Logging Modules And Handlers)
- Logging and notification of unhandled exceptions.
- Since it handles all unhandled exceptions, log level is always ERROR.
- Ability to display a list of errors and the details of a specific error from a web page.
- View exceptions via different mechanisms (SQL, RSS, Twitter, files, email etc).
- Customize filtering logic.
- Custom HandleError with ELMAH Attribute in ASP.NET MVC
Pros
- Good for reporting overall errors and unhandled exceptions.
- No change in application code for implementing ELMAH.
- Few configuration change.
- Good solution for YSOD (Yellow Screen Of Death).
Cons
- Can go complex.
- Only used for exception messages.
Log4Net - ELMAH - Appender
- Communicate with ELMAH library on behalf of Log4Net.
- Adds the ability to make Log4Net entries routed to ELMAH
0 comments:
Post a Comment