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.

1 Answer 1

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');
Sign up to request clarification or add additional context in comments.

1 Comment

@zuberSurya Wherever you want. It's probably best placed in the Bootstrap though (preferably after the autoloader is registered).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.