Throttling logs

更新时间:
复制 MD 格式

Service throttling logs are stored in ${user.name}/logs/guardian and include default logs, runtime error logs, and throttling statistics logs.

Default logs

The default service throttling logs are stored in guardian/guardian-default.log. These logs record pushed throttling configurations. The log content does not have a fixed format. The following is a log sample:

2016-12-1219:49:09,610 INFO  RegistringGuardianCodeWrapperInterceptor
2016-12-1219:49:10,757 WARN  receive message with key=[guardianConfig]and value=[{"@type":"com.alipay.guardian.client.drm.GuardianConfig","engineConfigs":{"@type":"java.util.HashMap","LIMIT":{"@type":"com.alipay.guardian.client.engine.limit.LimitEngineConfig","actionConfigMap":{"@type":"java.util.HashMap",880:{"@type":"com.alipay.guardian.client.engine.limit.LimitActionConfig","actionType":"LIMIT_EXCEPTION","id":880,"responseContent":"Throttling Config-Interface-Multi-Calculation Model-Throw Exception"}},"globalConfig":{"enable":true,"runMode":"CONTROL"},"resourceConfigList":[{"baseName":"com.alipay.guardiantestsofalite.facade.GuardianTestTrServiceFacade.testLimitBasicCondition","id":379,"resourceType":"METHOD","ruleIds":[880]}],"ruleConfigMap":{"@type":"java.util.HashMap",880:{"@type":"com.alipay.guardian.client.engine.limit.LimitRuleConfig","actionId":880,"calculationConfigs":[{"calculationType":"INVOKE_BY_TIME","maxAllow":10,"period":5000},{"calculationType":"INVOKE_BY_TIME","maxAllow":10,"period":5000},{"calculationKey":"[0].booleanValue","calculationType":"INVOKE_BY_TIME_CATEGORY","period":5000,"tairCompareKey":"true>5,false>6"}],"enable":true,"extParamConfigs":[],"id":880,"limitType":"GENERIC_LIMIT","paramConfigs":[{"checkMode":"BYVALUE","compare":"EQUALS","key":"[0].stringValue","value":"testStrMutilBasicParams"},{"checkMode":"BYVALUE","compare":"EQUALS","key":"[1].stringValue","value":"MultileCalculations"}],"paramRelation":"AND","ruleBizId":"[tr]Throttling Config-Interface-Multiple Basic Parameters-Multiple Calculation Models","runMode":"CONTROL","trafficType":"all"}}},"FUSE":{"@type":"com.alipay.guardian.client.engine.fuse.FuseEngineConfig","actionConfigMap":{"@type":"java.util.HashMap"},"ruleConfigMap":{"@type":"java.util.HashMap"}}},"version":1}]
2016-12-1219:49:10,759 WARN  after update with key=[guardianConfig]
2016-12-1219:49:11,195 INFO  GuardianConfig version=1
2016-12-1219:49:11,197 WARN  rebuild Rules,GuardianFactory:class com.alipay.guardian.client.limit.LimitGuardianFactory

Runtime error logs

Runtime error logs for service throttling are stored in guardian/guardian-error.log. These logs record error messages and do not have a fixed format. Pay special attention to the error stack information.

Throttling statistics logs

Throttling statistics logs are stored in guardian/guardian-limit-stat.log. These logs have a fixed format. The following is a log sample:

2016-11-2100:00:02,001 INFO  MONITOR,43,test,1000,2016-11-21T00:00:01,2016-11-21T00:00:02,INVOKE_BY_TIME,10,40,10,30

The following describes the example values:

Sample value

Description

2016-11-2100:00:02

The time the log was printed.

001

Request duration, in ms.

INFO

Log level. Valid values are INFO, DEBUG, ERROR, and WARN.

Default: INFO.

MONITOR

Throttling mode. Valid values:

  • MONITOR: Indicates that the current throttling mode is monitoring mode.

  • CONTROL: Indicates that the current throttling mode is Block Mode.

43

Throttling rule ID.

test

Throttling rule name.

1000

Statistics collection interval.

2016-11-21T00:00:01

Start time of the statistics collection.

2016-11-21T00:00:02

End time of the statistics collection.

INVOKE_BY_TIME

Statistics type.

10

Throttling rule threshold.

40

Total number of requests within the throttling period.

10

Number of allowed requests within the throttling period.

30

Number of throttled requests within the current throttling period.