Cargo Features

[dependencies]
log4rs = { version = "1.3.0", default-features = false, features = ["config_parsing", "yaml_format", "json_format", "toml_format", "console_appender", "file_appender", "rolling_file_appender", "compound_policy", "delete_roller", "fixed_window_roller", "size_trigger", "time_trigger", "json_encoder", "pattern_encoder", "ansi_writer", "console_writer", "simple_writer", "threshold_filter", "background_rotation", "all_components", "gzip"] }
default = all_components, config_parsing, yaml_format

These default features are set whenever log4rs is added without default-features = false somewhere in the dependency tree.

config_parsing default = humantime, serde, serde-value, typemap-ors

Enables serde of log

Affects console::ConsoleAppenderConfig, console::ConsoleAppenderDeserializer, file::FileAppenderConfig, file::FileAppenderDeserializer, append::AppenderConfig, rolling_file::RollingFileAppenderConfig, rolling_file::RollingFileAppenderDeserializer, compound::CompoundPolicyConfig, compound::CompoundPolicyDeserializer, delete::DeleteRollerConfig, delete::DeleteRollerDeserializer, fixed_window::FixedWindowRollerConfig, fixed_window::FixedWindowRollerDeserializer, size::SizeTriggerConfig, size::SizeTriggerDeserializer, time::TimeTriggerConfig, config::create_raw_config, config::init_raw_config, json::JsonEncoderConfig, json::JsonEncoderDeserializer

yaml_format default = serde_yaml
json_format = serde_json
toml_format = toml
console_appender all_components = console_writer, pattern_encoder, simple_writer

Affects append::console

file_appender all_components = parking_lot, pattern_encoder, simple_writer

Affects append::file

rolling_file_appender all_components = parking_lot, pattern_encoder, simple_writer

Affects append::rolling_file

compound_policy all_components

Affects policy::compound

delete_roller all_components

Affects roll::delete

fixed_window_roller all_components

Affects roll::fixed_window

size_trigger all_components

Affects trigger::size

time_trigger all_components = rand

Affects trigger::time

json_encoder all_components = chrono, log-mdc, serde, serde_json, thread-id

Enables serde of log

Affects encode::json

pattern_encoder all_components console_appender? file_appender? rolling_file_appender? = chrono, log-mdc, thread-id

Affects encode::pattern

ansi_writer console_writer?

Affects writer::ansi

console_writer console_appender? = ansi_writer, libc, winapi

Affects writer::console

simple_writer console_appender? file_appender? rolling_file_appender?

Affects writer::simple

threshold_filter all_components

Affects filter::threshold

background_rotation
all_components default = compound_policy, console_appender, delete_roller, file_appender, fixed_window_roller, json_encoder, pattern_encoder, rolling_file_appender, size_trigger, threshold_filter, time_trigger
gzip = flate2

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

chrono json_encoder? pattern_encoder?
flate2 gzip?
humantime config_parsing
log-mdc json_encoder? pattern_encoder?
serde config_parsing json_encoder?
serde-value config_parsing
thread-id json_encoder? pattern_encoder?

Enables thread-id ^4

typemap-ors config_parsing
serde_json json_encoder? json_format?
serde_yaml yaml_format
toml toml_format?
parking_lot file_appender? rolling_file_appender?
rand time_trigger?
libc not win console_writer?
winapi win console_writer?