0

My mage log is not working.

I am using magento 1.9. I am also using wamp server so permission issues should not arise for the var folder.

I first went to System > Configuration > Developer and switch on logging

I then placed the following Mage log at this location:

app\Mage.php

 public static function run($code = '', $type = 'store', $options = array())
 {
    Mage::log('work');
    Mage::log('My log entry', null, 'mylogfile.log');
 }

I then refreshed my home page but nothing came up with the log files.

Is there something that I am missing?

I checked the permssions folder for my VAR and its :

drwxr-xr-x 1 theSeeker  197609   0 Sep 26 08:49 log/
  • have you checked permission of var directory ? – Mukesh Prajapati Sep 26 '18 at 9:37
  • i am using wamp. so permissions should not really be an issue – theSeeker Sep 26 '18 at 9:44
  • please share the screenshot where you enable log in admin – Jigs Parmar Dec 19 '18 at 8:50
0

All Mage:: functions work after it has verified it's all required functions are working fine.

It first sets the app root path using self::setRoot(); function.

Then checks for whether Magento is installed or not. Then sets the application config model.

Then it calls the following to initiate the rendering of the store view:

self::$_app->run(array(
     'scope_code' => $code,
     'scope_type' => $type,
     'options'    => $options,
));

After this complete process, the Mage::log() function starts working.

In your question, you have removed all default code from the function run($code = '', $type = 'store', $options = array()) function.

Try Mage::log() after just after:

self::$_app->run(array(
     'scope_code' => $code,
     'scope_type' => $type,
     'options'    => $options,
));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.