Getting Logs for a Job

View console logs for a job in Resource Manager.

Note

For plan jobs, the log file is the execution plan. Review the execution plan to ensure that it accurately reflects your intentions. View the log file and note the "message" fields in the sequence of log entries of the log file. These values represent the sequence of operations specified in your configuration.

If you see problems or errors and wish to make changes, then update the appropriate Terraform configuration (.tf file), update the stack to use the revised configuration, run a plan job, and then review the new execution plan (output of the plan job).

Using the Console

  1. Open the navigation menu and click Developer Services. Under Resource Manager, click Jobs.
    You can also access jobs from a stack detail page. Click Stacks and then click the name of the stack you want.
  2. Choose a compartment that you have permission to work in (on the left side of the page).
  3. Click the name of the job that you want.
    The Job details page opens. Logs are visible (in the Logs section under Resources).

Using the CLI

Use the oci resource-manager job get-job-logs command and required parameters to get logs for a job as a paged list of entries.

oci resource-manager job get-job-logs [OPTIONS]

For a complete list of flags and variable options for CLI commands, see the Command Line Reference for Resource Manager.

Example Response for a Plan Job

The command returns JSON objects that describe log entries. Each object has a message member with a property that displays one line of the execution plan. In this example, the plan job creates a single virtual cloud network (VCN); the remaining members show details about the VCN.

...
                {
                "level": "INFO",
                "message": "Terraform will perform the following actions:",
                "timestamp": "2018-05-24T00:57:14.170000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "",
                "timestamp": "2018-05-24T00:57:14.170000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "+ oci_core_virtual_network.vcn1",
                "timestamp": "2018-05-24T00:57:14.170000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "id: <computed>",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "cidr_block:  \"10.0.0.0/16\",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "compartment_id:  \"ocid1.tenancy.oc1..exampleaqnpcpfqfmrf6dw5gcew7yqpirvarueirj2mv4jzn5goejsxma\",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "default_dhcp_options_id:  <computed_value>",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "      default_route_table_id: <computed_value>",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                {
                "level": "INFO",
                "message": "      default_security_list_id: <computed_value>",
                "timestamp": "2018-05-24T00:57:14.172000+00:00",
                "type": "TERRAFORM_CONSOLE"
                },
                ...
              

Using the API

Use the GetJobLogs operation to get logs for a job.