[boost::logging] flushing rolling_file
Hi all, Does anybody use boost::logging ? I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice ! Thanks, Benjamin
Hi Benjamin,
Hi all,
Glad you posted this here :)
Does anybody use boost::logging ?
I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice !
Yes it would, and it can ;)
Note: there's a problem with your address :
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
benjamin.dedardel@medecom.fr
SMTP error from remote mail server after RCPT TO:
Hi John, Of course I think it can do it but I don't know how to do that : with a standard file, I can set <flush-each-time> property. What's the way with a rolling file ? // standard file destination::file_settings settings2; *settings2.flush_each_time( true );* g_logger->writer().add_destination( destination::file file2( "file path" settings2 )); // rolling file destination::rolling_file_settings settings; settings.file_count( 10 ); settings.max_size_bytes( 5242880 ); // bytes = 5M g_logger->writer().add_destination( destination::rolling_file( "file path", settings ) ); Thanks, Benjamin John Torjo a écrit :
Hi Benjamin,
Hi all,
Glad you posted this here :)
Does anybody use boost::logging ?
I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice !
Yes it would, and it can ;)
Note: there's a problem with your address :
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
benjamin.dedardel@medecom.fr SMTP error from remote mail server after RCPT TO:
: host SMTP2.lerelaisinternet.com [194.206.126.203]: 450 : Recipient address rejected: Greylisted for 5 minutes: retry timeout exceeded
Best, John
Hi John, hi all As I don't know how to parameter boost::logging to flush messages in rolling files, I modify the code as follow. My question is : Is it absolutly necessary to change the code to do that ? Thanks, Benjamin ///// rolling_file.hpp /////// void recreate_file() {... m_cur_size = 0; } template<class msg_type> void write( const msg_type& msg) { convert_dest::write(msg, (*m_out) ); // flush each time m_cur_size += msg.size(); m_out->flush(); if ( m_cur_size > m_flags.max_size_bytes()) { m_cur_idx = (m_cur_idx + 1) % m_flags.file_count(); recreate_file(); } } size_t m_cur_size; ////////////////////////////////////// John Torjo a écrit :
Hi Benjamin,
Hi all,
Glad you posted this here :)
Does anybody use boost::logging ?
I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice !
Yes it would, and it can ;)
Best, John
Hi Benjamin,
Hi John, hi all
As I don't know how to parameter boost::logging to flush messages in rolling files, I modify the code as follow.
My question is : Is it absolutly necessary to change the code to do that ?
I've updated the code. So, to manually flush: rolling_file f(...); f.flush(); To automatically flush: rolling_file f( ...., rolling_file_settings().flush_each_time(true) ); Best, John
Thanks, Benjamin
///// rolling_file.hpp ///////
void recreate_file() {... m_cur_size = 0; }
template<class msg_type> void write( const msg_type& msg) { convert_dest::write(msg, (*m_out) );
// flush each time m_cur_size += msg.size(); m_out->flush(); if ( m_cur_size > m_flags.max_size_bytes()) { m_cur_idx = (m_cur_idx + 1) % m_flags.file_count(); recreate_file(); } }
size_t m_cur_size;
//////////////////////////////////////
John Torjo a écrit :
Hi Benjamin,
Hi all,
Glad you posted this here :)
Does anybody use boost::logging ?
I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice !
Yes it would, and it can ;)
Best, John
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right
Hi, This isn't boost-specific but the list seems reasonably tolerant of off-topic posts and it does relate to the regex features. To cut to the chase, my question is , " does boost implement anything that may help in searching an array of strings for particular types of patterns?" As I indicated earlier, I'm doing sequence alignments between many long strings ( 5-50 strings, 10k-5M chars long, either DNA or proteins) ( to make this post informative for others that may be interested in algorithms, see things like this: http://www.google.com/search?hl=en&q=%22sequence+alignment%22+site%3Aciteseer.ist.psu.edu&btnG=Search ) Anyway, manually sorting through 5Meg string arrays is a bit tedious but I wanted to know if there are particular ways of describing queries that may be similar to but faster than regex ( "show me everyplace in this string alignment where 4 of the 5 characters are identical, but only where 5 or more characters meet this criterion?") If you look at this ornately colored html, you can get some idea of what the data look like: http://www.spottext.com/marchywka/some_dog_prosites.html Besides queries on the character content, I'd be looking for similar patterns in the "rules" locations( "show me every sequence where 4 of the 5 things match rule 234") Ultimately, once I have some idea what is going on and have ad hoc tools for debugging, I'd like to make an automated system and can write specialized code but a general query system is great for survey and debug. Thanks. Mike Marchywka 586 Saint James Walk Marietta GA 30067-7165 404-788-1216 (C)<- leave message 989-348-4796 (P)<- emergency only marchywka@hotmail.com Note: Hotmail is blocking my mom's entire ISP claiming it is to reduce spam but probably to force users to use hotmail. Please DON'T assume I am ignoring you and try me on marchywka@yahoo.com if no reply here. Thanks. _________________________________________________________________ Don't get caught with egg on your face. Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_dec
Thanks very much, It will be easier to make updates, rather than making local changes for each new version of boost::logging ! Benjamin John Torjo a écrit :
Hi Benjamin,
Hi John, hi all
As I don't know how to parameter boost::logging to flush messages in rolling files, I modify the code as follow.
My question is : Is it absolutly necessary to change the code to do that ?
I've updated the code. So, to manually flush:
rolling_file f(...); f.flush();
To automatically flush:
rolling_file f( ...., rolling_file_settings().flush_each_time(true) );
Best, John
Thanks, Benjamin
///// rolling_file.hpp ///////
void recreate_file() {... m_cur_size = 0; }
template<class msg_type> void write( const msg_type& msg) { convert_dest::write(msg, (*m_out) );
// flush each time m_cur_size += msg.size(); m_out->flush(); if ( m_cur_size > m_flags.max_size_bytes()) { m_cur_idx = (m_cur_idx + 1) % m_flags.file_count(); recreate_file(); } }
size_t m_cur_size;
//////////////////////////////////////
John Torjo a écrit :
Hi Benjamin,
Hi all,
Glad you posted this here :)
Does anybody use boost::logging ?
I wonder if it's possible to flush logs in a rolling_file as in a standard file (flush_each_time) ? It would be nice !
Yes it would, and it can ;)
Best, John
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org mailto:Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Benjamin de Dardel
-
John Torjo
-
Mike Marchywka