file - boost log every hour -


I am using a boot log and I want to create the original log principal file: New error log at the beginning of each hour (If error exists), and name it like "file_% Y% m% d% H.log" With this boost library I have 2 problems: 1. How to rotate the file at the beginning of each hour? This is not possible with the rotation_at_time_interval parameter because it creates a new file about the first written record in the file, and that hour in the file name does not match that rule. Can there be multiple rotation_t_time points for a file in sync or is there a different solution? 2. When the file is more than a size, I want to start a new file and in that case it should attach some index to the file name. Adding the Rotation_size parameter and% N with the filename will increase it all the time while the app is running. I want to reset N to the beginning of every hour, as my file name changes. Does anyone know how to do this with the Boost log library?

It is fundamental to create log files in the industry. I really do not understand how this can be done with the library which is dedicated to creating log files.

The library does not provide a way to rotate the file for every hour, but I That's the problem, so I used a function wrapper, which is correct when I beg for every hour. I feel better in this way, because I can control the power of the code.

from boost.org:

  bool is_it_time_to_rotate (); Zero init_logging () {boost :: shared_ptr & lt; Sync: text_file_backend & gt; Backend = Prompt: Make-up & lt; Sync: text_file_backend & gt; (Keyword :: file_name = "file_% 5 .log", keyword :: time_base_rations = & amp; is_it_time_to_rotate);   

}

For a second question I really do not undrestand it well.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -