Why remove function when it's nicely written? It could simplify start condition when you start parse docker event.
Moreover it could help with debugging of error when long part of log will be saved in debug infos. 
But log rotate could be problem..