{"id":67,"date":"2009-10-01T15:07:19","date_gmt":"2009-10-01T04:07:19","guid":{"rendered":"http:\/\/threemillion.net\/blog\/?p=67"},"modified":"2010-03-14T20:42:49","modified_gmt":"2010-03-14T09:42:49","slug":"view-active-virtualcenter-2-0-x-log-file","status":"publish","type":"post","link":"https:\/\/threemillion.net\/blog\/?p=67","title":{"rendered":"View Active VirtualCenter 2.0.x Log File"},"content":{"rendered":"<p>I was looking for a way to view the current VirtualCenter log file, and since VC uses a rotating log system I couldn&#8217;t simply have a shortcut on my desktop to go to the log.<br \/>\nVC does a simple 0 to 9 log file (vpxd-0.log to vpxd-9.log) rotation using an index file (vpxd-index) to record the which file is the current file.<br \/>\nTwo things initiate a rotation of the logs. One is the starting, or restarting, of the VMware VirtualCenter Server service. The other is when the log file reaches 5MB.<br \/>\nSo with the help of some search engines results, I cobbled together the following batch file to get the active log file and then tail it.<br \/>\n[cmd]<br \/>\n@echo off<br \/>\necho.<br \/>\necho Tailing the current VirtualCenter log file<br \/>\necho.<\/p>\n<p>SET LogDir=C:\\Documents and Settings\\&lt;strong&gt;user_account&lt;\/strong&gt;\\Local Settings\\Temp\\vpx\\<\/p>\n<p>REM Get the current log file number being used<br \/>\nSET \/p LogNum=&amp;lt;&quot;%LogDir%vpxd-index&quot;<\/p>\n<p>echo Starting the tailing process<br \/>\nSTART &quot;Tailing VirualCenter Log vpxd-%LogNum%.log (Ctrl + C to Close)&quot; \/D &quot;%LogDir%&quot; tail -f &quot;%LogDir%vpxd-%LogNum%.log&quot;<br \/>\n[\/cmd]<\/p>\n<p>A quick note to replace <strong>user_account<\/strong> with the correct directory. In my environment this is an Active Directory service account especially set up to run VirtualCenter. I shall need to check, however, from memory I if the service is still being run as Local System, which is the default on installation, then the log files are located in C:\\Windows\\Temp\\vpx\\.<\/p>\n<p>I know a batch file not the most up to date in scripting technology but it works and does I what I need it to do.<\/p>\n<p>One thing this script does not do, is detect when the log file is rotated whilst being tailed. Something for a future version, maybe.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was looking for a way to view the current VirtualCenter log file, and since VC uses a rotating log system I couldn&#8217;t simply have a shortcut on my desktop <a href=\"https:\/\/threemillion.net\/blog\/?p=67\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[10,4,18],"tags":[],"class_list":["entry","author-admin","post-67","post","type-post","status-publish","format-standard","category-batch","category-virtualisation","category-vmware-virtualisation"],"_links":{"self":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":7,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/260"}],"wp:attachment":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}