Questions tagged [psr-logger]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
54 views

Magento 2: Logging in a custom module

I created a new Magento 2 module and followed the injection-based logger object creation. protected $logger; public function __construct(\Psr\Log\LoggerInterface $logger) Now, when I log using ...
0
votes
1answer
36 views

How to create a separate log file to print the admin details who deletes a customer profile? [duplicate]

I want to create a new log file which will print the admin details who deletes a customer profile from admin panel in magento 2. How can I do that?
0
votes
1answer
27 views

How to see inside $this object in Magento 2 logger

How can I see inside the $this object in my logger file using prs logger? I tried this \Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->info("in ...
0
votes
1answer
127 views

PHP Fatal error: Class Mock_LoggerInterface contains 8 abstract >methods and must therefore be declared abstract or implement the remaining

Preconditions (*) Magento 2.3.1 upgraded from Magento 2.3.0 Php 7.2.15 OS : Ubuntu 18.04 Bionic Phpstorm 2019.1.1 Evnironemnt : Magento development PHPUnit 6.5.0 magento/magento2-functional-testing-...
2
votes
0answers
149 views

Monolog Error After 2.2 Upgrade [closed]

After an upgrade from 2.1.9 to 2.2.2, I am getting an error with the use of a Logger class in a custom module. The error is: PHP Fatal error: Uncaught TypeError: Argument 3 passed to Biztech\...
2
votes
1answer
829 views

How to change default file log name in Magento 2 in Psr Logger?

I have an instance of a logger in my PHP script that I use. I instantiate it like this: $logger = $om->get("Psr\Log\LoggerInterface"); I can log text like this: $logger->debug("caruk"); but ...
2
votes
2answers
2k views

PSR Logger not working for Magento 2

I'm trying to log some info in the existing Magento 2 module just to check if the code is running or not. Following files have been modified to log info. Magento\Checkout\Block\Cart\Item\Renderer....
2
votes
1answer
1k views

monolog/logger error magento

can anybody help on this : (Psr\Log\InvalidArgumentException): Level "" is not defined, use one of: 100, 200, 250, 300, 400, 500, 550, 600 vendor\monolog\monolog\src\Monolog\Logger.php(256): ...
0
votes
3answers
1k views

Logging to a Custom log file or dynamic log time stamp in Magento2

How i can create my own custom log file with time stamp each time when i log the error
4
votes
2answers
811 views

Magento 2: Can you use a Plugin with the `Psr\Log\LoggerInterface` type?

I've got a di.xml that looks something like this <config> <type name="Psr\Log\LoggerInterface"> <plugin name="namespace_modulename_plugins_psr" type="...
105
votes
13answers
123k views

Magento 2: Replacement for Mage::log method?

In Magento 1, if you wanted to send a message to the logs, you'd use a static method on the global Mage class. Mage::log($message, Zend_Log::DEBUG, "my-log-file.log"); Is there an equivalent in ...