Author: mturk
Date: Wed Nov 21 08:13:04 2012
New Revision: 1412009

URL: http://svn.apache.org/viewvc?rev=1412009&view=rev
Log:
Ensure the log is flushed for non-debug messages

Modified:
    commons/proper/daemon/branches/1.0.x/src/native/windows/src/log.c

Modified: commons/proper/daemon/branches/1.0.x/src/native/windows/src/log.c
URL: 
http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/src/log.c?rev=1412009&r1=1412008&r2=1412009&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/native/windows/src/log.c (original)
+++ commons/proper/daemon/branches/1.0.x/src/native/windows/src/log.c Wed Nov 
21 08:13:04 2012
@@ -346,6 +346,8 @@ apxLogWrite(
             buffer[--len] = '\0';
         if (!IS_INVALID_HANDLE(lf->hFile)) {
             SYSTEMTIME t;
+            /* Append operation */
+            SetFilePointer(lf->hFile, 0, &wr, FILE_END);
             GetLocalTime(&t);
             if (dolock) {
                 APX_LOGLOCK(lf->hFile);
@@ -373,9 +375,8 @@ apxLogWrite(
 
             /* Terminate the line */
             WriteFile(lf->hFile, LINE_SEP, sizeof(LINE_SEP) - 1, &wr, NULL);
-#ifdef _DEBUG_FULL
-            FlushFileBuffers(lf->hFile);
-#endif
+            if (dwLevel)
+                FlushFileBuffers(lf->hFile);
             if (dolock) {
                 APX_LOGUNLOCK(lf->hFile);
             }


Reply via email to