Summary:ASTERISK-08854: Log files are not being properly flushed
Reporter:John Guthrie (guthrie)Labels:
Date Opened:2007-02-20 17:07:38.000-0600Date Closed:2007-02-20 17:26:08.000-0600
Versions:Frequency of
Environment:Attachments:( 0) logger_flush.patch
Description:In SVN version 54702, it seems as if the log files are not being properly flushed.  

When I start up asterisk, the log file ends in a truncated line, and vi says that there is no eol character at the end fo the file.  I can rectify this by typing "logger reload" into the asterisk console.  Of course any log messages that subsequently appear on the console, don't appear in the log file until a certain amount of log data has been written to the file.  (In my case, that amount is 4096 bytes.)  This suggests to me that data is being written to the log file, but the file pointer is not being flushed.  In most programs, this isn't a problem, but for a log file, it makes things *really* hard to debug.

An sure enough, in main/logger.c, at around line 710, there is an fprintf() without an fflush().  I am attaching a patch that should fix this.

System info:
Asterisk version: Subversion #54702  (I don't know if I'm supposed to include 1.4.0 with this as well.)
Comments:By: Joshua C. Colp (jcolp) 2007-02-20 17:26:08.000-0600

Fixed in trunk as of revision 55716. Thanks!