|Pivotal Cloud Foundry Operations Manager||1.7.x, 1.8.x|
This article discusses how to gather sets of logs for different high level symptoms.
Viewing logs for Elastic Runtime components
To troubleshoot specific Elastic Runtime components by viewing their log files, browse to the Ops Manager interface. More information and procedures can be located here.
Using bosh logs
Log into the BOSH director VM, instructions located here. Executing bosh logs gathers a job or agent log from a VM, that supports the ability to custom filter for job logs. Refer to example below. More information can also be located here.
$ bosh logs JOB [INDEX] [--agent] [--job] [--only filter1,filter2,...] [--dir DESTINATION_DIRECTORY]
ubuntu@pivotal-ops-manager:~$ bosh logs cloud_controller-partition-20bc6a9176da72780c3b 0 Acting as user 'director' on deployment 'cf-6459b57b83e9c423ef95' on 'p-bosh-e2258c2b24ba4aa2147c' Director task 3062 Started fetching logs for cloud_controller-partition-20bc6a9176da72780c3b/0 > Finding and packing log files. Done (00:00:13) Task 3062 done Started 2016-10-03 21:04:52 UTC Finished 2016-10-03 21:05:05 UTC Duration 00:00:13 Downloading log bundle (911b0b74-d70b-4258-644e-62b2167215a5)... Logs saved in `/home/ubuntu/cloud_controller-partition-20bc6a9176da72780c3b.0.2016-10-03-21-05-12.tgz`
To access and retrieve logs from any VM you will need to bosh ssh into the VM, instructions here. From there you will need to view and zip up the logs located within the /var/vcap/sys/log and /var/vcap/bosh/log directories. Lastly, either scp the files off the VM to another host or use bosh scp to download them from the VM.
$ bosh ssh uaa Acting as user 'director' on deployment 'cf-d64352fb2b6448ffaf14' on 'p-bosh-52be3fb48efa2c6c8210' ...
Starting interactive shell on job uaa/
$ sudo su # tar vczf /tmp/logs.tar.gz -C /var/vcap sys/log/ bosh/log/ sys/log/ sys/log/route_registrar_ctl.log sys/log/uaa/ ... bosh/log/ntpdate.out bosh/log/lock email@example.com bosh/log/current # exit $ exit $ bosh scp --download uaa 0 /tmp/logs.tar.gz . Acting as user 'director' on deployment 'cf-d64352fb2b6448ffaf14' on 'p-bosh-52be3fb48efa2c6c8210' ...
Downloaded file to ./logs.tar.gz.uaa.
For more documentation as to all the different types of logs to gather and how they can be accessed, can be located here.