Reference documentation and code samples for the Google API Common Protos Client class Logging.
Logging configuration of the service.
The following example shows how to configure logs to be sent to the
producer and consumer projects. In the example, theactivity_historylog is sent to both the producer and consumer projects, whereas thepurchase_historylog is only sent to the producer project.
monitored_resources:
type: library.googleapis.com/branch
labels:
key: /city
description: The city where the library branch is located in.
key: /name
description: The name of the branch.
logs:
Logging configurations for sending logs to the producer project. There can be multiple producer destinations, each one must have a different monitored resource type. A log can be used in at most one producer destination.
Logging configurations for sending logs to the consumer project. There can be multiple consumer destinations, each one must have a different monitored resource type. A log can be used in at most one consumer destination.
getProducerDestinations
Logging configurations for sending logs to the producer project.
There can be multiple producer destinations, each one must have a
different monitored resource type. A log can be used in at most
one producer destination.
Logging configurations for sending logs to the producer project.
There can be multiple producer destinations, each one must have a
different monitored resource type. A log can be used in at most
one producer destination.
Logging configurations for sending logs to the consumer project.
There can be multiple consumer destinations, each one must have a
different monitored resource type. A log can be used in at most
one consumer destination.
Logging configurations for sending logs to the consumer project.
There can be multiple consumer destinations, each one must have a
different monitored resource type. A log can be used in at most
one consumer destination.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google API Common Protos Client - Class Logging (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.Logging)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.Logging)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.Logging)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.Logging)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.Logging)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.Logging) \nReference documentation and code samples for the Google API Common Protos Client class Logging.\n\nLogging configuration of the service.\n\nThe following example shows how to configure logs to be sent to the\nproducer and consumer projects. In the example, the `activity_history`\nlog is sent to both the producer and consumer projects, whereas the\n`purchase_history` log is only sent to the producer project.\nmonitored_resources:\n\n- type: library.googleapis.com/branch labels:\n - key: /city description: The city where the library branch is located in.\n - key: /name description: The name of the branch. logs:\n- name: activity_history labels:\n - key: /customer_id\n- name: purchase_history logging: producer_destinations:\n - monitored_resource: library.googleapis.com/branch logs:\n - activity_history\n - purchase_history consumer_destinations:\n - monitored_resource: library.googleapis.com/branch logs:\n - activity_history\n\nGenerated from protobuf message `google.api.Logging`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProducerDestinations\n\nLogging configurations for sending logs to the producer project.\n\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none producer destination.\n\n### setProducerDestinations\n\nLogging configurations for sending logs to the producer project.\n\nThere can be multiple producer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none producer destination.\n\n### getConsumerDestinations\n\nLogging configurations for sending logs to the consumer project.\n\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none consumer destination.\n\n### setConsumerDestinations\n\nLogging configurations for sending logs to the consumer project.\n\nThere can be multiple consumer destinations, each one must have a\ndifferent monitored resource type. A log can be used in at most\none consumer destination."]]