xiaows08 commented on PR #22138:
URL: https://github.com/apache/flink/pull/22138#issuecomment-2401639724

   @huwh 感谢回复,环境如下:
   flink-kubernetes-operator 1.9.0
   flink: flink:1.18.1-scala_2.12
   log4j-console.properties 是镜像默认的
   
   ```yaml
   apiVersion: flink.apache.org/v1beta1
   kind: FlinkDeployment
   metadata:
     name: basic
   spec:
     image: flink:1.18.1-scala_2.12
     flinkVersion: v1_18
     ingress:
       className: "nginx"
       template: "{{name}}.fo.xyuqing.com" # 引号必须有
     podTemplate:
       spec:
         containers:
           - name: flink-main-container
             ports:
               - name: metrics
                 containerPort: 9249
                 protocol: TCP
             env:
               - name: TZ  # 设置容器运行的时区
                 value: Asia/Shanghai
     flinkConfiguration:
       taskmanager.numberOfTaskSlots: "2"
       env.stdout-err.redirect-to-file: "true"
       metrics.reporter.prom.factory.class: 
org.apache.flink.metrics.prometheus.PrometheusReporterFactory
     serviceAccount: flink
     jobManager:
       resource:
         cpu: 1
         memory: 2G
     taskManager:
       resource:
         cpu: 1
         memory: 2G
     job:
       jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
       parallelism: 2
       upgradeMode: stateless
   
   ```
   
![image](https://github.com/user-attachments/assets/20975efa-0e45-4fc3-94c9-d8301b350d33)
   
   
![image](https://github.com/user-attachments/assets/ce2bcf7b-94dc-4df2-aa3f-a0d6b484c2d0)
   
   我的意思是虽然 `kubectl logs -f pods/xxx ` 不会打印log4j2的日志内容,但是对应的 `xxx.out` 文件还是包含有 
log4j2  `xxx.log`的日志内容,最终导致 代码中的log4j的输出会存在两份,也就会占两份存储,而且`xxx.out` 
文件不能做到按大小或时间自动切分


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to