ApacheFlink+SpringBoot-SpringBoot应用程序启动的相关日志未打印在Flink1.12的文件中

d7v8vwbk  于 2021-07-14  发布在  Java
关注(0)|答案(0)|浏览(273)

我在flink1.9中获得bean创建日志和spring boot启动日志,其中包含flink1.9_log4j-cli.properties(附件)

  1. ################################################################################
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ################################################################################
  18. log4j.rootLogger=INFO, file
  19. # Log all infos in the given file
  20. log4j.appender.file=org.apache.log4j.FileAppender
  21. log4j.appender.file.file=${log.file}
  22. log4j.appender.file.append=true
  23. log4j.appender.file.layout=org.apache.log4j.PatternLayout
  24. log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n
  25. # Log output from org.apache.flink.yarn to the console. This is used by the
  26. # CliFrontend class when using a per-job YARN cluster.
  27. log4j.logger.org.apache.flink.yarn=INFO, console
  28. log4j.logger.org.apache.flink.yarn.cli.FlinkYarnSessionCli=INFO, console
  29. log4j.logger.org.apache.hadoop=INFO, console
  30. log4j.appender.console=org.apache.log4j.ConsoleAppender
  31. log4j.appender.console.layout=org.apache.log4j.PatternLayout
  32. log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n
  33. # suppress the warning that hadoop native libraries are not loaded (irrelevant for the client)
  34. log4j.logger.org.apache.hadoop.util.NativeCodeLoader=OFF
  35. # suppress the irrelevant (wrong) warnings from the netty channel handler
  36. log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR

但是在更新到flink 1.12.1之后,这些日志不会被打印在附加flink1.12_log4j-cli.properties的日志文件中

  1. ################################################################################
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ################################################################################
  18. rootLogger.level = INFO
  19. rootLogger.appenderRef.file.ref = FileAppender
  20. # Log all infos in the given file
  21. appender.file.name = FileAppender
  22. appender.file.type = FILE
  23. appender.file.append = true
  24. appender.file.fileName = ${sys:log.file}
  25. appender.file.layout.type = PatternLayout
  26. appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n
  27. logger.flink.name = org.apache.flink
  28. logger.flink.level = INFO
  29. # Log output from org.apache.flink.yarn to the console. This is used by the
  30. # CliFrontend class when using a per-job YARN cluster.
  31. logger.yarn.name = org.apache.flink.yarn
  32. logger.yarn.level = INFO
  33. logger.yarn.appenderRef.console.ref = ConsoleAppender
  34. logger.yarncli.name = org.apache.flink.yarn.cli.FlinkYarnSessionCli
  35. logger.yarncli.level = INFO
  36. logger.yarncli.appenderRef.console.ref = ConsoleAppender
  37. logger.hadoop.name = org.apache.hadoop
  38. logger.hadoop.level = INFO
  39. logger.hadoop.appenderRef.console.ref = ConsoleAppender
  40. # Log output from org.apache.flink.kubernetes to the console.
  41. logger.kubernetes.name = org.apache.flink.kubernetes
  42. logger.kubernetes.level = INFO
  43. logger.kubernetes.appenderRef.console.ref = ConsoleAppender
  44. appender.console.name = ConsoleAppender
  45. appender.console.type = CONSOLE
  46. appender.console.layout.type = PatternLayout
  47. appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n
  48. # suppress the warning that hadoop native libraries are not loaded (irrelevant for the client)
  49. logger.hadoopnative.name = org.apache.hadoop.util.NativeCodeLoader
  50. logger.hadoopnative.level = OFF
  51. # Suppress the irrelevant (wrong) warnings from the Netty channel handler
  52. logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
  53. logger.netty.level = ERROR

我无法获取此登录文件是否需要进行一些设置更改才能启用此功能?获得类似的日志记录需要什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题