Kammy
Kammy

Reputation: 431

What is best way to catch errors and exceptions in error.log file in Zend Application?

I want to implement errorlogger in my zend application. I have created logger which I am using for debugging but Can anybody tell me what is the best way to log errors so that they are more readable in file.

I have seen Sugarcrm logger which logs error in proper format. Does anybody have created logger like this. So that I can save my time. Thanks in advance.

Upvotes: 1

Views: 408

Answers (2)

Adrian Schneider
Adrian Schneider

Reputation: 7449

Use the Log application resource (which loads Zend_Log). It's extremely easy to set up and configure from your application.ini file, and you can set different logging options for different environments.

If you don't like the way the text is formatted, you can use use Zend_Log_Formatter to customize the text format.

Read: http://framework.zend.com/manual/en/zend.log.formatters.html

Upvotes: 1

Iznogood
Iznogood

Reputation: 12853

Well there is Zend_Log wich will make loging errors with zend easy as pie. here is some tutorial I found.

Upvotes: 1

Related Questions