logging feature, new output format, fix trailing slash problem