Fix formatting problem for SEARCH and VIEW
Fix logic bug when setting up logger