2

I want to programmaticly discover if the Magento exception log and system log are enabled. In what config file would I look? For what value?

Thank you

1 Answer 1

3

You can get if the log is enabled like this:

Mage::getStoreConfig('dev/log/active');

If you get 1 then the log is enabled.
As a side note...
if you want to force a log even if the logging is not enabled you can do this:

Mage::log('Message to log', null, 'file_to_log.log', true);

The 4th parameter true, makes magento not care if the log is enabled or not. It will log anyway.

3
  • But what is the config file that stores that information. I just want to grep it from the config file.
    – menders65
    Sep 19, 2014 at 7:10
  • @menders65. There is no config file. The config in magento is composed of various things. It might be a file but it might be a db entry. See here how the config is composed: magento.stackexchange.com/a/29839/146
    – Marius
    Sep 19, 2014 at 7:13
  • normally log appears in var/log/system.log or var/log/exception.log Sep 19, 2014 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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