NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1985 most downloaded on crates.io
An easy-to-configure and flexible logger that writes logs to stderr or stdout and/or to files. It allows custom logline formats, and it allows changing the log specification at runtime. It also allows defining additional log streams, e.g. for alert or security messages.
Last release 1 months ago
07 Aug 2026
Release timing varies
gaps range from 8 days to 4 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
8 versions withdrawn
withdrawn after publishing
11 years old
152 releases · first in 2015
Use time directly, instead of chrono, due to RUSTSEC-2020-0159. Bumps the minimal supported rust version to 1.51.0. Improves performance a bit.
Use time directly, instead of chrono,
due to RUSTSEC-2020-0159.
Bumps the minimal supported rust version to 1.51.0. Improves performance a bit.
Unfortunately, this version suffers on linux from time's somewhat radical behavior
to not support UTC offsets on linux.
Remove time 0.1 from dependency tree (see PR 96) - kudos to complexspaces!
Remove time 0.1 from dependency tree (see PR 96) - kudos to complexspaces!
Add feature dont_minimize_extra_stacks
(fixes issue-95) -
kudos to leishiao!
One column per quarter.
Fix issue-94 - kudos to leishiao!
Nothing published for this version
Nothing published for this version
Nothing published for this version
Platform-specific fixes, and introduction of github-actions-based CI. Kudos to dallenng and HEnquist!
Platform-specific fixes, and introduction of github-actions-based CI. Kudos to dallenng and HEnquist!
FileLogWriter has been functionally extended to make it usable "stand-alone".
As part of that, the FlWriteMode is gone, and the normal WriteMode is used.
WriteMode::BufferDontFlushWith was added.
A new experimental feature (and module) "trc" allows using flexi_logger functionality
with tracing.
Error handling is improved, error codes are documented comprehensively, errors now also print a link to the error documentation.
Default color for DEBUG lines was changed (fixes issue-88, kudos goes to HEnquist!).
Test coverage is improved.
Implement async mode also for log_to_stdout() and log_to_stderr().
Implement async mode also for log_to_stdout() and log_to_stderr().
Significant API revision, to better cope with new features and for better readability/applicability.
Significant API revision, to better cope with new features and for better readability/applicability.
Most important changes:
Logger::with_env() is replaced with Logger::try_with_env(), which returns a ResultLogger::with_str() is replaced with Logger::try_with_str(), which returns a ResultLogger::with_env_or_str() is replaced with Logger::try_with_env_or_str(),
which returns a ResultLogger::check_parser_error is goneFileSpecLogger to FileSpec
(and similarly on the FileLogWriter)Logger::log_target(LogTarget) is replaced with a set of methods
Logger::log_to_file(FileSpec)Logger::log_to_stdout()Logger::log_to_stderr()Logger::log_to_writer(Box<dyn LogWriter>)Logger::log_to_file_and_writer(FileSpec,Box<dyn LogWriter>)Logger::do_not_log()Logger::write_mode(WriteMode)
async is used)LoggerHandle alive has become crucial (except for trivial cases)!LoggerHandle::reset_flw allows reconfiguring a used FileLogWriter at runtimeAdded an option to apply a stateful filter before log lines are really written (kudos to jesdazrez (Jesús Trinidad Díaz Ramírez)!).
Fixed error handling in logspec parsing (wrong error was thrown).
Several docu improvements.
Add options Logger::buffer_and_flush() and buffer_and_flush_with() as means to avoid long output delays.
Add options Logger::buffer_and_flush() and buffer_and_flush_with()
as means to avoid long output delays.
Introduce optional buffering of log output. This increases performance (which can be relevant for programs with really high log production), but delay
Introduce optional buffering of log output. This increases performance (which can be relevant for programs with really high log production), but delays log line appearance in the output, which can be confusing, and requires to flush or shutdown the logger at the end of the program to ensure that all logs are written to the output before the program terminates.
Reduce the size of LogConfiguration considerably by moving the optional and rarely used textfilter
into the heap. This unfortunately leads to an incompatible change in a rarely used public method
(LogConfiguration::text_filter() was returning a &Option<Regex>,
and is now returning Option<&Regex>), which enforces a version bump.
Rename ReconfigurationHandle to LoggerHandle (and add an type alias with the old name).
Add the public method LoggerHandle::flush().
Expose DeferredNow::new().
Add some must_use annotations where appropriate.
Nothing published for this version
Add module code-examples with additional usage documentation. This is a follow-up of a PR, kudos goes to devzbysiu!
Add module code-examples with additional usage documentation. This is a follow-up of a PR, kudos goes to devzbysiu!
Support empty toml spec files (kudos to ijackson for pull request 66!) (was supposed to be part of 0.16.0, but I had forgotten to merge it).
Support empty toml spec files (kudos to ijackson for pull request 66!) (was supposed to be part of 0.16.0, but I had forgotten to merge it).
breaking change: change the file suffix for the compressed log files from .zip to .gz
If file logging is used, do not create the output file if no log is written. Solves issue-62.
Improve color handling
atty without provided coloringcolors to provide insight in how AdaptiveFormat worksLogger::do_not_log();
use log_target() with LogTarget::DevNull instead.Logger::o_log_to_file(); use log_target() instead.
The clearer convenience method Logger::log_to_file() is still available.Improve the compression feature. Solves issue-65.
.zip to .gzziplog and call the feature now compressCleanup::KeepZipFiles into Cleanup::KeepCompressedFiles
and Cleanup::KeepLogAndZipFiles into Cleanup::KeepLogAndCompressedFiles
If file logging is used, do not create the output file if no log is written Solves issue issue-62.
Make 1.37.0 the minimal rust version for flexi_logger.
Make 1.37.0 the minimal rust version for flexi_logger.
Introduce feature specfile_without_notification to allow coping with OS issues (solves issue-59).
Introduce feature specfile_without_notification to allow coping with OS issues
(solves issue-59).
Minor code maintenance.
Minor code maintenance.
Allow using the log target with fantasy names, like with env_logger. Solves issue-56.
Allow using the log target with fantasy names, like with env_logger.
Solves issue-56.
Allow modifying the coloring palette through the environment variable FLEXI_LOGGER_PALETTE. See function style for details. Solves issue-55.
Add some Debug derives (kudos to pscott!, PR-52).
Deprecate Logger::do_not_log().
Add Logger::duplicate_to_stdout() to fix issue-47.
Add Logger::duplicate_to_stdout() to fix
issue-47.
Fix issue-45, which was a panic in the specfile watcher when some log files were deleted manually while the program was running (kudos to avl!, PR-46)
Add compatibility with multi_log by adding methods Logger::build and Logger::build_with_specfile (fixes issue-44).
Add compatibility with multi_log by adding methods
Logger::build and Logger::build_with_specfile (fixes issue-44).
Add LogSpecBuilder::insert_modules_from() (fixes issue-43).
Improve handling of parse-errors.
Improve handling of parse-errors.
Fix default format for files (was and is documented to be uncolored, but was colored).
Make the textfilter functionality an optional default feature; deselecting it removes the regex crate as a required dependency, which reduces the size
Make the textfilter functionality an optional default feature;
deselecting it removes the regex crate as a required dependency,
which reduces the size overhead for any binary using flexi_logger
(kudos to Petre Eftime!).
Refine and rename error variants to allow e.g. differentiating between errors related to the output (files) and errors related to the specfile.
Refine and rename error variants to allow e.g. differentiating between errors related to the output (files) and errors related to the specfile.
Make cleanup more robust, and allow controlling the cleanup-thread also with Logger::start_with_specfile().
Make cleanup more robust, and allow controlling the cleanup-thread also with
Logger::start_with_specfile().
If rotation is used with cleanup, do the cleanup by default in a background thread (solves issue 39).
If rotation is used with cleanup, do the cleanup by default in a background thread (solves issue 39).
For the ziplog feature, switch from zip crate to flate2.
Fix issue 38 (Old log files are not removed if rCURRENT doesn't overflow).
Fix issue 38 (Old log files are not removed if rCURRENT doesn't overflow).
Pass format option into custom loggers (pull request 37).
Pass format option into custom loggers (pull request 37).
Fix bug in specfile handling (issue 36).
Fix bug in specfile handling (issue 36).
Improve docu and implementation of create_symlink.
Minor other stuff.
Allow defining custom handlers for the default log target (solves issue 32).
Allow defining custom handlers for the default log target (solves issue 32).
Use implicit locking of stderr in StdErrWriter.
Use implicit locking of stderr in StdErrWriter.
Allow failures in travis' windows build.
Add license files.
Support recursive logging also with FileLogWriter, sharing the buffer with the PrimaryWriter.
Support recursive logging also with FileLogWriter, sharing the buffer with the PrimaryWriter.
Fix multi-threading issue (incorrect line-break handling with stderr).
Further stabilize the specfile feature.
Further stabilize the specfile feature.
Remove LogSpecification::ensure_specfile_exists() and LogSpecification::from_file()
from public API, where they should not be (-> version bump).
Harmonize all eprintln! calls to
prefix the output with "[flexi_logger] ".
Only relevant for the specfile feature: initialize the logger before dealing in any way with the specfile, and do the initial read of the specfile in
Only relevant for the specfile feature:
initialize the logger before dealing in any way with the specfile,
and do the initial read of the specfile in the main thread,
i.e. synchronously, to ensure a deterministic behavior during startup
(fixes issue 31).
Improve the file watch for the specfile to make the specfile feature more robust. E.g. allow editing the specfile on linux with editors that move the
Improve the file watch for the specfile to make the specfile feature more robust.
E.g. allow editing the specfile on linux
with editors that move the original file to a backup name.
Add an option to write the log to stdout, as recommended for twelve-factor apps.
Make get_creation_date() more robust on all platforms.
Make get_creation_date() more robust on all platforms.
Fix fatal issue with get_creation_date() on linux (see ).
Fix fatal issue with get_creation_date() on linux (see https://github.com/emabee/flexi_logger/pull/30).
Improve performance for plain stderr logging.
Improve performance for plain stderr logging.
Improve robustnesss for recursive log calls.
Remove the deprecated Logger::start_reconfigurable() and Logger::rotate_over_size().
Revise handling of record.metadata().target() versus record.module_path().
Incompatible API modification: Logger.rotate() takes now three parameters.
Suppport different formatting for stderr and files.
Add feature colors (see README.md for details).
Remove the deprecated Logger::start_reconfigurable() and Logger::rotate_over_size().
Fix issue 26 (logging off for specific modules).
Version updates of dependencies.
Version updates of dependencies.
Add SyslogWriter.
Add SyslogWriter.
Change API to more idiomatic parameter types, in a compatible way.
Change API to more idiomatic parameter types, in a compatible way.
Add first implementation of a SyslogWriter.
Add option to write windows line endings, rather than a plain \n.
Add option to write windows line endings, rather than a plain \n.
Remove some deprecated methods.
Add options to cleanup rotated log files, by deleting and/or zipping older files.
Remove some deprecated methods.
Let the BlackHoleLogger, although it doesn't write a log, still duplicate to stderr.
Let the BlackHoleLogger, although it doesn't write a log, still duplicate to stderr.
Deprecate Logger::start_reconfigurable(), let Logger::start() return a reconfiguration handle.
Deprecate Logger::start_reconfigurable(), let Logger::start() return a reconfiguration handle.
Add an option to write all logs to nowhere (i.e., do not write any logs).
Eliminate performance penalty for using reconfigurability.
Eliminate performance penalty for using reconfigurability.
Add methods to modify the log spec temporarily.
Add methods to modify the log spec temporarily.
Advance to edition 2018.
Advance to edition 2018.
Log-spec parsing is improved, more whitespace is tolerated.
Log-spec parsing is improved, more whitespace is tolerated.
When file rotation is used, the name of the file to which the logs are written is now stable.
When file rotation is used, the name of the file to which the logs are written is now stable.
Details:
Example:
After some logging with your program my_prog, you will find files like
my_prog_r00000.log
my_prog_r00001.log
my_prog_r00002.log
my_prog_rCURRENT.log
LogSpecification::parse() now returns a Result , rather than a log spec directly (-> version bump). This enables a more reliable usage of FlexiLogger
LogSpecification::parse() now returns a Result<LogSpecification, FlexiLoggerError>, rather than
a log spec directly (-> version bump).
This enables a more reliable usage of FlexiLogger in non-trivial cases.
For the sake of compatibility for the normal usecases, the Logger methods with_str() etc.
remain unchanged. An extra method is added to retrieve parser errors, if desired.
Docu improvement.
Docu improvement.
Fix incorrect filename generation with rotation, i.e., switch off timestamp usage when rotation is used.
Fix incorrect filename generation with rotation, i.e., switch off timestamp usage when rotation is used.
Introduce Logger::duplicate_to_stderr(), as a more flexible replacement for duplicate_error() and duplicate_info().
Introduce Logger::duplicate_to_stderr(), as a more flexible replacement for duplicate_error()
and duplicate_info().
Your coding agent can read these notes before it upgrades. Set up the MCP server →