{"id":260120,"date":"2015-06-25T15:44:02","date_gmt":"2015-06-25T11:44:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=260120"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=260120","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Log4php \u0432 Magento-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445"},"content":{"rendered":"<p>     \t<a href=\"http:\/\/magento.com\/\">Magento<\/a> \u0431\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f e-commerce \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u0435\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0433\u043e\u0434\u044b, \u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0435\u0431\u044f \u044d\u043a\u043e-\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0445 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0441\u0430\u043c\u044b\u043c \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e \u0432\u043e\u0442 \u0447\u0435\u0433\u043e \u043c\u043d\u0435 <s>\u0441\u0438\u043b\u044c\u043d\u043e<\/s> <b>\u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e<\/b> \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0432 Magento \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u00ab\u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0441\u043d\u0430\u0440\u044f\u0434\u0443\u00bb, \u0442\u0430\u043a \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f <a href=\"http:\/\/logging.apache.org\/log4php\/\">Log4php<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f Magento \u2014 \u044d\u0442\u043e \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0430\u00bb \u0434\u043b\u044f Log4php. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0443\u00bb \u0432 \u043d\u0430\u0448\u0438\u0445 Magento-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h1>\u00ab\u041e\u0431\u0435\u0440\u0442\u043a\u0430\u00bb \u0434\u043b\u044f \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0438\u00bb<\/h1>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043e\u0442 Praxigento_Log, \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 logger, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Magento-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438\u0431\u043e \u00ab\u0440\u043e\u0434\u043d\u043e\u0439\u00bb Magento-logger, \u043b\u0438\u0431\u043e Log4php, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c Praxigento_Log.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442 \u043a\u043e\u0434 \u044d\u0442\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">class Praxigento_Module_Logger {     private static $_isLog4phpUsed = null;     private $_loggerLog4php;     private $_name;      function __construct($name)     {         \/**          * switch off\/on error reporting to prevent messages like          * &quot;ERR (3): Warning: include(Praxigento\\Log\\Logger.php): failed to open stream: No such file or directory&quot;          * in case of Praxigento_Log module is not used.          *\/         $level = error_reporting(0);         self::$_isLog4phpUsed = class_exists('Praxigento_Log_Logger', true);         error_reporting($level);         if (self::$_isLog4phpUsed) {             $this-&gt;_loggerLog4php = Praxigento_Log_Logger::getLogger($name);         } else {             $this-&gt;_name = is_object($name) ? get_class($name) : (string)$name;         }     }      \/**      * Override getter to use '$log = Praxigento_Log_Logger::getLogger($this)' form in Mage classes.      *\/     public static function getLogger($name)     {         $class = __CLASS__;         return new $class($name);     }      public function debug($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'debug', Zend_Log::INFO);     }      \/**      * Internal dispatcher for the called log method.      *\/     private function doLog($message, $throwable, $log4phpMethod, $zendLevel)     {         if (self::$_isLog4phpUsed) {             $this-&gt;_loggerLog4php-&gt;$log4phpMethod($message, $throwable);         } else {             Mage::log($this-&gt;_name . ': ' . $message, $zendLevel);             if ($throwable instanceof Exception) {                 Mage::logException($throwable);             }         }     }      public function error($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'error', Zend_Log::ERR);     }      public function fatal($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'fatal', Zend_Log::CRIT);     }      public function info($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'info', Zend_Log::NOTICE);     }      public function trace($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'trace', Zend_Log::DEBUG);     }      public function warn($message, $throwable = null)     {         $this-&gt;doLog($message, $throwable, 'warn', Zend_Log::WARN);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430) \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c Praxigento_Log \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442. \u0412\u043e\u0442, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"php\">        $log = Praxigento_Module_Logger::getLogger(__CLASS__);         $log-&gt;trace('trace level message');         $log-&gt;debug('debug level message');         $log-&gt;info('info level message');         $log-&gt;warn('warn level message');         $log-&gt;error('error level message');         $log-&gt;fatal('fatal level message'); <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u0438 \u0441\u0430\u043c\u0438 \u043b\u043e\u0433\u0438 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f Praxigento_Log (Log4php framework):  <\/p>\n<pre><code>2015\/06\/25 09:59:55,973 TRACE P\\B\\T\\L\\UnitTest: trace level message 2015\/06\/25 09:59:55,973 DEBUG P\\B\\T\\L\\UnitTest: debug level message 2015\/06\/25 09:59:55,974 INFO P\\B\\T\\L\\UnitTest: info level message 2015\/06\/25 09:59:55,974 WARN P\\B\\T\\L\\UnitTest: warn level message 2015\/06\/25 09:59:55,975 ERROR P\\B\\T\\L\\UnitTest: error level message 2015\/06\/25 09:59:55,975 FATAL P\\B\\T\\L\\UnitTest: fatal level message <\/code><\/pre>\n<p>  \u2026 \u0438 \u043f\u0440\u0438 \u0435\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 (Zend_Log framework, \u0444\u0430\u0439\u043b var\/log\/system.log):  <\/p>\n<pre><code>2015-06-25T10:07:00+00:00 DEBUG (7): Praxigento_Bonus_Test_Logger_UnitTest: trace level message 2015-06-25T10:07:00+00:00 INFO (6): Praxigento_Bonus_Test_Logger_UnitTest: debug level message 2015-06-25T10:07:00+00:00 NOTICE (5): Praxigento_Bonus_Test_Logger_UnitTest: info level message 2015-06-25T10:07:00+00:00 WARN (4): Praxigento_Bonus_Test_Logger_UnitTest: warn level message 2015-06-25T10:07:00+00:00 ERR (3): Praxigento_Bonus_Test_Logger_UnitTest: error level message 2015-06-25T10:07:00+00:00 CRIT (2): Praxigento_Bonus_Test_Logger_UnitTest: fatal level message <\/code><\/pre>\n<h1>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Log4php<\/h1>\n<p>  \u0412 Magento \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u044c \u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 <a href=\"https:\/\/logging.apache.org\/log4php\/quickstart.html\">Log4php<\/a>:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/487\/059\/7a8\/4870597a8e6a487eb0240d7d59491e6e.png\" alt=\"image\"\/><br \/>  \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;configuration xmlns=&quot;http:\/\/logging.apache.org\/log4php\/&quot;&gt;     &lt;!-- ***********************************************************************************************         THIS IS SAMPLE CONFIGURATION THAT WILL BE REWRITTEN ON REINSTALL.         DON'T USE THIS FILE IN YOUR CONFIGURATION. MAKE A COPY TO &quot;app\/etc\/log4php.cfg.xml&quot; AND CHANGE         &quot;SYSTEM \/ CONFIGURATION \/ DEVELOPER \/ LOG SETTINGS \/ LOG4PHP CONFIG FILE NAME&quot; VALUE     *********************************************************************************************** --&gt;      &lt;!--             Available log levels:                 ALL -&gt; TRACE -&gt; DEBUG -&gt; INFO -&gt; WARN -&gt; ERROR -&gt; FATAL -&gt; OFF             Available appenders:                 http:\/\/logging.apache.org\/log4php\/docs\/appenders.html                 appenders\/LoggerAppenderMemory             Available layouts:                 http:\/\/logging.apache.org\/log4php\/docs\/layouts.html     --&gt;      &lt;!-- default appender --&gt;     &lt;appender name=&quot;fileDefault&quot; class=&quot;LoggerAppenderFile&quot;&gt;         &lt;layout class=&quot;LoggerLayoutPattern&quot;&gt;             &lt;param name=&quot;conversionPattern&quot; value=&quot;%d{Y\/m\/d H:i:s,u} %p %c{2}: %m%n&quot;\/&gt;         &lt;\/layout&gt;         &lt;param name=&quot;file&quot; value=&quot;\/absolute\/path\/to\/file\/log4php.log&quot;\/&gt;         &lt;param name=&quot;append&quot; value=&quot;true&quot;\/&gt;     &lt;\/appender&gt;      &lt;!-- In-memory log for Adminhtml (backend sync output) --&gt;     &lt;appender name=&quot;memoryDefault&quot; class=&quot;LoggerAppenderMemory&quot; threshold=&quot;DEBUG&quot;&gt;         &lt;layout class=&quot;LoggerLayoutPattern&quot;&gt;             &lt;param name=&quot;conversionPattern&quot; value=&quot;%date{H:i:s,u} %p %c{2}: %msg%n&quot;\/&gt;         &lt;\/layout&gt;     &lt;\/appender&gt;      &lt;!-- ERROR mail appender --&gt;     &lt;appender name=&quot;emailError&quot; class=&quot;LoggerAppenderMail&quot;&gt;         &lt;layout class=&quot;LoggerLayoutPattern&quot;&gt;             &lt;param name=&quot;conversionPattern&quot; value=&quot;%d{Y\/m\/d H:i:s,u} %p %c{2}: %m%n&quot;\/&gt;         &lt;\/layout&gt;         &lt;param name=&quot;to&quot; value=&quot;comma-separeted@emails.com&quot;\/&gt;         &lt;param name=&quot;from&quot; value=&quot;project-name@praxigento.com&quot;\/&gt;         &lt;filter class=&quot;LoggerFilterLevelRange&quot;&gt;             &lt;param name=&quot;levelMin&quot; value=&quot;ERROR&quot;\/&gt;             &lt;param name=&quot;levelMax&quot; value=&quot;FATAL&quot;\/&gt;         &lt;\/filter&gt;     &lt;\/appender&gt;      &lt;!-- root logger --&gt;     &lt;root&gt;         &lt;appender_ref ref=&quot;fileDefault&quot;\/&gt;         &lt;appender_ref ref=&quot;memoryDefault&quot;\/&gt;         &lt;appender_ref ref=&quot;emailError&quot;\/&gt;         &lt;level value=&quot;ALL&quot;\/&gt;     &lt;\/root&gt;  &lt;\/configuration&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h1>\u0411\u043e\u043d\u0443\u0441\u044b Log4php<\/h1>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438<\/h2>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u043e\u0442 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"php\">        $log = Praxigento_Module_Logger::getLogger(__CLASS__); <\/code><\/pre>\n<p>  \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432 \u043b\u043e\u0433\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0422\u0430\u043a \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 Praxigento_Bonus_Test_Logger_UnitTest \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043b\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f):  <\/p>\n<pre><code>2015\/06\/25 09:59:55,973 TRACE P\\B\\T\\L\\UnitTest: trace level message <\/code><\/pre>\n<p>  \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0431\u0449\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:  <\/p>\n<pre><code>$ cat  .\/var\/log\/old\/log4php.log_20150623 | grep 'P\\\\B\\\\T\\\\L\\\\UnitTest' <\/code><\/pre>\n<h2>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u0446\u0438\u044f \u043f\u043e \u0443\u0440\u043e\u0432\u043d\u044e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443<\/h2>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0432 \u043b\u043e\u0433 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u0431\u043e\u0435\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041f\u0440\u0438\u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433 \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432:  <\/p>\n<pre><code class=\"xml\">    &lt;root&gt;         &lt;appender_ref ref=&quot;defaultLog&quot;\/&gt;         &lt;level value=&quot;INFO&quot;\/&gt;     &lt;\/root&gt;     &lt;logger name=&quot;Praxigento_Bonus_Test_Logger_UnitTest&quot;&gt;         &lt;appender_ref ref=&quot;failureLog&quot;\/&gt;         &lt;level value=&quot;TRACE&quot;\/&gt;     &lt;\/logger&gt; <\/code><\/pre>\n<h2>Email-\u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a (\u0443\u0440\u043e\u0432\u043d\u0438 fatal, error, warn) \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043b\u043e\u0433-\u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e email&#8217;\u0443:  <\/p>\n<pre><code class=\"xml\">    &lt;appender name=&quot;emailInfo&quot; class=&quot;LoggerAppenderMail&quot;&gt;         &lt;layout class=&quot;LoggerLayoutPattern&quot;&gt;             &lt;param name=&quot;conversionPattern&quot; value=&quot;%d{Y\/m\/d H:i:s,u} %p %c{2}: %m%n&quot;\/&gt;         &lt;\/layout&gt;         &lt;param name=&quot;to&quot; value=&quot;support@praxigento.com,developers@praxigento.com&quot;\/&gt;         &lt;param name=&quot;from&quot; value=&quot;some-project@prxgt.com&quot;\/&gt;         &lt;filter class=&quot;LoggerFilterLevelRange&quot;&gt;             &lt;param name=&quot;levelMin&quot; value=&quot;WARN&quot;\/&gt;             &lt;param name=&quot;levelMax&quot; value=&quot;FATAL&quot;\/&gt;         &lt;\/filter&gt;     &lt;\/appender&gt; <\/code><\/pre>\n<h2>In-memory \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c Log4php \u0430\u043f\u0435\u043d\u0434\u0435\u0440\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 LoggerAppenderMemory, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u043e\u0433\u0430\u043c \u0438\u0437 Magento-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"xml\">    &lt;appender name=&quot;memoryDefault&quot; class=&quot;LoggerAppenderMemory&quot; threshold=&quot;DEBUG&quot;&gt;         &lt;layout class=&quot;LoggerLayoutPattern&quot;&gt;             &lt;param name=&quot;conversionPattern&quot; value=&quot;%date{H:i:s,u} %p %c{2}: %msg%n&quot;\/&gt;         &lt;\/layout&gt;     &lt;\/appender&gt; <\/code><\/pre>\n<pre><code class=\"php\">$log = Praxigento_Module_Logger::getLogger(__CLASS__); $log-&gt;debug('...'); $debugLog = LoggerAppenderMemory::getEventsAsArray(); <\/code><\/pre>\n<pre><code class=\"php\">&lt;pre class=&quot;prxgt_console&quot;&gt;     &lt;?php  foreach ($debugLog as $entry) {         echo trim($entry) . &quot;\\n&quot;;     }?&gt; &lt;\/pre&gt; <\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 cron. \u0421\u043f\u0438\u0441\u043e\u043a \u043b\u043e\u0433-\u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/414\/ebf\/87d\/414ebf87de0646b59ea972941dc79cc0.png\"\/><\/p>\n<h1>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h1>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 Magento-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"http:\/\/www.magentocommerce.com\/magento-connect\/apache-log4php-logging-framework-wrapper.html\">Composer<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/www.magentocommerce.com\/magento-connect\/apache-log4php-logging-framework-wrapper.html\">Magento Connect<\/a> (\u0442\u0430\u043c \u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u2014 Nmmlm_Log).<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0447\u0435\u0440\u0435\u0437 Composer \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 composer.json:  <\/p>\n<pre><code class=\"javascript\">{   &quot;require&quot;: {     &quot;praxigento\/mage_ext_log4php&quot;: &quot;*&quot;   },   &quot;repositories&quot;: [     {       &quot;type&quot;: &quot;vcs&quot;,       &quot;url&quot;: &quot;https:\/\/github.com\/praxigento\/mage_ext_log4php&quot;     }   ] } <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/github.com\/praxigento\/mage_ext_log4php\/releases\/latest\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a> \u043c\u043e\u0434\u0443\u043b\u044f, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 .\/src\/ \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432\u0430\u0448\u0435\u0433\u043e Magento-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/253665\/\"> http:\/\/habrahabr.ru\/post\/253665\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<a href=\"http:\/\/magento.com\/\">Magento<\/a> \u0431\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f e-commerce \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u0435\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0433\u043e\u0434\u044b, \u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0435\u0431\u044f \u044d\u043a\u043e-\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0445 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0441\u0430\u043c\u044b\u043c \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e \u0432\u043e\u0442 \u0447\u0435\u0433\u043e \u043c\u043d\u0435 <s>\u0441\u0438\u043b\u044c\u043d\u043e<\/s> <b>\u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e<\/b> \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0432 Magento \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u00ab\u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0441\u043d\u0430\u0440\u044f\u0434\u0443\u00bb, \u0442\u0430\u043a \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f <a href=\"http:\/\/logging.apache.org\/log4php\/\">Log4php<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f Magento \u2014 \u044d\u0442\u043e \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0430\u00bb \u0434\u043b\u044f Log4php. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0443\u00bb \u0432 \u043d\u0430\u0448\u0438\u0445 Magento-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-260120","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=260120"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/260120\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}