Closed sboett-dev closed 7 months ago
@sboett-dev thanks for the proposal. I think settings log levels for Ankaios during installation make sense but we should have the possibility to set them separately for server and agents. Maybe we can use environment variables which are then passed to the installation script like:
curl -sfL https://github.com/eclipse-ankaios/ankaios/releases/latest/download/install.sh | INSTALL_ANK_SERVER_RUST_LOG="debug" INSTALL_ANK_AGENT_RUST_LOG="warn" bash -
and then RUST_LOG
can be written to the server and agent's systemd unit file accordingly.
Description
Add the possibility to set the log level during the Ankaios installation. This could happen with parameters such as
-v
,-vv
and-vvv
or keywords likeinfo
,trace
,warn
,error
anddebug
.Ankaios is currently installed with the following command:
An Ankaios server systemd service file then looks like this:
The log level is set with the
RUST_LOG
environment variable and is per defaultRUST_LOG=info
.If the setting of environment variables might be necessary in the future of Ankaios, you could even let users define all kinds of variables environment variables (here for this enhancement just
RUST_LOG=debug
) during installation.Goals
Ankaios could be installed with (
-vvv
)or (
--loglevel debug
)or (
-e RUST_LOG=debug
)Final result
The systemd service file would look like this:
Summary
We implemented the solution suggested in https://github.com/eclipse-ankaios/ankaios/issues/163#issuecomment-1903967502. Here we introduced the new environment variables INSTALL_ANK_SERVER_RUST_LOG and INSTALL_ANK_AGENT_RUST_LOG used to individually configure the log level of ank-server and ank-agent during installation.
Tasks