Added logger factory and fixed middleware controller resolver