Flink on Yarn 的模式下,TaskManager的日志会存储到所在的 DataNode 上,当 Flink 任务发生异常,产生异常日志时,需要第一时间感知任务已经出现异常,避免影响业务。因此需要将Flink任务的日志实时收集起来,任务出现异常日志立刻报警,做的真正意义上的实时报警,,而不是等Flink任务掉线了再发出报警。收集任务日志的好处除了任务掉线方便我们通过日志定位问题,还可以支持日志实时报警,搜索,展示等功能的实现。
Flink-1.7.2/1.101、修改$Flink_HOME/conf/log4j.properties配置文件如下
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at



