improvement for logger, start directory middleware