Created
June 13, 2017 16:31
-
-
Save gelanivishal/bb67de17121cb21912edc8995a62b6af to your computer and use it in GitHub Desktop.
Create custom log file in magento2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create custom log file in var/log/... | |
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/XYZ.log'); // Whatever name you want | |
$logger = new \Zend\Log\Logger(); | |
$logger->addWriter($writer); | |
$logger->info('Amazon Request'); // Set simple text in log file | |
$logger->info(print_r($array_of_content, true)); // array you want to log file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment