Building our logging actor
Before we build our actor, we are need the following crates in our glue
workspace:
// glue/Cargo.toml
. . .
[dependencies]
. . .
serde_json = { version = "1.0.120", optional = true }
tokio = { version = "1.38.1", optional = true}
reqwest = { version = "0.12.5", optional = true }
chrono = { version = "0.4.38", optional = true }
once_cell = { version = "1.19.0", optional = true }
[features]
# default = ["elastic-logger", "actix"]
actix = ["actix-web"]
elastic-logger = [
"serde_json", "tokio", "reqwest", "chrono", "once_cell"
]
Here we can see that our elastic-logger
feature utilizes all the new dependencies, but we do not need them if we are not performing remote logging as we will not have an actor to support.
We then define our elastic logger actor model with the code below:
// glue/src/logger/mod.rs
pub mod network_wrappers...