Magento has a built in support to write log messages. Sometimes we may Need to include our own log file for debugging our own modules. Because the size of default system.log file is too large and also it is difficult to find a specific entry in such a large file.
we can Create our own custom log file as follows
Navigate to Admin System > Configuration > Developer > Log Settings->Enabled. If the log setting is not enabled change it to enabled.
Now we can write our log entries in our custom modules as follows
Mage::log(“My Custom log Message entry”,null,”mylog.log”);
A new file with the name mylog.log will be created in var/log directory.
Open the file to see your custom log entry.