Repository navigation
Releases: LogicOcean/stratify
Release list
stratify 1.1.0
Added
stratify::logging::tracing, re-exporting the instrumentation API whole.
tracingis how code emits — spans, events,info!— and this crate is how
those records leave the process; re-exporting the former from the latter
lets a service depend on stratify alone, with both halves guaranteed to
agree on a version.use stratify::logging::tracing;at the top of a module
keeps every existingtracing::info!(...)callsite compiling unchanged.
The convention of depending ontracingdirectly remains available; this is
for consumers who want one logging dependency, in the same spirit as the
existingEnvFilterre-export.
stratify 1.0.1
Fixed
-
Span fields no longer carry ANSI escape codes into files or colourless
consoles. The escape codes were coming from span-field caching: the
layer's own ANSI flag — which defaulted on — decides how a span's fields are
rendered into the cache every event then prints verbatim, and the sinks only
ever set the flag on the event format. Found live: a web service's
per-request span (http_request{method=…}) arrived in its log file wrapped
in italic/dim codes with colour configured off everywhere.The file sinks also get their own cache now (a distinct field-formatter
type), so a coloured console beside a text file cannot bleed escape codes
into it either — previously the two shared one cache and whichever layer
formatted a span first decided what the other printed, which is why services
had to switch console colour off to protect their files. Both regressions
are pinned by tests that fail against the previous release.
stratify 1.0.0
The stability release. From here, a breaking change to anything public is a
major version, so the 0.4-era caveat about minor bumps is retired along with
the number.
stratify absorbs the unpublished loggingkit crate. One crate, two namespaces:
stratify::config is the configuration half, stratify::logging is a
non-blocking tracing facade, and stratify::init stands both up in one call.
The logging half is behind the logging feature and a config-only build
compiles none of it — CI proves that on every push by failing if the default
dependency tree contains tracing-subscriber, tracing-appender or any
opentelemetry crate.
Changed
- Breaking: the config API moved from the crate root into
stratify::config, and the types shed their prefixes now that the module
carries the name:ConfigBuilder→config::Builder,ConfigError→
config::Error,ConfigStore→config::Store.Sourceand the source
types live underconfig::source. - The minimum supported Rust version is now declared: 1.88.0.
Added
stratify::logging(featurelogging): console, JSON, file and syslog
sinks, all non-blocking; per-sink filters; runtime filter reload; sampling
and rate-limit gates; size- and time-based file rotation with retention;
custom line formatters; redaction; panic capture; queue-depth and
dropped-line accounting. Formerly theloggingkitfacade, imported here
without its history and with its legacy pre-facade API (LogBuilder,
LogStore, thesinkmodule) left behind.logging::settings::Settings(and per-sink*Settingsblocks), a serde
schema read from a config [Store] withSettings::from_store. The logging
half does no parsing of its own — TOML, YAML, JSON and environment layering
are the config half's job, in one place. The oldfrom_file, and thetoml
dependency it carried, are gone.stratify::initandinit_with(featurelogging): read configuration
(file < environment <.env), build logging from its[logging]block,
install the subscriber, and return theBootstrappair. The first record
the subscriber carries names the sources that resolved, so a wrong
precedence stack is visible instead of silent.- Features
appinsights(Azure Application Insights export with trace
correlation) andcompression(gzip retired log files), both implying
logging. - Full settings parity:
[logging.filters](per-sink directives),redact,
capture_panics,[logging.global_fields],[logging.syslog]and
[logging.app_insights]are all expressible in configuration, so "described
rather than coded" covers the whole builder surface. Theapp_insights
block names the key the connection string is found under rather than
holding the value, so the file stays safe to commit; an explicit block whose
secret is missing is a startup error, not a silently absent exporter. A bad
level, an unknown syslog facility, or a block needing a feature that is
not compiled in all fail loudly at startup naming the offending key —
Settings::to_builderis fallible now for exactly that reason. AppInsightsConfig::with_sample_rate, bounding the fraction of traces
exported (0.0..=1.0, parent-based so a trace is kept or dropped whole).
Exporting every span is an Application Insights bill that grows linearly
with traffic; this is the knob. Log records are not sampled — per-sink
filters are the tool for those. Also settable assample_ratein the
[logging.app_insights]block.initreadsrust_logfrom the store when no explicit level is set, so a
RUST_LOGwritten in.envobeys the store's precedence instead of
silently losing to a shell export — the builder's own fallback reads the
process environment, which a.envloaded as a source never touches.
Sourced from configuration it is validated strictly: a typo is a startup
error naming the key.AzureAppConfigSource::with_key_vault_resolution, resolving Key Vault
references into the secrets they point at, reusing the source's credential
against the vault data plane. Off by default because resolution widens the
source's reach from one store to every vault the references name; with it
off, encountering a reference is an error naming the key — loud, rather
than a JSON envelope masquerading as a configuration value.stratify::logging::EnvFilter, re-exported sowith_filterand
reload_filtercan be called without takingtracing-subscriberas a
direct dependency.
stratify 0.3.1
Added
-
EnvSource::with_keysandConfigBuilder::env_keys, capturing exactly the
environment variables you name rather than everything matching a prefix.Some settings are named by convention rather than by application:
RUST_LOG
is read bytracing-subscriber,AZURE_STORAGE_ACCOUNTis what Azure
injects. No prefix selects those and nothing else, and an empty prefix
captures the whole environment —PATHand every other process's secrets
along with it, which then sits in the merged configuration waiting to be
logged.Names match case-insensitively and appear lowercased, so
RUST_LOGis read as
rust_log. The separator still applies.
stratify 0.3.0
First public release. Continues the unpublished configkit under a name that is
available on crates.io and describes the crate rather than padding it.
Added
- Azure App Configuration source, behind the
azurefeature. The caller supplies
the credential rather than the crate choosing one, so a service can use a managed
identity in Azure and a developer credential locally. That keepsazure_identity
out of this crate's dependency tree and lets the source be tested against a fake.
Supports@nextLinkpagination, an optional label filter, and theDatabase:Host
key convention. ConfigBuilder::azurefor the same, in the fluent style.#![forbid(unsafe_code)].
Changed
- Breaking:
Source::loadis nowasync. Implementations declare
#[async_trait], andConfigBuilder::buildandConfigStore::refreshare
awaited. Network-backed sources should not block a runtime thread, and the
synchronous trait left no way to use an async SDK without blocking inside a
runtime, which panics. - Replaced
serde_yamlwithserde_norway.serde_yamlis officially deprecated
and should not be a dependency of a published crate. toml0.8 to 1.- Key nesting is shared between the environment and Azure sources rather than
duplicated in each.
Migration from configkit 0.2
-let store = ConfigBuilder::default().json("base.json", 100).build()?;
+let store = ConfigBuilder::default().json("base.json", 100).build().await?;For a custom source, add the attribute and the keyword:
+#[async_trait::async_trait]
impl Source for MySource {
- fn load(&self) -> Result<Value, ConfigError> { ... }
+ async fn load(&self) -> Result<Value, ConfigError> { ... }
}