Jean Michael
Jean Michael

Reputation: 117

Zend Framework Log Errors and Others to File

I need to log errors, access attempts, etc, to file by creating a plugin or adding in application.ini, in the error staying default to not show to final users

thanks in advance.

Upvotes: 0

Views: 3412

Answers (1)

adlawson
adlawson

Reputation: 6431

This is exactly what Zend_Log was created for.

https://docs.zendframework.com/zend-log/intro/

$writer = new Zend_Log_Writer_Stream('/path/to/logfile');
$logger = new Zend_Log($writer);

$logger->info('Informational message');
$logger->warn('Warning message');

Upvotes: 4

Related Questions