Crates.io | tcp_env_logger |
lib.rs | tcp_env_logger |
version | 1.1.0 |
source | src |
created_at | 2024-01-11 07:09:41.862168 |
updated_at | 2024-09-27 05:14:23.249169 |
description | TCP logger built on top of env_logger |
homepage | https://github.com/handle-fi/tcp_env_logger |
repository | https://github.com/handle-fi/tcp_env_logger |
max_upload_size | |
id | 1095955 |
size | 6,866 |
tcp_env_logger
Note that log_hostname
can be any arbitrary value. Its purpose is to identify
the server emitting the logs.
log_url
is the full TCP socket connection URL.
fn setup_logger() {
let log_hostname = std::env::var("LOG_LOCAL_HOSTNAME").expect("LOG_LOCAL_HOSTNAME not defined");
let log_url = std::env::var("LOG_REMOTE_URL").expect("LOG_REMOTE_URL not defined");
let env_logger = env_logger::Builder::from_default_env().build();
EnvTcpLogger::init(log_hostname, log_url, env_logger).unwrap();
}