The Log Command sends log messages to the OSGi Log Service and to the system output.
Required Bundles
To be able to create and manage automation components, you need the following bundles from the bundles folder active in the OSGi framework:
Overview
The Log Command logs a predefined message. The message can be forwarded to the Log Service. It can also be directly printed in the system output. The message can also contain the properties of the automation rule that the command is part of.
Managing Log Commands
Via Java API
After creating an instance of the command as described in Managing Commands you can configure it by using the following methods:
After configuring your command, call the save method. The Command Provider will save it in ConfigTree.
Via ConfigTree
All commands are stored in Config Tree, which allows you to import/export or add/edit commands by modifying XML files. Refer to Configuring HAM via Config Tree.
The following snippet contains a log command that prints a message Test in the system console.
<config name="LogCommand">
<config name="LogCommand1">
<property key="message" value="Test" type="string"/>
<property key="print_on_console" value="true" type="boolean"/>
<property key="print_on_log" value="false" type="boolean"/>
<property key="log_print_properties" value="false" type="boolean"/>
<property key="log_level" value="3" type="int"/>
</config>
</config>