0

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.

adlawson
  • 6,303
  • 1
  • 35
  • 46
Jean Michael
  • 117
  • 1
  • 2
  • 7

1 Answers1

4

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');
adlawson
  • 6,303
  • 1
  • 35
  • 46
  • @zuberSurya Wherever you want. It's probably best placed in the Bootstrap though (preferably after the autoloader is registered). – adlawson Apr 24 '12 at 00:03