Index: /trunk/include/iprt/log.h
===================================================================
--- /trunk/include/iprt/log.h	(revision 94623)
+++ /trunk/include/iprt/log.h	(revision 94624)
@@ -249,4 +249,90 @@
 typedef FNRTLOGPREFIX *PFNRTLOGPREFIX;
 
+
+/** Pointer to a constant log output interface. */
+typedef const struct RTLOGOUTPUTIF *PCRTLOGOUTPUTIF;
+
+/**
+ * Logging output interface.
+ */
+typedef struct RTLOGOUTPUTIF
+{
+    /**
+     * Opens a new log file with the given name.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     * @param   pszFilename     The filename to open.
+     * @param   fFlags          Open flags, combination of RTFILE_O_XXX.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnOpen, (PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, uint32_t fFlags));
+
+    /**
+     * Closes the currently open file.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnClose, (PCRTLOGOUTPUTIF pIf, void *pvUser));
+
+    /**
+     * Deletes the given file.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     * @param   pszFilename     The filename to delete.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnDelete, (PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename));
+
+    /**
+     * Renames the given file.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     * @param   pszFilenameOld  The old filename to rename.
+     * @param   pszFilenameNew  The new filename.
+     * @param   fFlags          Flags for the operation, combination of RTFILEMOVE_FLAGS_XXX.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnRename, (PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilenameOld,
+                                          const char *pszFilenameNew, uint32_t fFlags));
+
+    /**
+     * Queries the size of the log file.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     * @param   pcbFile         Where to store the file size in bytes on success.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnQuerySize, (PCRTLOGOUTPUTIF pIf, void *pvUser, uint64_t *pcbSize));
+
+    /**
+     * Writes data to the log file.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     * @param   pvBuf           The data to write.
+     * @param   cbWrite         Number of bytes to write.
+     * @param   pcbWritten      Where to store the actual number of bytes written on success.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnWrite, (PCRTLOGOUTPUTIF pIf, void *pvUser, const void *pvBuf,
+                                         size_t cbWrite, size_t *pcbWritten));
+
+    /**
+     * Flushes data to the underlying storage medium.
+     *
+     * @returns IPRT status code.
+     * @param   pIf             Pointer to this interface.
+     * @param   pvUser          Opaque user data passed when setting the callbacks.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnFlush, (PCRTLOGOUTPUTIF pIf, void *pvUser));
+} RTLOGOUTPUTIF;
+/** Pointer to a logging output interface. */
+typedef struct RTLOGOUTPUTIF *PRTLOGOUTPUTIF;
 
 
@@ -2029,4 +2115,7 @@
  *                              performing history rotation, in seconds.
  *                              0 means time limit.
+ * @param   pOutputIf           The optional file output interface, can be NULL which will
+ *                              make use of the default one.
+ * @param   pvOutputIfUser      The opaque user data to pass to the callbacks in the output interface.
  * @param   pErrInfo            Where to return extended error information.
  *                              Optional.
@@ -2038,4 +2127,5 @@
                           uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
                           PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
+                          PCRTLOGOUTPUTIF pOutputIf, void *pvOutputIfUser,
                           PRTERRINFO pErrInfo, const char *pszFilenameFmt, ...) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(16, 17);
 
@@ -2071,4 +2161,7 @@
  *                              performing history rotation, in seconds.
  *                              0 means no time limit.
+ * @param   pOutputIf           The optional file output interface, can be NULL which will
+ *                              make use of the default one.
+ * @param   pvOutputIfUser      The opaque user data to pass to the callbacks in the output interface.
  * @param   pErrInfo            Where to return extended error information.
  *                              Optional.
@@ -2081,4 +2174,5 @@
                            uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
                            PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
+                           PCRTLOGOUTPUTIF pOutputIf, void *pvOutputIfUser,
                            PRTERRINFO pErrInfo, const char *pszFilenameFmt, va_list va) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(16, 0);
 
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 94623)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 94624)
@@ -318,4 +318,5 @@
                            0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
                            vgsvcLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
+                           NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                            NULL /*pErrInfo*/, "%s", pszLogFile ? pszLogFile : "");
     if (RT_SUCCESS(rc))
Index: /trunk/src/VBox/Additions/x11/VBoxClient/logging.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/logging.cpp	(revision 94623)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/logging.cpp	(revision 94624)
@@ -286,4 +286,5 @@
                            0 /*cBufDescs*/, NULL /*paBufDescs*/, RTLOGDEST_STDOUT | RTLOGDEST_USER,
                            vbClLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
+                           NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                            NULL /*pErrInfo*/, "%s", pszLogFile ? pszLogFile : "");
     if (RT_SUCCESS(rc))
Index: /trunk/src/VBox/Main/glue/VBoxLogRelCreate.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/VBoxLogRelCreate.cpp	(revision 94623)
+++ /trunk/src/VBox/Main/glue/VBoxLogRelCreate.cpp	(revision 94624)
@@ -172,4 +172,5 @@
                             cMaxEntriesPerGroup, 0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
                             vboxHeaderFooter, cHistory, uHistoryFileSize, uHistoryFileTime,
+                            NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                             pErrInfo, pcszLogFile ? "%s" : NULL, pcszLogFile);
     if (RT_SUCCESS(vrc))
Index: /trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp
===================================================================
--- /trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp	(revision 94623)
+++ /trunk/src/VBox/Main/src-helper-apps/OpenGLTest/OpenGLTestApp.cpp	(revision 94624)
@@ -303,4 +303,5 @@
                             0 /*cBufDescs*/, NULL /*paBufDescs*/, enmLogDest,
                             NULL /*pfnBeginEnd*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*uHistoryTimeMax*/,
+                            NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                             NULL /*pErrInfo*/, pszFilenameFmt, pszFilename, RTTimeMilliTS());
     if (RT_SUCCESS(vrc))
Index: /trunk/src/VBox/Runtime/common/log/RTLogCreateEx.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/log/RTLogCreateEx.cpp	(revision 94623)
+++ /trunk/src/VBox/Runtime/common/log/RTLogCreateEx.cpp	(revision 94624)
@@ -40,4 +40,5 @@
                           uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
                           PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
+                          PCRTLOGOUTPUTIF pOutputIf, void *pvOutputIfUser,
                           PRTERRINFO pErrInfo, const char *pszFilenameFmt, ...)
 {
@@ -49,4 +50,5 @@
                         cBufDescs, paBufDescs, fDestFlags,
                         pfnPhase, cHistory, cbHistoryFileMax, cSecsHistoryTimeSlot,
+                        pOutputIf, pvOutputIfUser,
                         pErrInfo, pszFilenameFmt, va);
     va_end(va);
Index: /trunk/src/VBox/Runtime/common/log/log.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/log/log.cpp	(revision 94623)
+++ /trunk/src/VBox/Runtime/common/log/log.cpp	(revision 94624)
@@ -212,6 +212,10 @@
      * This can be NULL. */
     PFNRTLOGPHASE           pfnPhase;
-
-    /** Handle to log file (if open). */
+    /** Pointer to the output interface used. */
+    PCRTLOGOUTPUTIF         pOutputIf;
+    /** Opaque user data passed to the callbacks in the output interface. */
+    void                    *pvOutputIfUser;
+
+    /** Handle to log file (if open) - only used by the default output interface to avoid additional layers of indirection. */
     RTFILE                  hFile;
     /** Log file history settings: maximum amount of data to put in a file. */
@@ -228,4 +232,6 @@
     /** Pointer to filename. */
     char                    szFilename[RTPATH_MAX];
+    /** Flag whether the log file was opened successfully. */
+    bool                    fLogOpened;
     /** @} */
 #endif /* IN_RING3 */
@@ -241,5 +247,5 @@
 
 /** The revision of the internal logger structure. */
-# define RTLOGGERINTERNAL_REV    UINT32_C(12)
+# define RTLOGGERINTERNAL_REV    UINT32_C(13)
 
 AssertCompileMemberAlignment(RTLOGGERINTERNAL, cbRingBufUnflushed, sizeof(uint64_t));
@@ -725,4 +731,101 @@
 
 
+#ifdef IN_RING3
+/*********************************************************************************************************************************
+*   Default file I/O interface                                                                                                   *
+*********************************************************************************************************************************/
+
+static DECLCALLBACK(int) rtLogOutputIfDefOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, uint32_t fFlags)
+{
+    RT_NOREF(pIf);
+    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pvUser;
+
+    return RTFileOpen(&pLoggerInt->hFile, pszFilename, fFlags);
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefClose(PCRTLOGOUTPUTIF pIf, void *pvUser)
+{
+    RT_NOREF(pIf);
+    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pvUser;
+
+    int rc = VINF_SUCCESS;
+    if (pLoggerInt->hFile != NIL_RTFILE)
+        rc = RTFileClose(pLoggerInt->hFile);
+
+    pLoggerInt->hFile = NIL_RTFILE;
+    return rc;
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefDelete(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename)
+{
+    RT_NOREF(pIf, pvUser);
+    return RTFileDelete(pszFilename);
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefRename(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilenameOld,
+                                                const char *pszFilenameNew, uint32_t fFlags)
+{
+    RT_NOREF(pIf, pvUser);
+    return RTFileRename(pszFilenameOld, pszFilenameNew, fFlags);
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefQuerySize(PCRTLOGOUTPUTIF pIf, void *pvUser, uint64_t *pcbSize)
+{
+    RT_NOREF(pIf);
+    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pvUser;
+
+    if (pLoggerInt->hFile != NIL_RTFILE)
+        return RTFileQuerySize(pLoggerInt->hFile, pcbSize);
+
+    *pcbSize = 0;
+    return VINF_SUCCESS;
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefWrite(PCRTLOGOUTPUTIF pIf, void *pvUser, const void *pvBuf,
+                                               size_t cbWrite, size_t *pcbWritten)
+{
+    RT_NOREF(pIf);
+    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pvUser;
+
+    if (pLoggerInt->hFile != NIL_RTFILE)
+        return RTFileWrite(pLoggerInt->hFile, pvBuf, cbWrite, pcbWritten);
+
+    return VINF_SUCCESS;
+}
+
+
+static DECLCALLBACK(int) rtLogOutputIfDefFlush(PCRTLOGOUTPUTIF pIf, void *pvUser)
+{
+    RT_NOREF(pIf);
+    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pvUser;
+
+    if (pLoggerInt->hFile != NIL_RTFILE)
+        return RTFileFlush(pLoggerInt->hFile);
+
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * The default file output interface.
+ */
+static const RTLOGOUTPUTIF g_LogOutputIfDef =
+{
+    rtLogOutputIfDefOpen,
+    rtLogOutputIfDefClose,
+    rtLogOutputIfDefDelete,
+    rtLogOutputIfDefRename,
+    rtLogOutputIfDefQuerySize,
+    rtLogOutputIfDefWrite,
+    rtLogOutputIfDefFlush
+};
+#endif
+
+
 /*********************************************************************************************************************************
 *   Ring Buffer                                                                                                                  *
@@ -954,14 +1057,17 @@
     if (pLoggerInt->fDestFlags & RTLOGDEST_FILE)
     {
-        if (pLoggerInt->hFile != NIL_RTFILE)
+        if (pLoggerInt->fLogOpened)
         {
             if (cchPreamble)
-                RTFileWrite(pLoggerInt->hFile, pszPreamble, cchPreamble, NULL);
+                pLoggerInt->pOutputIf->pfnWrite(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                pszPreamble, cchPreamble, NULL /*pcbWritten*/);
             if (cchFirst)
-                RTFileWrite(pLoggerInt->hFile, pszFirst, cchFirst, NULL);
+                pLoggerInt->pOutputIf->pfnWrite(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                pszFirst, cchFirst, NULL /*pcbWritten*/);
             if (cchSecond)
-                RTFileWrite(pLoggerInt->hFile, pszSecond, cchSecond, NULL);
+                pLoggerInt->pOutputIf->pfnWrite(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                pszSecond, cchSecond, NULL /*pcbWritten*/);
             if (pLoggerInt->fFlags & RTLOGFLAGS_FLUSH)
-                RTFileFlush(pLoggerInt->hFile);
+                pLoggerInt->pOutputIf->pfnFlush(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser);
         }
         if (pLoggerInt->cHistory)
@@ -1012,4 +1118,5 @@
                            uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
                            PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
+                           PCRTLOGOUTPUTIF pOutputIf, void *pvOutputIfUser,
                            PRTERRINFO pErrInfo, const char *pszFilenameFmt, va_list args)
 {
@@ -1113,4 +1220,5 @@
         pLoggerInt->pfnPhase                    = pfnPhase;
         pLoggerInt->hFile                       = NIL_RTFILE;
+        pLoggerInt->fLogOpened                  = false;
         pLoggerInt->cHistory                    = cHistory;
         if (cbHistoryFileMax == 0)
@@ -1122,4 +1230,17 @@
         else
             pLoggerInt->cSecsHistoryTimeSlot    = cSecsHistoryTimeSlot;
+
+        if (pOutputIf)
+        {
+            pLoggerInt->pOutputIf               = pOutputIf;
+            pLoggerInt->pvOutputIfUser          = pvOutputIfUser;
+        }
+        else
+        {
+            /* Use the default interface for output logging. */
+            pLoggerInt->pOutputIf               = &g_LogOutputIfDef;
+            pLoggerInt->pvOutputIfUser          = pLoggerInt;
+        }
+
 # else   /* !IN_RING3 */
         RT_NOREF_PV(pfnPhase); RT_NOREF_PV(cHistory); RT_NOREF_PV(cbHistoryFileMax); RT_NOREF_PV(cSecsHistoryTimeSlot);
@@ -1318,5 +1439,5 @@
             }
 # ifdef IN_RING3
-            RTFileClose(pLoggerInt->hFile);
+            pLoggerInt->pOutputIf->pfnClose(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser);
 # endif
 # if defined(RT_ARCH_X86) && !defined(LOG_USE_C99)
@@ -1350,4 +1471,5 @@
                         0 /*cBufDescs*/, NULL /*paBufDescs*/, fDestFlags,
                         NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,
+                        NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                         NULL /*pErrInfo*/, pszFilenameFmt, va);
     va_end(va);
@@ -1401,5 +1523,5 @@
      */
     if (   (pLoggerInt->fDestFlags & RTLOGDEST_FILE)
-        && pLoggerInt->hFile != NIL_RTFILE)
+        && pLoggerInt->fLogOpened)
         pLoggerInt->pfnPhase(&pLoggerInt->Core, RTLOGPHASE_END, rtlogPhaseMsgLocked);
 
@@ -1407,11 +1529,10 @@
      * Close output stuffs.
      */
-    if (pLoggerInt->hFile != NIL_RTFILE)
-    {
-        int rc2 = RTFileClose(pLoggerInt->hFile);
-        AssertRC(rc2);
+    if (pLoggerInt->fLogOpened)
+    {
+        int rc2 = pLoggerInt->pOutputIf->pfnClose(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser);
         if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
             rc = rc2;
-        pLoggerInt->hFile = NIL_RTFILE;
+        pLoggerInt->fLogOpened = false;
     }
 # endif
@@ -2443,5 +2564,5 @@
 # ifdef IN_RING3
             if (   pLoggerInt->fDestFlags & RTLOGDEST_FILE
-                && pLoggerInt->hFile == NIL_RTFILE)
+                && !pLoggerInt->fLogOpened)
             {
                 rc = rtR3LogOpenFileDestination(pLoggerInt, pErrInfo);
@@ -2654,5 +2775,6 @@
     else
     {
-        RTFileDelete(pLoggerInt->szFilename);
+        pLoggerInt->pOutputIf->pfnDelete(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                         pLoggerInt->szFilename);
         fOpen |= RTFILE_O_CREATE;
     }
@@ -2663,5 +2785,6 @@
 
     unsigned cBackoff = 0;
-    int rc = RTFileOpen(&pLoggerInt->hFile, pLoggerInt->szFilename, fOpen);
+    int rc = pLoggerInt->pOutputIf->pfnOpen(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                            pLoggerInt->szFilename, fOpen);
     while (   (   rc == VERR_SHARING_VIOLATION
                || (rc == VERR_ALREADY_EXISTS && !(pLoggerInt->fFlags & RTLOGFLAGS_APPEND)))
@@ -2670,10 +2793,15 @@
         RTThreadSleep(g_acMsLogBackoff[cBackoff++]);
         if (!(pLoggerInt->fFlags & RTLOGFLAGS_APPEND))
-            RTFileDelete(pLoggerInt->szFilename);
-        rc = RTFileOpen(&pLoggerInt->hFile, pLoggerInt->szFilename, fOpen);
+            pLoggerInt->pOutputIf->pfnDelete(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                             pLoggerInt->szFilename);
+        rc = pLoggerInt->pOutputIf->pfnOpen(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                            pLoggerInt->szFilename, fOpen);
     }
     if (RT_SUCCESS(rc))
     {
-        rc = RTFileQuerySize(pLoggerInt->hFile, &pLoggerInt->cbHistoryFileWritten);
+        pLoggerInt->fLogOpened = true;
+
+        rc = pLoggerInt->pOutputIf->pfnQuerySize(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                 &pLoggerInt->cbHistoryFileWritten);
         if (RT_FAILURE(rc))
         {
@@ -2685,5 +2813,5 @@
     else
     {
-        pLoggerInt->hFile = NIL_RTFILE;
+        pLoggerInt->fLogOpened = false;
         RTErrInfoSetF(pErrInfo, rc, N_("could not open file '%s' (fOpen=%#x)"), pLoggerInt->szFilename, fOpen);
     }
@@ -2734,5 +2862,5 @@
      * Close the old log file.
      */
-    if (pLoggerInt->hFile != NIL_RTFILE)
+    if (pLoggerInt->fLogOpened)
     {
         /* Use the callback to generate some final log contents, but only if
@@ -2746,6 +2874,6 @@
             pLoggerInt->fDestFlags = fODestFlags;
         }
-        RTFileClose(pLoggerInt->hFile);
-        pLoggerInt->hFile = NIL_RTFILE;
+
+        pLoggerInt->pOutputIf->pfnClose(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser);
     }
 
@@ -2767,14 +2895,16 @@
 
             unsigned cBackoff = 0;
-            int rc = RTFileRename(szOldName, szNewName, RTFILEMOVE_FLAGS_REPLACE);
+            int rc = pLoggerInt->pOutputIf->pfnRename(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                      szOldName, szNewName, RTFILEMOVE_FLAGS_REPLACE);
             while (   rc == VERR_SHARING_VIOLATION
                    && cBackoff < RT_ELEMENTS(g_acMsLogBackoff))
             {
                 RTThreadSleep(g_acMsLogBackoff[cBackoff++]);
-                rc = RTFileRename(szOldName, szNewName, RTFILEMOVE_FLAGS_REPLACE);
+                rc = pLoggerInt->pOutputIf->pfnRename(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                      szOldName, szNewName, RTFILEMOVE_FLAGS_REPLACE);
             }
 
             if (rc == VERR_FILE_NOT_FOUND)
-                RTFileDelete(szNewName);
+                pLoggerInt->pOutputIf->pfnDelete(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser, szNewName);
         }
 
@@ -2786,5 +2916,5 @@
             char szExcessName[sizeof(pLoggerInt->szFilename) + 32];
             RTStrPrintf(szExcessName, sizeof(szExcessName), "%s.%u", pLoggerInt->szFilename, i);
-            int rc = RTFileDelete(szExcessName);
+            int rc = pLoggerInt->pOutputIf->pfnDelete(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser, szExcessName);
             if (RT_FAILURE(rc))
                 break;
@@ -2846,5 +2976,5 @@
 
         /* If the file is not open then rotation is not set up. */
-        if (pLoggerInt->hFile == NIL_RTFILE)
+        if (!pLoggerInt->fLogOpened)
         {
             pLoggerInt->cbHistoryFileWritten = 0;
@@ -3154,9 +3284,10 @@
         if ((pLoggerInt->fDestFlags & (RTLOGDEST_FILE | RTLOGDEST_RINGBUF)) == RTLOGDEST_FILE)
         {
-            if (pLoggerInt->hFile != NIL_RTFILE)
+            if (pLoggerInt->fLogOpened)
             {
-                RTFileWrite(pLoggerInt->hFile, pchToFlush, cchToFlush, NULL);
+                pLoggerInt->pOutputIf->pfnWrite(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser,
+                                                pchToFlush, cchToFlush, NULL /*pcbWritten*/);
                 if (pLoggerInt->fFlags & RTLOGFLAGS_FLUSH)
-                    RTFileFlush(pLoggerInt->hFile);
+                    pLoggerInt->pOutputIf->pfnFlush(pLoggerInt->pOutputIf, pLoggerInt->pvOutputIfUser);
             }
             if (pLoggerInt->cHistory)
Index: /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 94623)
+++ /trunk/src/VBox/VMM/VMMR0/VMMR0.cpp	(revision 94624)
@@ -3330,4 +3330,5 @@
                            VMMLOGGER_BUFFER_COUNT, pR0Log->aBufDescs, RTLOGDEST_DUMMY,
                            NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,
+                           NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                            NULL /*pErrInfo*/, NULL /*pszFilenameFmt*/);
     if (RT_SUCCESS(rc))
Index: /trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
===================================================================
--- /trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp	(revision 94623)
+++ /trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp	(revision 94624)
@@ -3956,4 +3956,5 @@
                            logHeaderFooter /* pfnPhase */ ,
                            10 /* cHistory */, 100 * _1M /* cbHistoryFileMax */, RT_SEC_1DAY /* cSecsHistoryTimeSlot */,
+                           NULL /*pOutputIf*/, NULL /*pvOutputIfUser*/,
                            NULL /* pErrInfo */, "%s", szLogFile);
         if (RT_SUCCESS(rc))
