Added --logfile and --loglevel options
Revamped logging management