Questions tagged [psr-logger]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

Does magento and PSR provides a better way of custom logging than Zend

in previous magento version, i used to make a custom logger, using Zend\Log\Logger This was allowing me to create as many logger with custom name as i wanted. I would like to update this behavior with ...
  • 944
0 votes
0 answers
54 views

magento 2: type differences for scopeConfig and _logger in AbstractHelper class

This is probably a very stupid question but I'll ask anyway since I don't know the answer. This is an example of a custom module helper class that extends magento helper class: <?php namespace ...
  • 187
0 votes
1 answer
84 views

How to make a custom logger with append functionality in Magento 2?

I created a custom log for my module like this app/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
  • 78
0 votes
3 answers
381 views

magento 2 Cannot instantiate interface PsrExt\Log\LoggerInterface

Magento 2 enterprise edition getting error Cannot instantiate interface PsrExt\Log\LoggerInterface vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:57 Stack trace: #0 I tried ...
1 vote
4 answers
98 views

Magento 2 - How to add logs inside module

I have added like below way. But it doesn't work for that module use Psr\Log\LoggerInterface; /** * @var LoggerInterface */ protected $logger; protected $resultForwardFactory; public function ...
3 votes
1 answer
172 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 ...
  • 175
0 votes
1 answer
105 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
1 answer
67 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 ...
  • 819
0 votes
1 answer
2k 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-...
  • 503
2 votes
0 answers
272 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
1 answer
2k 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
2 answers
5k 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....
  • 1,484
2 votes
1 answer
3k 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): ...
  • 2,579
1 vote
3 answers
3k 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
2 answers
2k 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="...
  • 43.9k
136 votes
20 answers
277k 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 ...
  • 43.9k