YARN-2569. Added the log handling APIs for the long running services. Contributed by Xuan Gong.