Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 28342)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 28343)
@@ -4968,4 +4968,20 @@
 }
 
+STDMETHODIMP Machine::QueryLogFilename(ULONG aIdx, BSTR *aName)
+{
+    CheckComArgOutPointerValid(aName);
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    Utf8Str log = queryLogFilename(aIdx);
+    if (RTFileExists(log.c_str()))
+        log.cloneTo(aName);
+
+    return S_OK;
+}
+
 STDMETHODIMP Machine::ReadLog(ULONG aIdx, ULONG64 aOffset, ULONG64 aSize, ComSafeArrayOut(BYTE, aData))
 {
@@ -4979,19 +4995,5 @@
 
     HRESULT rc = S_OK;
-    Utf8Str logFolder;
-    getLogFolder(logFolder);
-    Assert(logFolder.length());
-    ULONG uLogHistoryCount = 3;
-    ComPtr<ISystemProperties> systemProperties;
-    mParent->COMGETTER(SystemProperties)(systemProperties.asOutParam());
-    if (!systemProperties.isNull())
-        systemProperties->COMGETTER(LogHistoryCount)(&uLogHistoryCount);
-    Utf8Str log;
-    if (aIdx == 0)
-        log = Utf8StrFmt("%s%cVBox.log",
-                         logFolder.raw(), RTPATH_DELIMITER);
-    else
-        log = Utf8StrFmt("%s%cVBox.log.%d",
-                         logFolder.raw(), RTPATH_DELIMITER, aIdx);
+    Utf8Str log = queryLogFilename(aIdx);
 
     /* do not unnecessarily hold the lock while doing something which does
@@ -5150,4 +5152,22 @@
                                  RTPATH_DELIMITER);
     }
+}
+
+/**
+ *  Returns the full path to the machine's log file for an given index.
+ */
+Utf8Str Machine::queryLogFilename(ULONG idx)
+{
+    Utf8Str logFolder;
+    getLogFolder(logFolder);
+    Assert(logFolder.length());
+    Utf8Str log;
+    if (idx == 0)
+        log = Utf8StrFmt("%s%cVBox.log",
+                         logFolder.raw(), RTPATH_DELIMITER);
+    else
+        log = Utf8StrFmt("%s%cVBox.log.%d",
+                         logFolder.raw(), RTPATH_DELIMITER, idx);
+    return log;
 }
 
@@ -8755,5 +8775,5 @@
  *  @note Not thread safe (must be called from this object's lock).
  */
-bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */)
+bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */) const
 {
     Utf8Str settingsDir = mData->m_strConfigFileFull;
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 28342)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 28343)
@@ -4144,5 +4144,5 @@
   <interface
      name="IMachine" extends="$unknown"
-     uuid="21f56f5d-d0fc-49e5-9ea7-91639278f424"
+     uuid="fe51e0c8-7e48-4847-95f0-fc8532f3b480"
      wsmap="managed"
      >
@@ -6003,4 +6003,21 @@
     </method>
 
+    <method name="queryLogFilename">
+      <desc>
+        Queries for the VM log file name of an given index. Returns an empty
+        string if a log file with that index doesn't exists.
+      </desc>
+      <param name="idx" type="unsigned long" dir="in">
+        <desc>
+          Which log file name to query. 0=current log file.
+        </desc>
+      </param>
+      <param name="filename" type="wstring" dir="return">
+        <desc>
+          On return the full path to the log file or an empty string on error.
+        </desc>
+      </param>
+    </method>
+
     <method name="readLog">
       <desc>
Index: /trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MachineImpl.h	(revision 28342)
+++ /trunk/src/VBox/Main/include/MachineImpl.h	(revision 28343)
@@ -518,4 +518,5 @@
     STDMETHOD(HotUnplugCPU(ULONG aCpu));
     STDMETHOD(GetCPUStatus(ULONG aCpu, BOOL *aCpuAttached));
+    STDMETHOD(QueryLogFilename(ULONG aIdx, BSTR *aName));
     STDMETHOD(ReadLog(ULONG aIdx, ULONG64 aOffset, ULONG64 aSize, ComSafeArrayOut(BYTE, aData)));
 
@@ -628,4 +629,5 @@
 
     void getLogFolder(Utf8Str &aLogFolder);
+    Utf8Str queryLogFilename(ULONG idx);
 
     HRESULT openSession(IInternalSessionControl *aControl);
@@ -786,5 +788,5 @@
     void rollbackMedia();
 
-    bool isInOwnDir(Utf8Str *aSettingsDir = NULL);
+    bool isInOwnDir(Utf8Str *aSettingsDir = NULL) const;
 
     void rollback(bool aNotify);
