Added support for a logger and limiting the size of the log file