Search
 
SCRIPT & CODE EXAMPLE
 

PHP

mage log magento 2

<?php /* for Magento 2.4 */
  $writer = new end_Log_Writer_Stream(BP . '/var/log/custom.log');
  $logger = new end_Log();
  $logger->addWriter($writer);
  $logger->info('Text Log'); //Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>
<?php
  $writer = new endLogWriterStream(BP . '/var/log/logfile.log');
  $logger = new endLogLogger();
  $logger->addWriter($writer);
  $logger->info('Simple Text Log'); // Simple Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>
  
Comment

mage log magento 2

<?php /* for Magento 2.4 */
  $writer = new end_Log_Writer_Stream(BP . '/var/log/custom.log');
  $logger = new end_Log();
  $logger->addWriter($writer);
  $logger->info('Text Log'); //Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>
Comment

magento 2 custom log file

$writer = new end_Log_Writer_Stream(BP . '/var/log/custom.log');
$logger = new end_Log();
$logger->addWriter($writer);
$logger->info('text message');
Comment

logger magento2

$writer = new endLogWriterStream(BP . '/var/log/test.log');
$logger = new endLogLogger();
$logger->addWriter($writer);
$logger->info('Your text message');
Comment

log magento 1

Mage::log('message',null,'logfile.log',true);
Mage::log(print_r($arr, 1), null, 'logfile.log',true);
Comment

log magento 1

Mage::log('message',null,'nam.log',true);
Comment

mage log equivalent magento 2

MagentoFrameworkAppObjectManager::getInstance()->get(PsrLogLoggerInterface::class)->debug('Your message here');
Comment

PREVIOUS NEXT
Code Example
Php :: laravel env use other env variables 
Php :: laravel throw 503 
Php :: php/Laravel check if date is passed 
Php :: php header 
Php :: magento check which user has added a product 
Php :: assign random to a variable in PHP 
Php :: get the value without setter method laravel 
Php :: laravel blade @if 3 varabile 
Php :: restart php service windows 
Php :: laravel call a static function 
Php :: single row data from table in laravel 
Php :: displaying variables in blade laravel 
Php :: require password confirm laravel 
Php :: array session 
Php :: global constant variable in laravel 
Php :: php spreadsheet styles 
Php :: define multiple variables in one line php 
Php :: heredoc 
Php :: laravel routes 
Php :: in php 
Php :: send data to api php 
Php :: PHP Example - AJAX and XML 
Php :: csv import in laravel 
Php :: how to add php to html 
Php :: csv import laravel 
Php :: Laravel group collection and sort by the biggest value 
Php :: Laravel: Foreign id does not have default value 
Php :: Laravel appends child when referencing it in attribute function 
Php :: How to validate Envato Purchase Code in PHP 
Php :: adding array not updating php 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =