logging - What is the meaning of null in Mage log (magento)? -


in order create magento log, 1 write like

 mage::log('server side validation kicked in year '.$currentyeartype); 

but if add log in sepearate file ,

mage::log('server side validation kicked in year ' ,null,'serversidevalidation.log'); 

please correct me if wrong.

if so, use of null in middle? also, file need exist before hand or think created system when needed. right? also, include timestamp?

go to app/mage.php

line 785

public static function log($message, $level = null, $file = '', $forcelog = false)  

you can see second paramete level

$level  = is_null($level) ? zend_log::debug : $level; 

lib\zend\log.php

const emerg   = 0;  // emergency: system unusable const alert   = 1;  // alert: action must taken const crit    = 2;  // critical: critical conditions const err     = 3;  // error: error conditions const warn    = 4;  // warning: warning conditions const notice  = 5;  // notice: normal significant condition const info    = 6;  // informational: informational messages const debug   = 7;  // debug: debug messages 

if code mage::log('test', 1);

then output in log file this

2014-05-17t12:21:51+00:00 alert (1): test 

yes, file automatically created system when call

system include timestamp when call

refer code in app/mage.php in line 825

 $format = '%timestamp% %priorityname% (%priority%): %message%' . php_eol;  $formatter = new zend_log_formatter_simple($format); 

cheers


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -