To be able to write your custom log message, you have to enable logging from Magento Admin.
To enable logging, go to
Magento 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.
Hope it helps. Thanks.