locked
Dynamic Logfile Naming in Visual Studio (2013 in my case) RRS feed

  • Question

  • Hi Folks

    This code below works (in a .cmd file, by right-clicking the .cmd and selecting run as administrator):

    for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
    set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%_%ldt:~8,2%:%ldt:~10,2%:%ldt:~12,6%
    echo %ldt%
    set log=%userprofile%\%ldt%_activitylog.xml
    echo %log%
    set dev="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe /log %log%"
    echo %dev%

    pause
    C:\Windows\System32\runas.exe /netonly /user:mydomain\myusername "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe /log"
    REM C:\Windows\System32\runas.exe /netonly /user:mydomain\
    myusername"%dev%"

    But I want the LAST line to work (the one that's commented with the "REM" and not the line before it).

    This will give me a DATE STAMPED ActivityLog.xml file naming.

    I'ved tried several variants and I'm not quite sure what VS2013 is choking on, nor does the err message make sense.

    (please note that you need to change the "mydomain\myusername"  portion)


    Rob K


    Rob K

    Tuesday, September 16, 2014 5:07 PM

All replies

  • one crazy thing for the way it's working right now is that an ActivityLog.xslt is created, but nothing else?

    (even though I'm testing a SSRS extension AND I'm throwing errors in my Custom Query Designer)

    Thanks


    Rob K

    Tuesday, September 16, 2014 5:20 PM
  • found the ActivityLog.xml here:

    c:\Users\rKaratzas\AppData\Roaming\Microsoft\VisualStudio\12.0

    and found the ActivityLog.xslt here:

    Is this what I should be expecting?


    Rob K

    Tuesday, September 16, 2014 5:49 PM
  • sorry, here: c:\Users\rKaratzas\

    (bloody copy-n-paste just has good days and bad days from remote desktop to my VM...)


    Rob K

    Tuesday, September 16, 2014 5:53 PM
  • sadly, from what I do see in the log, it shows nothing about the Custom Query Designer extension error on showing in the IDE   :(

    I'm looking at:

    "C:\Program Files\Internet Explorer\iexplore.exe" C:\Users\myusername\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml


    Rob K

    Tuesday, September 16, 2014 6:34 PM
  • if I'm STUCK with not being able to do the naming dynamically, I'd like to be able to AT LEAST clear the file ActivityLog.xml before I start logging again.

    i can use this (which works):

    dir C:\Users\rKaratzas\AppData\Roaming\Microsoft\VisualStudio\12.0 -recurse -filter activitylog.xml |%{ Set-Content -Path $_.FullName -Value $null

    dir %userprofile%\AppData\Roaming\Microsoft\VisualStudio\12.0 -recurse -filter activitylog.xml |%{ Set-Content -Path $_.FullName -Value $null}

    chokes (even though the error is showing the correct path)


    Rob K

    Tuesday, September 16, 2014 7:38 PM
  • Hi Rob K,

    Please firstly check this MSDN Document:

    http://msdn.microsoft.com/en-us//library/ms241272.aspx

    This   switch must appear at the end of the command line, after all other switches.

    The   log is written for all instances of Visual Studio that you've invoked with   the /log switch. It doesn't log instances of Visual Studio that you've   invoked without the switch.

    When you use /log argument to start devenv.exe, this VS instance should use the new log file path. So the log file path is

    %userprofile%\%ldt%_activitylog.xml

    I recommend that you firstly use some simple cmd statements to start the VS IDE, make sure it properly set the log file path. Then write these cmd statements in a bat file. The /log argument is very simple, the problem should be with your cmd statements. You could use some batch debugger tool to debug your cmd statements. Your question is actually irrelavent with Visual Studio Integrate.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    • Edited by Caillen Wednesday, September 17, 2014 9:40 AM
    Wednesday, September 17, 2014 9:39 AM
  • thank you (this was support to be in the VS setup forum)

    i'll have to keep asking and/or repost (since my logfile path is exactly what you have)

    Rob


    Rob K

    Wednesday, September 17, 2014 11:05 AM