Details for DevOps Logging
Logging details for DevOps logs.
Resources
- devopsproject
Log Categories
API value (ID): | Console (Display Name) | Description |
---|---|---|
all | DevOps Logs | Includes all DevOps service-related logs. |
Availability
DevOps logging is available in all the regions of the commercial realms.
Comments
You can enable DevOps logs for a given project, which means deployments are logged for all the pipelines inside that project. For more information, see DevOps Logs.
Contents of a DevOps Log
A DevOps log record contains the following fields:
Field | Description | Example |
---|---|---|
specversion | Oracle Cloud Infrastructure Logging schema version. | 1.0 |
type | Category of the log. Possible values:
|
com.oraclecloud.devops.build, com.oraclecloud.devops.deployment |
source | Name of the Project the log is associated with or OCID of the build pipeline to which the log belongs to. | myDemoProject,
ocid1.devopsbuildpipeline.oc1.<region_ID> .<unique_ID> |
subject | OCID of the target resource where the deployment is getting
executed or OCID of the build run for the build pipeline to which
the logs belong to. Possible values for target resource:
|
ocid1.devopsbuildrun.oc1.<region_ID> .<unique_ID> ,
ocid1.instance.oc1.<region_ID> .<unique_ID> |
id | Random UUID, unique to each log entry. | e3002eaa-d717-472e-8474-d024943a0f27 |
time | Time the log was generated in the DevOps Service. | 2021-02-18T18:21:52.024Z |
oracle.loggroupid | OCID of the log group. | ocid1.<loggroup>.oc1.<region_ID>.<unique_ID> |
oracle.logid | OCID of the service log object. | ocid1.log.oc1.<region_id>.<unique_ID> |
oracle.tenantid | OCID of the tenancy. | ocid1.<tenancy>.oc1..<unique_ID> |
oracle.compartmentid | OCID of the compartment that the log group belongs to. | ocid1.<compartment>.oc1..<unique_ID> |
oracle.ingestedtime | The time the log was ingested by OCILogging. | 2021-02-18T18:22:01.453Z |
data.buildRunId | OCID of the build run with which log message is associated. | ocid1.devopsbuildrun.oc1.<region_ID> .<unique_ID> |
data.buildPipelineId | OCID of the build pipeline with which the log message is associated. | ocid1.devopsbuildpipeline.oc1.<region_ID> .<unique_ID> |
data.buildStageId | OCID of the build pipeline stage with which the log message is associated. | ocid1.devopsbuildpipelinestage.oc1.<region_ID> .<unique_ID> |
data.deploymentId | OCID of the deployment with which log message is associated. | ocid1.devopsdeployment.oc1.<region_ID>.<unique_ID> |
data.deployPipelineId | OCID of the deployment pipeline ID with which the log message is associated. | ocid1.devopsdeploypipeline.oc1.<region_ID>.<unique_ID> |
data.deployStageId | OCID of the deploy stage ID with which the log message is associated. | ocid1.devopsdeploystage.oc1.<region_ID>.<unique_ID> |
data.message | DevOps service log message. | Manual Approval stage: Waiting for required approvals. |
data.producer | Producer of the log message. Some of the logs are produced by the
DevOps service code, while other logs are produced by scripts from
the customer. For example, the deployment service can run scripts
provided by the customer during the deployment to instance groups.
Such customer-provided scripts could produce STDOUT and STDERROR
messages, which are also included in the log. The producer field can
distinguish them accordingly. Possible Values:
|
DEVOPS_SERVICE |
Sample DevOps Logs
Sample build log:
{
"specversion": "1.0",
"type": "com.oraclecloud.devops.build",
"source": "OCID of the build pipeline to which the log belongs",
"subject": "ocid1.devopsbuildrun.oc1.<region_ID>.<unique_ID>",
"id": "27868e6f-b91d-4318-868e-6fb91d9318e9",
"time": "2020-10-18T21:02:40.58Z",
"oracle": {
"logid": "ocid1.log.oc1.<region_ID>.<unique_ID>",
"loggroupid": "ocid1.<loggroup>.oc1.<region_ID>.<unique_ID>",
"tenantid": "ocid1.<tenancy>.oc1..<unique_ID>",
"compartmentid": "ocid1.<compartment>.oc1..<unique_ID>",
"ingestedtime": "2020-10-18T21:02:40.58Z",
},
"data": {
"buildPipelineId": "ocid1.devopsbuildpipeline.oc1.<region_ID>.<unique_ID>",
"buildRunId": "ocid1.devopsbuildrun.oc1.<region_ID>.<unique_ID>",
"buildStageId": "ocid1.devopsbuildpipelinestage.oc1.<region_ID>.<unique_ID>",
"message": ""Starting BUILD_SPEC_EXECUTION"",
"producer": "DEVOPS_SERVICE"
}
}
Sample deployment log:
{
"specversion": "1.0",
"type": "com.oraclecloud.devops.deployment",
"source": "Project name",
"subject": "ocid1.instance.oc1.<region_ID>.<unique_ID>",
"id": "e3002eaa-d717-472e-8474-d024943a0f27",
"time": "2020-10-18T21:02:40.58Z",
"oracle": {
"logid": "ocid1.log.oc1.<region_ID>.<unique_ID>",
"loggroupid": "ocid1.<loggroup>.oc1.<region_ID>.<unique_ID>",
"tenantid": "ocid1.<tenancy>.oc1..<unique_ID>",
"compartmentid": "ocid1.<compartment>.oc1..<unique_ID>",
"ingestedtime": "2020-10-18T21:02:40.58Z",
},
"data": {
"deploymentId": "ocid1.devopsdeployment.oc1.<region_ID>.<unique_ID>",
"deployPipelineId": "ocid1.devopsdeploypipeline.oc1.<region_ID>.<unique_ID>",
"deployStageId": "ocid1.devopsdeploystage.oc1.<region_ID>.<unique_ID>",
"message": "Manual Approval stage: Waiting for required approvals",
"producer": "DEVOPS_SERVICE"
}
}
Using CLI to View Deployment Logs
Run the following CLI command providing the given details. The compartment, log group, and the log associated with the DevOps project. Time range, which is related to the time of deployment. You can filter the result by
deploymentId
:- REGION, for example,
us-ashburn-1
- START_YYYY_MM_DD, for example,
2023-01-09
- END_YYYY_MM_DD, for example,
2023-01-10
- COMPARTMENT_ID, for example,
ocid1.compartment.oc1..<unique_ID>
- LOG_GROUP, for example,
ocid1.loggroup.oc1.<region_ID>.<unique_ID>
- LOG, for example,
ocid1.log.oc1.<region_ID>.<unique_ID>
- DEPLOYMENT_ID, for example,
ocid1.devopsdeployment.oc1.<region_ID>.<unique_ID>
oci logging-search search-logs --region ${REGION} --time-start ${START_YYYY_MM_DD} --time-end ${END_YYYY_MM_DD} --search-query "search \"${COMPARTMENT_ID}/${LOG_GROUP}/${LOG}\" | where data.deploymentId = '${DEPLOYMENT_ID}'"
Sample log output:
{
"data": {
"fields": null,
"results": [
{
"data": {
"datetime": 1673308749702,
"logContent": {
"data": {
"deployPipelineId": "ocid1.devopsdeploypipeline.oc1.<region_ID>,<unique_ID>",
"deployStageId": "",
"deploymentId": "ocid1.devopsdeployment.oc1.<region_ID>,<unique_ID>",
"message": "Starting Deployment execution",
"producer": "DEVOPS_SERVICE"
},
"id": "c871db9d-857a-498e-81ae-245fcf77e827",
"oracle": {
"compartmentid": "ocid1.compartment.oc1..<unique_ID>",
"ingestedtime": "2023-01-09T23:59:10.012Z",
"loggroupid": "ocid1.loggroup.oc1.<region_ID>,<unique_ID>",
"logid": "ocid1.log.oc1.<region_ID>,<unique_ID>",
"tenantid": "ocid1.tenancy.oc1..<unique-ID>"
},
"source": "my_proj",
"specversion": "1.0",
"subject": "",
"time": "2023-01-09T23:59:09.702Z",
"type": "com.oraclecloud.devops.deployment"
}
}
},
{
"data": {
"datetime": 1673308794062,
"logContent": {
"data": {
"deployPipelineId": "ocid1.devopsdeploypipeline.oc1.<region_ID>,<unique_ID>",
"deployStageId": "ocid1.devopsdeploystage.oc1.<region_ID>,<unique_ID>",
"deploymentId": "ocid1.devopsdeployment.oc1.<region_ID>,<unique_ID>",
"message": "Helm chart deployment completed",
"producer": "DEVOPS_SERVICE"
},
"id": "f90969d1-6fbc-49c1-928f-afc623829c64",
"oracle": {
"compartmentid": "ocid1.compartment.oc1..<unique_id>",
"ingestedtime": "2023-01-10T00:00:03.947Z",
"loggroupid": "ocid1.loggroup.oc1.<region_ID>,<unique_ID>",
"logid": "ocid1.log.oc1.<region_ID>,<unique_ID>",
"tenantid": "ocid1.tenancy.oc1..<unique_id>"
},
"source": "my_proj",
"specversion": "1.0",
"subject": "",
"time": "2023-01-09T23:59:54.062Z",
"type": "com.oraclecloud.devops.deployment"
}
}
}
],
"summary": {
"field-count": null,
"result-count": 28
}
}
}