简体   繁体   中英

How to get logs of eventarc events

In the documentation, the firebase resize extension has the piece of code

exports.onimageresized = onCustomEventPublished(
    "firebase.extensions.storage-resize-images.v1.complete",
    (event) => {
      logger.info("Received image resize completed event", event);
      // For example, write resized image details into Firestore.
      return getFirestore()
          .collection("images")
          .doc(event.subject.replace("/", "_")) // original file path
          .set(event.data); // resized images paths and sizes
    });

only when I check for that log in the function logs, there is nothing, only a create operation log(for when the function was deployed). Weird thing is the function still writes to firestore, I actually thought it was not firing. Where are the eventarc logs read from, I cannot seem to find them

The following types of audit logs are available for Eventarc:

  • Admin Activity audit logs Includes "admin write" operations that write metadata or configuration information. You can't disable Admin Activity audit logs.
  • Data Access audit logs Includes "admin read" operations that read metadata or configuration information. Also includes "data read" and "data write" operations that read or write user-provided data.

To receive Data Access audit logs, you must explicitly enable them. Eventarc audit logs use the service name eventarc.googleapis.com. Eventarc audit logs use the resource type audited_resource for all audit logs.
You can view audit logs in Cloud Logging by using the Google Cloud console, the Google Cloud CLI, or the Logging API.
To view directly using the Cloud console follow the below steps:

  1. In the Google Cloud console, go to the Logging> Logs Explorer page Select an existing Cloud project, folder, or organization.
  2. In the Query builder pane,In Resource type, select the Google Cloud resource whose audit logs you want to see and in Log name, select the audit log type that you want to see.

If you're experiencing issues when trying to view logs in the Logs Explorer, see the troubleshooting information.
Also check the documentation for functions calling eventrac and supported events .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM