Commit 766a56fa9e2f23edada830635926e8107b0eadfb
1 parent
80d7e3d6
Reduced logging using configuration parameter
Showing
5 changed files
with
13 additions
and
5 deletions
... | ... | @@ -2,6 +2,7 @@ before_install: |
2 | 2 | - sudo rm -f /etc/mavenrc |
3 | 3 | - export M2_HOME=/usr/local/maven |
4 | 4 | - export MAVEN_OPTS="-Dmaven.repo.local=$HOME/.m2/repository -Xms1024m -Xmx3072m" |
5 | + - export HTTP_LOG_CONTROLLER_ERROR_STACK_TRACE=false | |
5 | 6 | jdk: |
6 | 7 | - oraclejdk8 |
7 | 8 | language: java | ... | ... |
... | ... | @@ -131,7 +131,8 @@ public class AppActor extends RuleChainManagerActor { |
131 | 131 | |
132 | 132 | private void onServiceToRuleEngineMsg(ServiceToRuleEngineMsg msg) { |
133 | 133 | if (SYSTEM_TENANT.equals(msg.getTenantId())) { |
134 | - log.warn("[{}] Invalid service to rule engine msg called. System messages are not supported yet: {}", SYSTEM_TENANT, msg); | |
134 | +// this may be a notification about system entities created. | |
135 | +// log.warn("[{}] Invalid service to rule engine msg called. System messages are not supported yet: {}", SYSTEM_TENANT, msg); | |
135 | 136 | } else { |
136 | 137 | getOrCreateTenantActor(msg.getTenantId()).tell(msg, self()); |
137 | 138 | } |
... | ... | @@ -189,8 +190,6 @@ public class AppActor extends RuleChainManagerActor { |
189 | 190 | boolean removed = tenantActors.inverse().remove(terminated) != null; |
190 | 191 | if (removed) { |
191 | 192 | log.debug("[{}] Removed actor:", terminated); |
192 | - } else { | |
193 | - log.warn("[{}] Removed actor was not found in the tenant map!"); | |
194 | 193 | } |
195 | 194 | } else { |
196 | 195 | throw new IllegalStateException("Remote actors are not supported!"); | ... | ... |
... | ... | @@ -19,9 +19,11 @@ import com.datastax.driver.core.utils.UUIDs; |
19 | 19 | import com.fasterxml.jackson.databind.ObjectMapper; |
20 | 20 | import com.fasterxml.jackson.databind.node.ArrayNode; |
21 | 21 | import com.fasterxml.jackson.databind.node.ObjectNode; |
22 | +import lombok.Getter; | |
22 | 23 | import lombok.extern.slf4j.Slf4j; |
23 | 24 | import org.apache.commons.lang3.StringUtils; |
24 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
26 | +import org.springframework.beans.factory.annotation.Value; | |
25 | 27 | import org.springframework.security.core.Authentication; |
26 | 28 | import org.springframework.security.core.context.SecurityContextHolder; |
27 | 29 | import org.springframework.web.bind.annotation.ExceptionHandler; |
... | ... | @@ -152,6 +154,11 @@ public abstract class BaseController { |
152 | 154 | @Autowired |
153 | 155 | protected AttributesService attributesService; |
154 | 156 | |
157 | + @Value("${server.log_controller_error_stack_trace}") | |
158 | + @Getter | |
159 | + private boolean logControllerErrorStackTrace; | |
160 | + | |
161 | + | |
155 | 162 | @ExceptionHandler(ThingsboardException.class) |
156 | 163 | public void handleThingsboardException(ThingsboardException ex, HttpServletResponse response) { |
157 | 164 | errorResponseHandler.handle(ex, response); |
... | ... | @@ -162,7 +169,7 @@ public abstract class BaseController { |
162 | 169 | } |
163 | 170 | |
164 | 171 | private ThingsboardException handleException(Exception exception, boolean logException) { |
165 | - if (logException) { | |
172 | + if (logException && logControllerErrorStackTrace) { | |
166 | 173 | log.error("Error [{}]", exception.getMessage(), exception); |
167 | 174 | } |
168 | 175 | ... | ... |
... | ... | @@ -31,6 +31,7 @@ server: |
31 | 31 | key-store-type: "${SSL_KEY_STORE_TYPE:PKCS12}" |
32 | 32 | # Alias that identifies the key in the key store |
33 | 33 | key-alias: "${SSL_KEY_ALIAS:tomcat}" |
34 | + log_controller_error_stack_trace: "${HTTP_LOG_CONTROLLER_ERROR_STACK_TRACE:true}" | |
34 | 35 | |
35 | 36 | # Zookeeper connection parameters. Used for service discovery. |
36 | 37 | zk: | ... | ... |
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | |
10 | 10 | <logger name="org.thingsboard.server" level="WARN"/> |
11 | 11 | <logger name="org.springframework" level="WARN"/> |
12 | - <logger name="org.springframework.boot.test" level="DEBUG"/> | |
12 | + <logger name="org.springframework.boot.test" level="WARN"/> | |
13 | 13 | <logger name="org.apache.cassandra" level="WARN"/> |
14 | 14 | <logger name="org.cassandraunit" level="INFO"/> |
15 | 15 | ... | ... |