mIRC\'s build in logging is better, as saurabh said.
Its better if we log in our mirc.exe itself :0
alt+o
IRC >> logging >> automaticallt log (choose both)
Fare and square easy
Try following his instructions, it\'s much more versatile than your logging script.