// Module included in the following assemblies:
//
// backup_and_restore/application_backup_and_restore/oadp-self-service/oadp-self-service-namespace-admin-use-cases.adoc

:_mod-docs-content-type: PROCEDURE
[id="oadp-self-service-nab-nar-logs_{context}"]
= Reviewing NAB and NAR logs

[role="_abstract"]
Create a `NonAdminDownloadRequest` (NADR) custom resource (CR) to access and review detailed logs for `NonAdminBackup` (NAB) and `NonAdminRestore` (NAR) operations. This helps you troubleshoot backup and restore issues independently.

[NOTE]
====
You can review the NAB logs only if you are using a `NonAdminBackupStorageLocation` (NABSL) CR as a backup storage location for the backup.
====

.Prerequisites

* You are logged in to the cluster as a namespace admin user.
* The cluster administrator has installed the {oadp-short} Operator.
* The cluster administrator has configured the `DataProtectionApplication` (DPA) CR to enable {oadp-short} Self-Service.
* The cluster administrator has created a namespace for you and has authorized you to operate from that namespace.
* You have a backup of your application by creating a NAB CR.
* You have restored the application by creating a NAR CR.

.Procedure

. To review NAB CR logs, create a `NonAdminDownloadRequest` CR and specify the NAB CR name as shown in the following example:
+
.Example `NonAdminDownloadRequest` CR
[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminDownloadRequest
metadata:
  name: test-nadr-backup
spec:
  target:
    kind: BackupLog
    name: test-nab
----
+
where:

`kind`:: Specifies `BackupLog` as the value for the `kind` field of the NADR CR.
`name`:: Specifies the name of the NAB CR.

. Verify that the NADR CR is processed by running the following command:
+
[source,terminal]
----
$ oc get nadr test-nadr-backup -o yaml 
----
+
.Example output

[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminDownloadRequest
metadata:
  creationTimestamp: "2025-03-06T10:05:22Z"
  generation: 1
  name: test-nadr-backup
  namespace: test-nac-ns
  resourceVersion: "134866"
  uid: 520...8d9
spec:
  target:
    kind: BackupLog
    name: test-nab
status:
  conditions:
  - lastTransitionTime: "202...5:22Z"
    message: ""
    reason: Success
    status: "True"
    type: Processed
  phase: Created
  velero:
    status:
      downloadURL: https://...
      expiration: "202...22Z"
      phase: Processed
----
+
where:

`downloadURL`:: The `status.downloadURL` field contains the download URL of the NAB logs. You can use the `downloadURL` to download and review the NAB logs.
`phase`:: The `status.phase` is `Processed`.

. Download and analyze the backup information by using the `status.downloadURL` URL.

. To review NAR CR logs, create a `NonAdminDownloadRequest` CR and specify the NAR CR name as shown in the following example:
+
.Example `NonAdminDownloadRequest` CR
[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminDownloadRequest
metadata:
  name: test-nadr-restore
spec:
  target:
    kind: RestoreLog
    name: test-nar
----
+
where:

`kind`:: Specifies `RestoreLog` as the value for the `kind` field of the NADR CR.
`name`:: Specifies the name of the NAR CR.

. Verify that the NADR CR is processed by running the following command:
+
[source,terminal]
----
$ oc get nadr test-nadr-restore -o yaml
----
+
.Example output

[source,yaml]
----
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminDownloadRequest
metadata:
  creationTimestamp: "2025-03-06T11:26:01Z"
  generation: 1
  name: test-nadr-restore
  namespace: test-nac-ns
  resourceVersion: "157842"
  uid: f3e...7862f
spec:
  target:
    kind: RestoreLog
    name: test-nar
status:
  conditions:
  - lastTransitionTime: "202..:01Z"
    message: ""
    reason: Success
    status: "True"
    type: Processed
  phase: Created
  velero:
    status:
      downloadURL: https://...
      expiration: "202..:01Z"
      phase: Processed
----
+
where:

`downloadURL`:: The `status.downloadURL` field contains the download URL of the NAR logs. You can use the `downloadURL` to download and review the NAR logs.
`phase`:: The `status.phase` is `Processed`.

. Download and analyze the restore information by using the `status.downloadURL` URL.