Cemaillogroute Dynamic Subject

Hi folks,

I am trying to find out how to add some dynamic content to the subject of the email sent by CEmailLogRoute.

For instance, if the Log is generated by a “CHttpException 404” I would like to add that error code to the email’s subject.

I’ve though about extending CEmailLogRoute’s processLogs, but I am not sure where from extract the error/exception data.

Any help is appreciated

Thanks

Anyone, any idea ?

As an alternative I was trying to check at SiteController actionError, if the URL that generated the error was in an specific array (created by me). In case it was true I’d redirect the user. The idea of redirect is to avoid the 404 error.

That works fine for the user. But I still receive annoying Emails with 404 error. I suppose that the error is logged to the email before entering SiteContrroller actionError. How exactly may I filter it ? Extending CEmailLogRoute or setting a filter and extending CLogFilter ?

Still I wonder how to add the error code to the subject.

Thanks in advance.

I’ve had a look, but the only option I can see is to scan through the logs for a category of “exception.CHttpException.404” or filter on the same using the CLogger::getLogs() method.

EDIT:

It occurs to me that if you only want to avoid being notified of 404’s, you could use the except property to exclude the category above.