create log file in magento?

Put any message on log file ..

Go to Admin > System > Configuration > Developer > Log Settings

Change the value to YES for Enabled field.

Mage::log(“Write you’re message here. those you want to write on log file”);

This message will be display on log file(root folder/var/log/system.log)

if you want to create you’re own log file …

Mage::log(“Write you’re message here. those you want to write on log file or any variable”, null, ‘filename.log’, true);

Here 4th param means force logging

You’re custom file will be create on var/log/filename.log

NOTE:- For Log file 2 things required..

1) Developer mode must be set to true

2) Logging must be activated in the system configuration.

you can find log method on app/Mage.php file in line Number 784.

public static function log($message, $level = null, $file = ”, $forceLog = false){}

One thought on “create log file in magento?

  1. Pingback: cheap ray bans

Leave a Reply