0

How can i create zend log.I need to create on manual file in application folder and write response data in that file with full description.

1
  • Is this for ZF1 or ZF2? Commented Oct 24, 2016 at 13:34

1 Answer 1

3

From the documentation of each framework:

In ZendFramework 1.12 you can do the following:

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

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

Documentation

In ZendFramework 2 you can do the following:

$logger = new \Zend\Log\Logger();

//log to file
$writer = new \Zend\Log\Writer\Stream(getcwd() . '/path/to/logfile');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Information message');

Documentation

Sign up to request clarification or add additional context in comments.

Comments

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.