alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.31k stars 8k forks source link

csp.sentinel.log.output.type=console cannot disable metric log: [MetricTimerListener] Write metric error #3203

Open qq378488249 opened 1 year ago

qq378488249 commented 1 year ago

Issue Description

因为一些特殊的原因,需要将日志打印到控制台,不能直接输出到日志里,所以我在启动参数里加上了【-Dcsp.sentinel.log.output.type=console】,但是目前有以下报错,请帮忙看一下,非常感谢各位大佬 2023-08-16 06:49:00.730 WARNING [MetricTimerListener] Write metric error java.lang.NullPointerException at com.alibaba.csp.sentinel.node.metric.MetricWriter.nextFileNameOfDay(MetricWriter.java:197) at com.alibaba.csp.sentinel.node.metric.MetricWriter.write(MetricWriter.java:135) at com.alibaba.csp.sentinel.node.metric.MetricTimerListener.run(MetricTimerListener.java:51) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Type: bug report

Describe what happened

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

qq378488249 commented 1 year ago

补充一下,程序是运行在docker里的,并且设置了磁盘只读权限,所以没法写入日志,只能把日志放控制台

sczyh30 commented 1 year ago

Sentinel metric log 目前暂不支持通过该参数控制输出到终端,可以通过将 csp.sentinel.metric.flush.interval 配置为0来关闭输出。请参考 https://github.com/alibaba/Sentinel/wiki/启动配置项


You may disable Sentinel metric log by setting csp.sentinel.metric.flush.interval to 0.

qq378488249 commented 1 year ago

好的哦,非常感谢大佬,我先试一下 

何成龙 @.***

 

------------------ 原始邮件 ------------------ 发件人: "Eric @.>; 发送时间: 2023年8月16日(星期三) 下午3:42 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [alibaba/Sentinel] [BUG] [MetricTimerListener] Write metric error (Issue #3203)

Sentinel metric log 目前暂不支持通过该参数控制输出到终端,可以通过将csp.sentinel.metric.flush.interval 配置为0来关闭输出。请参考 https://github.com/alibaba/Sentinel/wiki/启动配置项

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

qq378488249 commented 1 year ago

大佬好,是否方便提供个微信?或者说加我微信也行(GG378488249),想请教一下Sentinel遇到的其他问题

何成龙 @.***

 

------------------ 原始邮件 ------------------ 发件人: "alibaba/Sentinel" @.>; 发送时间: 2023年8月16日(星期三) 下午3:42 @.>; @.**@.>; 主题: Re: [alibaba/Sentinel] [BUG] [MetricTimerListener] Write metric error (Issue #3203)

Sentinel metric log 目前暂不支持通过该参数控制输出到终端,可以通过将csp.sentinel.metric.flush.interval 配置为0来关闭输出。请参考 https://github.com/alibaba/Sentinel/wiki/启动配置项

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sczyh30 commented 1 year ago

可以继续提 issue 哈,社区同学都可以帮忙看一下的

qq378488249 commented 1 year ago

大佬,还是磁盘写不进,这次模块是这个,请帮我看下 [EagleEye][INFO] Log file rolled over by outside: ?/logs/eagleeye/eagleeye-self.log, force reload [EagleEye][ERROR] Fail to mkdirs: /app/?/logs/eagleeye