cancel
Showing results for 
Search instead for 
Did you mean: 

Generate log with object manager for debugging

SOLVED

Generate log with object manager for debugging

Hello everyone,

I am new to magento 2, so please help me.

I wanted to generate log in a site by using object manager. 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Generate log with object manager for debugging

Hello @jenny09yop1298 ,

Please check the below code:

\Magento\Framework\App\ObjectManager::getInstance()
    ->get(\Psr\Log\LoggerInterface::class)->debug('your message');

I hope this will help you. If it helps you please accept it as solution and give kudos.

Regards.

View solution in original post

2 REPLIES 2

Re: Generate log with object manager for debugging

Hello @jenny09yop1298 ,

Please check the below code:

\Magento\Framework\App\ObjectManager::getInstance()
    ->get(\Psr\Log\LoggerInterface::class)->debug('your message');

I hope this will help you. If it helps you please accept it as solution and give kudos.

Regards.

Re: Generate log with object manager for debugging

Thank you @vishi_gulati 

You saved my time. Smiley Happy