Adding a log server and output channels to a solution
The LogrrServer
program sends messages to one or more output channels. You can write log messages to files by using the output channel named FsOutputChannel
.
Adding and configuring logging server
The command for creating and configuring the log server create_logrr_server()
may contain the following parameters:
LOG_LEVEL
- Sets the specified log level. The available values for
LOG_LEVEL
areCRITICAL
,ERROR
,WARNING
,INFO
,DEBUG
andTRACE
. By default, the log server handles messages with the Info level. CONFIG_PATH
- Specifies the path to the configuration file of the log server.
RECV_CORE_LOGS
- Enables collection of kernel logs.
WRITE_TO_CORE
- Enables forwarding of logs to the kernel. Does not exclude forwarding of logs to the log server or further to the output channel. Required for printing logs to UART.
OUTPUT_CHANNELS
- Connects one or more specified output channels to the server.
DENY_DYNAMIC_CONN_TYPES
- Enables rejection of dynamic connections to the log server.
DENY_STATIC_CONN_TYPES
- Enables rejection of static connections to the log server.
To add the LogrrServer
program to a solution:
Edit the root file containing the CMake commands for building the solution or the file containing the CMake commands for building the Einit
initializing program:
CMakeLists.txt
The PACK_DEPS
option must be included when calling the build_kos_qemu_image()
or build_kos_hw_image()
command to include an automatic build of the libraries in the disk image.
Adding and configuring output channels
The command for creating and configuring the channel for printing logs to files create_logrr_fs_output_channel()
may contain the following parameters:
CONFIG_PATH
- Specifies the path to the configuration file of the output channel.
SERVER_TARGET
- Specifies the log server to which the created output channel must connect.
APP_LOG_DIR
- Specifies the directory for storing log files for programs. Required parameter.
SYS_LOG_DIR
- Specifies the directory for storing system log files. If this parameter is not defined, system log files are not saved.
To add the FsOutputChannel
to a solution:
Edit the root file containing the CMake commands for building the solution or the file containing the CMake commands for building the Einit
initializing program:
CMakeLists.txt
Creating IPC channels and allowing interaction between programs
The build system automatically creates IPC channels required for the log system to work, and generates a security policy description that allows interaction between processes.
To create a static connection to the log server, you can use the CMake command connect_to_logrr_server (ENTITIES <names_of_programs_to_connect>)
.