Crates.io | logtail-rust |
lib.rs | logtail-rust |
version | 0.1.1 |
source | src |
created_at | 2024-07-01 17:27:45.326271 |
updated_at | 2024-07-01 17:34:21.244179 |
description | Logtail http client wrapper |
homepage | |
repository | https://github.com/LuisEvilCo/logtail-rust |
max_upload_size | |
id | 1288899 |
size | 13,935 |
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;