Yii Framework Forum: Cemaillogroute Dynamic Subject - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cemaillogroute Dynamic Subject Rate Topic: -----

#1 User is offline   Luciano Santana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 31-January 13

Posted 17 May 2013 - 03:08 AM

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
0

#2 User is offline   Luciano Santana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 31-January 13

Posted 22 May 2013 - 04:56 AM

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.
0

#3 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,562
  • Joined: 04-March 10
  • Location:UK

Posted 22 May 2013 - 09:56 AM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users