2 releases

0.1.1 Jul 1, 2024
0.1.0 Jul 1, 2024

#351 in HTTP client

44 downloads per month

Apache-2.0

13KB
266 lines

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;

Dependencies

~5–16MB
~224K SLoC