server: implement access log rotation with re-open via command socket

re-use the future we already have for task log rotation to trigger
it.

Move the FileLogger in ApiConfig into an Arc, so that we can actually
update it and REST using the new one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-11-02 19:21:58 +01:00
parent 04b053d87e
commit fe4cc5b1a1
4 changed files with 52 additions and 8 deletions

View File

@ -54,7 +54,7 @@ async fn run() -> Result<(), Error> {
let mut commando_sock = server::CommandoSocket::new(server::our_ctrl_sock());
config.enable_file_log(buildcfg::API_ACCESS_LOG_FN)?;
config.enable_file_log(buildcfg::API_ACCESS_LOG_FN, &mut commando_sock)?;
let rest_server = RestServer::new(config);