I’m trying to customize my Magento’s log directory, by setting log_dir in the Mage::app() $options, but it’s still logging to var/log/file.log.
Note: I couldn’t find this information very readily on SO or the web in general, so I felt it needed to be SO’d.
So it turns out that (as of 1.6.2.0 at least), Magento doesn’t actually use the
Mage::getBaseDir('log')within it’s log() method – weak sauce, right?It uses
Mage::getBaseDir('var')and appendslogand then the file name that you pass in.If you want to customize the directory more than that, you have to get your hands a little dirty. For example, in our case, we wanted the log directory to be:
So here’s how you bust it. Drop this in your config.xml to tell Magento about your new logging class:
Then, create a model:
Then, proceed to do what you needs to do. In my case, it went something like this: