Log function enhancements

(1) added log.openfile, log.writefile, log.closefile to write log
    to other log file.
(2) added a new event handler module chanlog to log channel message.
    added a new configuration variable CHANLOG