Home » Magento

Magento: Writing Custom Log Message

27 November 2009 Share/Bookmark

To be able to write your custom log message, you have to enable logging from Magento Admin.

To enable logging, go to

Admin Panel -> System -> Configuration -> Developer -> Log Settings -> Enabled = Yes

Then in your code, you can write the following:

Mage::log(“Your Log Message”);

You can check it at var/log/system.log or, var/log/exception.log

If you want to create your own log file for your log message, then you can do it this way:

Mage::log(“Your Log Message”, null, “your_log_file.log”);

Your log file will be created at var/log folder with your log message.

From Mukesh Chapagain's Blog, post Magento: Writing Custom Log Message

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed
  • http://www.edocr.com/doc/32374/magento-custom-module-india Gerald Burton

    I like your post very much! It is so unique and creative!