To implement a custom log appender, you need to complete the following steps.
We recommend that you use one of the existing log appender implementations as a reference.
A log appender configuration schema is an Avro compatible schema that defines configuration parameters of the log appender. The following parameters in the schema affect Kaa Admin UI layout.
Once you have prepared your schema, you can compile it using the following command.
java -jar /path/to/avro-tools-1.7.7.jar compile schema <schema file> <destination>
Please refer to Compiling the schema for more information. It is also possible to integrate the schema compilation with avro-maven-plugin.
All Kaa log appenders extend generic abstract class org.kaaproject.kaa.server.common.log.shared.appender.AbstractLogAppender<T>. The following code example illustrates the implementation of a custom log appender.
A log appender descriptior provides Kaa with the information on how to locate and configure your custom log appender. To implement a log appender descriptor, you need to implement the AppenderConfig interface at first.
It is also important to provide your class with the @KaaPluginConfig annotiation. This annotation helps Kaa Admin UI to find all available log appenders in the class path.
A log appender descriptor is optional if you are going to configure your log appenders using only REST API.
The following code example illustrates the implementation of a log appender descriptor.
To provision your log appender, do the following: