logtail-rust

Crates.iologtail-rust
lib.rslogtail-rust
version0.1.1
sourcesrc
created_at2024-07-01 17:27:45.326271
updated_at2024-07-01 17:34:21.244179
descriptionLogtail http client wrapper
homepage
repositoryhttps://github.com/LuisEvilCo/logtail-rust
max_upload_size
id1288899
size13,935
Luis Tinajero Muñozcano (LuisEvilCo)

documentation

README

Logtail Rust

Logtail rust is an http wrapper for sending logs to betterstack

Requires the following variables :

Syntax Description
ENVIRONMENT Can be "local" , "qa", "preprod" or "prod"
LOGS_SOURCE_TOKEN Docs
// recommended way to instance
let logger = Logger::new(env!("CARGO_PKG_VERSION").to_string(), true);

// it also has a default impl
let _default_logger = Logger::default();

// setup your log message into the LogSchema struct
let bind_address = "192.168.0.1:8000";
let start_message = format!("🚀 Server started successfully {}", &bind_address);

let log = logtail_rust::LogSchema {
    message: start_message,
    context: format!("{} - {}", file!(), line!()),
};

// send your log
logger.info(log).await;
Commit count: 19

cargo fmt