added inventory for immutable core logging files

This commit is contained in:
Ara Sadoyan
2026-09-22 18:48:42 +02:00
parent 639365c43b
commit 54ac35a4c9
6 changed files with 64 additions and 8 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
use crate::logging::core::StructuredSystemLog;
use crate::logging::types::WriteLog;
use crate::logging::types::{LogBackendPlugin, WriteLog};
use std::env;
use std::sync::LazyLock;
@@ -28,7 +28,15 @@ pub struct ElasticSearch;
impl WriteLog for ElasticSearch {
fn writelog(&self, msg: &StructuredSystemLog) {
if let Ok(jsonmsg) = serde_json::to_string(&msg) {
println!("Connecting to {} - {}:{} => {}", ELASTIC.hosts, ELASTIC.user, ELASTIC.password, jsonmsg);
// ElasticSearch logic is not yet implemented.
println!("{} - {}:{} => {}", ELASTIC.hosts, ELASTIC.user, ELASTIC.password, jsonmsg);
}
}
}
inventory::submit! {
LogBackendPlugin {
name: "elasticsearch",
factory: || Box::new(ElasticSearch),
}
}