Improve Agatha Log Message. Replace "RequestProcessor: unhandled exception while handling request!" by exception.Message?

44 views
Skip to first unread message

shapper

unread,
Mar 10, 2012, 6:45:30 AM3/10/12
to agath...@googlegroups.com
Hello,

I am using Agatha with NLog and the logged exceptions always get the same message:

"RequestProcessor: unhandled exception while handling request!"

Wouldn't be possible to actually log the exception.Message?

On the application that uses Agatha I use the following:
 
      if (log.IsErrorEnabled)
        log.Error(exception.Message, exception);

So my exceptions get the real exception message.
I am also getting the stack both from Agatha and my implementation.

The problem is that Agatha sends always the same message.

At least would be possible to change it as an Agatha Configuration option?

Thank You,
Miguel

Davy Brion

unread,
Mar 11, 2012, 1:46:01 PM3/11/12
to agath...@googlegroups.com
good point, the "unhandled exception while handling request" message is useless

shapper

unread,
Mar 12, 2012, 8:35:23 AM3/12/12
to agath...@googlegroups.com
Hello Davy,

I downloaded the latest version, built it and tried it as follows:

      // Manually logging the exception
      Exception exception = new ArgumentNullException();
      ILog log = LogManager.Adapter.GetLogger(this.GetType());
      log.Info(exception.Message, exception);

      // Let Agatha log the exception
      throw exception;

When I manually log the exception I get it right in the database:
 
  Message: Value cannot be null.
  StackTrace: System.ArgumentNullException: Value ...
  Type: System.ArgumentNullException

When the exception is logged by Agatha in fact I get 2 logs in the database with the following messages:

1 - RequestProcessor: unhandled exception while handling request!

     This one has the same message as usual ... StackTrace and Type are ok.

2 - System.ArgumentNullException: Value cannot be null.     at MVCApp.ServiceLayer.Handlers.CountUsersByDateHandler.Handle(CountUsersByDateRequest request) in ...

     This one has the entire Stack Trace in the message. StackTrace and Type are empty.


I think you might missed something when doing the change ... no?

Thank You,
Miguel

shapper

unread,
Mar 14, 2012, 10:14:45 AM3/14/12
to agath...@googlegroups.com
Hello Davy,

I just added an Issue to Agatha in Github which I think would solve this problem:
https://github.com/davybrion/Agatha/issues/22

And I also added a suggestion at the bottom related to the logger name.

Do you think it would be possible to have this?

Thank You,
Miguel


On Sunday, March 11, 2012 5:46:01 PM UTC, Davy Brion wrote:
good point, the "unhandled exception while handling request" message is useless

Davy Brion

unread,
Mar 14, 2012, 4:35:22 PM3/14/12
to agath...@googlegroups.com
Hey Miguel,

I'm gonna look into this during the weekend

shapper

unread,
Mar 14, 2012, 4:58:27 PM3/14/12
to agath...@googlegroups.com
Thank You Davy!
I will be waiting then.


On Wednesday, March 14, 2012 8:35:22 PM UTC, Davy Brion wrote:
Hey Miguel,

I'm gonna look into this during the weekend

Reply all
Reply to author
Forward
0 new messages