Questions tagged [psr-logger]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
276 views

Create custom log file magento 2.4.5

I want to create a custom log file in Magento 2.4.5 . Before, I was using the following method: $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/Custom_Token.log'); $this->logger = new \Zend\...
Jasvir Singh's user avatar
0 votes
1 answer
51 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 ...
Claims's user avatar
  • 1,146
0 votes
0 answers
236 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 ...
Lou Nik's user avatar
  • 433
0 votes
1 answer
210 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:...
blue's user avatar
  • 128
0 votes
3 answers
732 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 ...
Pawankumar's user avatar
1 vote
4 answers
197 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 ...
Prasad D. Warnakulasuriya's user avatar
3 votes
1 answer
223 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 ...
melchi's user avatar
  • 175
0 votes
1 answer
133 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?
Naiwrita09's user avatar
0 votes
1 answer
165 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 ...
summu's user avatar
  • 847
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-...
PhantomS's user avatar
  • 503
2 votes
0 answers
287 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\...
Simon Watts's user avatar
2 votes
2 answers
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 ...
Vladimir Despotovic's user avatar
2 votes
2 answers
6k 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....
Nausif's user avatar
  • 1,534
2 votes
1 answer
4k 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): ...
Sushivam's user avatar
  • 2,629
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
Pradeep Kumar's user avatar
5 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="...
Alana Storm's user avatar
  • 44.3k
143 votes
22 answers
312k 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 ...
Alana Storm's user avatar
  • 44.3k