I've been following the tutorials provide by Kaa (thanks!) and the documentation. I developed a kaa-client in java that works perfectly and it is already deployed. However, it is really, really verbose. It was good for debugging and stuff, but now it is creating a huge log. Is there a way to avoid INFO messages for specific classes and packages -- like the "org.kaaproject.kaa.client.channel.impl.* "
To configure specific levels for kaa logs you should configure the appropriate log-schema file. By default it is logback.xml. For example, for Java sources of Data Collection Demo the log schema is: JDataCollectionDemo/res/logback.xml To avoid INFO messages for specific classes or packages just add the appropriate line with ERROR level to the schema, e.g.:
<logger name="org.kaaproject.kaa.client.channel.impl" level="ERROR"/>
In this case full log schema will be:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2014-2016 CyberVision, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="fileLogAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>kaa-desktop-client.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="fileLogAppender"/>
</root>
<logger name="org.kaaproject.kaa" level="ERROR"/>
<logger name="org.kaaproject.kaa.client.logging.memory" level="INFO"/>
<logger name="org.kaaproject.kaa.demo.datacollection" level="INFO"/>
<logger name="org.kaaproject.kaa.client.channel.impl" level="ERROR"/>
</configuration>
It is also possible to change log levels for the logs in Sandbox: For /var/log/kaa/kaa-node.log and /var/log/kaa/kaa-sandbox.log the appropriate log schema files are: /usr/lib/kaa-node/conf/logback.xml and /usr/lib/kaa-sandbox/conf/logback.xml After Sandbox log schema configuring the appropriate services should be restarted:
sudo service kaa-node restart
sudo service kaa-sandbox restart