Getting Logs for a Job

View console logs for a job in Resource Manager.

Note

For plan jobs, the log file is the same as the execution plan. Review the execution plan to ensure that it lists the resources you intend to provision. View the log file and note the "message" fields in the sequence of log entries. These values represent the sequence of operations specified in the configuration.

If you see problems or errors and want 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).

  • These steps show how to get logs for a job in a compartment. You can also get logs for a job in a stack.
    1. On the Jobs list page, select the job that you want to work with. If you need help finding the list page or the stack, see Listing Jobs.
    2. On the job's details page, select Logs.
  • 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 parameters and values 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"
                    },
                    ...
                  
  • Use the GetJobLogs operation to get logs for a job.