Thursday, March 31, 2016

Easy way to collect debug logging data in a text file format - App-V

When ever an issue happens, we tend to look into App-V logs in the eventviewer for more information.The even logs are located at Applications and Services Logs/Microsoft/AppV/<App-V component>

To view the entire logs, select View > Show Analytic and Debug Logs in the Event Viewer. Beginning App-V 5.0 SP3 App-V logs are further consolidated. To know more check in the below link.


https://technet.microsoft.com/en-us/library/dn858700(v=vs.85).aspx#BKMK_event_logs_moved


After enabling analytic and debug logs, you can see the view of the Eventviewer below.





Traversing through these logs to find the issue is quite time taking and tedious. If you know where to look by looking into the error code it is fine. If not then it is complex.


Recently Microsoft has released a KB article which explains how to collect debug trace and give output in a text file. You can use the PowerShell command to collect a debug trace on an App-V 5.0 client, sequencer, or server.


Copy the below code and save it as a Powershell script (Appvlogtrace.ps1)


logman create trace AppVKB3037955Debug -o AppVDebug.ETL -cnf 01:00:00 -nb 10 250 -bs 16 -max 512 -ow -y
$providers = Get-WinEvent -ListProvider *Microsoft-Appv-* | Select-Object Name | Where-Object -Property Name -NotMatch "SharedPerformance"
foreach ($provider in $providers) { logman update trace AppVkb3037955Debug -p $($provider.Name) 0xe000000000ffffff 0x5 | Out-Null }
Logman Start AppVKB3037955Debug

cls
$nil = Read-Host "Please reproduce your issue now. Press [ENTER] when done." 

Logman Stop AppVKB3037955Debug
dir *AppVDebug*.etl | foreach { netsh trace convert $_ overwrite=yes}
Logman Delete AppVKB3037955Debug 

Open an elevated PowerShell window, and then run the PowerShell script to enable tracing and to reproduce your issue.

After executing the script it will prompt the "Please reproduce your issue now" message.Because traces can quickly grow very large, try to reproduce the issue as soon as possible and hit ENTER once the issue is reproduced.






After seeing the above prompt to reproduce the issue, I ran the test command which shows error. (This is just a simple test example . However you can even use this for complex errors too which Trentent Tye has explained in his blog in detail)


Once the issue is reproduced, quickly hit ENTER.


You can see the trace output file in the Dump file location as shown above in AppVDebug_<Number>.txt format.




Trentent Tye Blog - http://trentent.blogspot.ca/2016/03/appv5-pacakge-guid-version-guid-failed.html


Microsoft KB Article - https://support.microsoft.com/en-us/kb/3037955

No comments:

Post a Comment