-
Notifications
You must be signed in to change notification settings - Fork 8.1k
新增 csp.sentinel.log.level 启动配置项,可设置为OFF,进行关闭日志 #2514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
import com.alibaba.csp.sentinel.concurrent.NamedThreadFactory; | ||
import com.alibaba.csp.sentinel.config.SentinelConfig; | ||
import com.alibaba.csp.sentinel.log.LogBase; | ||
import com.alibaba.csp.sentinel.log.RecordLog; | ||
import com.alibaba.csp.sentinel.node.metric.MetricTimerListener; | ||
import com.alibaba.csp.sentinel.property.DynamicSentinelProperty; | ||
|
@@ -32,6 +33,7 @@ | |
import java.util.concurrent.Executors; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.logging.Level; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please remove the unused import? |
||
|
||
/** | ||
* <p> | ||
|
@@ -80,7 +82,9 @@ private static void startMetricTimerListener() { | |
SentinelConfig.METRIC_FLUSH_INTERVAL); | ||
return; | ||
} | ||
SCHEDULER.scheduleAtFixedRate(new MetricTimerListener(), 0, flushInterval, TimeUnit.SECONDS); | ||
if (!LogBase.getLogLevel().equals(Level.OFF)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. metric的写日志逻辑实际已经通过 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好的,明白了,我调整一下 |
||
SCHEDULER.scheduleAtFixedRate(new MetricTimerListener(), 0, flushInterval, TimeUnit.SECONDS); | ||
} | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the logLevel is invalid?