Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11691 closed Bugs (fixed)

Boost.Log does not recognize file name pattern that includes datetime format specifiers

Reported by: art.korotkov@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.59.0 Severity: Problem
Keywords: Boost, log, 1.59, file name pattern, datetime Cc:

Description

Running the following example http://www.boost.org/doc/libs/1_59_0/libs/log/example/doc/sinks_xml_file.cpp with file name pattern "%Y%m%d_%H%M%S_%5N.xml" results log files having names like "2015-Sep-29 08:42:02.330324" (using Boost 1.59).

If datetime specifiers are not included in file name pattern, everything looks good. For example, running with file name pattern "log_%5N.xml" generates logs in form "log_00001.xml".

Compiling the same example with Boost 1.58 gives results as expected.

Change History (2)

comment:1 by Andrey Semashev, 7 years ago

Resolution: fixed
Status: newclosed

Thanks for reporting this. The problem is that Boost.DateTime facets that are used for formatting have hidden visibility when Boost.Log is compiled. Because of that date/time formatting fails.

I've added a workaround for this problem in https://github.com/boostorg/log/commit/284d5e6139460788ad011bfc05085cd6d624db78. Fix in Boost.DateTime is also needed, but I'll create a separate ticket for this.

comment:2 by Andrey Semashev, 7 years ago

Boost.DateTime ticket: #11707.

Note: See TracTickets for help on using tickets.