Fixed logging so that it would work with YARN log aggregation. Current solution is a bad hack, and needs to be improved