1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Layered configuration and structured logging for Rust services.
//!
//! Two halves behind one crate:
//!
//! - [`config`] — stack configuration from files, environment variables and
//! Azure App Configuration, merge by declared precedence, read typed values.
//! Always available.
//! - [`logging`] — a non-blocking `tracing` facade with console, JSON, file
//! and syslog sinks, per-sink filters, runtime reload, and optional Azure
//! Application Insights export. Behind the `logging` feature, so a
//! config-only user compiles none of it.
//!
//! The two meet in one direction only: logging can be *described* in
//! configuration ([`logging::settings::Settings`] reads a `[logging]` block
//! from a [`config::Store`]), and [`init`] stands both up in a single call.
//! The config half never depends on the logging half.
//!
//! ```rust,no_run
//! # async fn _example() -> Result<(), Box<dyn std::error::Error>> {
//! use stratify::config;
//!
//! let store = config::Builder::default()
//! .json("config/base.json", 100)
//! .yaml("config/override.yaml", 50)
//! .env("APP_", "__", 10)
//! .build()
//! .await?;
//!
//! let host = store.get_str("database.host");
//! # Ok(()) }
//! ```
//!
//! # Feature flags
//!
//! - `azure` — [`config::source::AzureAppConfigSource`], reading from Azure
//! App Configuration. Off by default, because it brings in an HTTP stack
//! that a file-and-environment user should not pay for.
//! - `logging` — the [`logging`] module and [`init`].
//! - `compression` — gzip retired log files (implies `logging`).
//! - `appinsights` — export to Azure Application Insights with trace
//! correlation (implies `logging`).
// The config half has no need for `unsafe`, and neither does the logging half:
// even reading the Application Insights connection string goes through an
// injectable lookup rather than mutating the process environment. `forbid`
// rather than `deny` on purpose: `deny` can be switched off by an inner
// `#[allow]` in the same change that introduces the problem.
/// Layered configuration: pluggable sources, priority merging, typed access.
/// Structured logging: a non-blocking `tracing` facade with pluggable sinks.
pub use ;