Rearranged log handlers and added option to set log directory