This file contains 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
\Magento\Framework\App\ObjectManager::getInstance() | |
->get(\Psr\Log\LoggerInterface::class)->info('message'); |
This file contains 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 | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
// PRODUCT | |
$product = $objectManager->create('\Magento\Catalog\Model\ProductRepository')->get(/* SKU Product */); | |
// ORDER | |
$order = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get(/*ID Order*/); |
This file contains 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 | |
/** | |
* This snippet is useful to debug in production environments. | |
* DON'T USE THIS CODE TO LOG IN YOUR MODULES. | |
* To create a custom log check Magento official documentation | |
* (https://devdocs.magento.com/guides/v2.4/config-guide/log/custom-logger-handler.html) | |
*/ | |
// Custom Log for Magento v2.3 or < |