Pivotal Knowledge Base

Follow

How to obtain logs from PCF

Environment

Product Version
Pivotal Cloud Foundry Operations Manager 1.7.x, 1.8.x

Purpose

This article discusses how to gather sets of logs for different high level symptoms.

Procedure

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]

Example:

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`

Manually 

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.

Example:

$ 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 bosh/log/@4000000057f1d72c392639e4.s 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.

Additional Information 

For more documentation as to all the different types of logs to gather and how they can be accessed, can be located here.

 

Comments

Powered by Zendesk