#1 2015-09-20 16:09:14

jaclas
Member
Registered: 2014-09-12
Posts: 215

Logger and skip expected exceptions

Hi,

When I configure the logger with sllException level:

with TSQLLog.Family to
   begin
   Level: = [sllInfo, sllWarning, sllError, sllLastError, sllExceptionOS, sllException];
   end;

then mORMot will capture any exceptions that appear in applications (and in threads, this is very good!) and store them in the log. Even these that are caught in a try ... except. However, sometimes very useful it would be the ability to bypass the known and expected exception types.

Did you could add to logger opportunity to register exception classes, which will skipped in the log?

   with TSQLLog.Family to
   begin
   Level: = [sllInfo, sllWarning, sllError, sllLastError, sllExceptionOS, sllException];
   RegisterExpectedException(EMyException);
   RegisterExpectedException(EMyOtherException);
   end;

Thanks :-)

Offline

#2 2015-09-20 16:16:49

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Re: Logger and skip expected exceptions

That exists, the name is IgnoreExceptionor something like that.


Esteban

Offline

#3 2015-09-20 16:28:00

jaclas
Member
Registered: 2014-09-12
Posts: 215

Re: Logger and skip expected exceptions

I found in sources "IgnoreException" string only once in SynBidirSock.pas:

    /// low level WebSockets framing protocol
    function GetFrame(out Frame: TWebSocketFrame; TimeOut: cardinal; IgnoreExceptions: boolean): boolean;

Offline

#4 2015-09-21 10:00:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Logger and skip expected exceptions

Use TSynLogFamily.ExceptionIgnore list to register the type.

For instance:

TSQLLog.Family.ExceptionIgnore.Add(EConvertError);

Offline

Board footer

Powered by FluxBB