You are not logged in.
Hi ab,
By default TSynLog automatically logs any exceptions raised and this is a nice feature, but I think it should ignore exceptions wrapped by any empty 'try...except' block. I guess it's a common practice to use a try...except block to "eat" some exceptions, for example:
try
// do something and if any exception raises just ignore them.
except
// ignore all exceptions here.
end;
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
It is another feature, at application level.
But IMHO exceptions should be exceptional.
See http://blog.synopse.info/post/2015/04/1 … -good-idea
Offline
@ab,
Sorry if I didn't make it clear - here I'm talking about the server side only. Like this:
function: TMyServerSideInterface.Method1: Integer;
begin
// Point A
try
// do something.
except // Point B
// ignore all exceptions here.
end;
end;
But the engine still logs exceptions raised between Point A and Point B.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Yes, it is as designed, and expected.
If the server code raises exceptions in "normal" process, then it is a design issue, and should be fixed.
On the server side, the exceptions should better always be cought by an "except...end" block, anyway.
So for your need, you could just remove exception logging from the SynLog levels.
But you will definitively miss a nice feature.
Offline
@ab,
There are times some exceptions can be ignored, for example, sending an email on the server-side, we might want to catch the 'internet error' and re-try again later.
On the other hand, it'll fix the issue if EchoCustom can tell TSynLog to ignore a given log entry.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
@edwinsn I use TSynLog.Family.ExceptionIgnore.Add(ExceptionXXX), it is not useful for you ?
Esteban
Offline
@EMartin,
Oops! I missed that feature, thanks! I think it's enough for now.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline