Commit f4034661b8560ce8f2cfeb642cbe74968ad20c49

Authored by Andrew Shvayka
1 parent a2dd90a4

Logging improvements

1 /** 1 /**
2 * Copyright © 2016-2018 The Thingsboard Authors 2 * Copyright © 2016-2018 The Thingsboard Authors
3 - * 3 + * <p>
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 - *  
8 - * http://www.apache.org/licenses/LICENSE-2.0  
9 - * 7 + * <p>
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + * <p>
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,6 +37,7 @@ import org.thingsboard.server.common.data.kv.ReadTsKvQuery; @@ -37,6 +37,7 @@ import org.thingsboard.server.common.data.kv.ReadTsKvQuery;
37 import org.thingsboard.server.common.data.kv.TsKvEntry; 37 import org.thingsboard.server.common.data.kv.TsKvEntry;
38 import org.thingsboard.server.dao.attributes.AttributesService; 38 import org.thingsboard.server.dao.attributes.AttributesService;
39 import org.thingsboard.server.dao.timeseries.TimeseriesService; 39 import org.thingsboard.server.dao.timeseries.TimeseriesService;
  40 +import org.thingsboard.server.dao.util.TenantRateLimitException;
40 import org.thingsboard.server.service.security.AccessValidator; 41 import org.thingsboard.server.service.security.AccessValidator;
41 import org.thingsboard.server.service.security.ValidationCallback; 42 import org.thingsboard.server.service.security.ValidationCallback;
42 import org.thingsboard.server.service.security.ValidationResult; 43 import org.thingsboard.server.service.security.ValidationResult;
@@ -403,7 +404,11 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi @@ -403,7 +404,11 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi
403 404
404 @Override 405 @Override
405 public void onFailure(Throwable e) { 406 public void onFailure(Throwable e) {
406 - log.error(FAILED_TO_FETCH_DATA, e); 407 + if (e instanceof TenantRateLimitException || e.getCause() instanceof TenantRateLimitException) {
  408 + log.trace("[{}] Tenant rate limit detected for subscription: [{}]:{}", sessionRef.getSecurityCtx().getTenantId(), entityId, cmd);
  409 + } else {
  410 + log.info(FAILED_TO_FETCH_DATA, e);
  411 + }
407 SubscriptionUpdate update = new SubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.INTERNAL_ERROR, 412 SubscriptionUpdate update = new SubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.INTERNAL_ERROR,
408 FAILED_TO_FETCH_DATA); 413 FAILED_TO_FETCH_DATA);
409 sendWsMsg(sessionRef, update); 414 sendWsMsg(sessionRef, update);
@@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
41 </appender> 41 </appender>
42 42
43 <logger name="org.thingsboard.server" level="INFO" /> 43 <logger name="org.thingsboard.server" level="INFO" />
44 - <logger name="akka" level="INFO" /> 44 + <logger name="com.google.common.util.concurrent.AggregateFuture" level="OFF" />
45 45
46 <root level="INFO"> 46 <root level="INFO">
47 <appender-ref ref="fileLogAppender"/> 47 <appender-ref ref="fileLogAppender"/>
48 <appender-ref ref="STDOUT"/> 48 <appender-ref ref="STDOUT"/>
49 </root> 49 </root>
50 50
51 -</configuration>  
  51 +</configuration>