alexbuisson
alexbuisson

Reputation: 8479

boost.log v2, how to get the current log file name

I'm updating a C++ class wrapping the boost logger to use a recent boost version with the logger v2 API.

Most of the work have been done, but with the logger v1 we used an API to get the current log file name and path like in the example below:

boost::filesystem::path p = pAsyncFileSink->locked_backend()->get_log_filename()

I searched for some hour, but I don't find a way to do that with the current API ! if we use a rotating text file backend, how to get the latest or in use file name ?

Any help or advice will be welcome. Alex.

Upvotes: 1

Views: 919

Answers (1)

Andrey Semashev
Andrey Semashev

Reputation: 10624

There is no API to obtain the current file name. You can see in the implementation that the file name is generated only when file rotation is performed, making it possible for the sink to not have a file name in certain points in time.

Upvotes: 1

Related Questions