public sealed class Logging : IMessage<Logging>, IEquatable<Logging>, IDeepCloneable<Logging>, IBufferMessage, IMessage
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, the activity_history
log is sent to both the producer and consumer projects, whereas the
purchase_history log 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:
- name: activity_history
labels:
- key: /customer_id
- name: purchase_history
logging:
producer_destinations:
- monitored_resource: library.googleapis.com/branch
logs:
- activity_history
- purchase_history
consumer_destinations:
- monitored_resource: library.googleapis.com/branch
logs:
- activity_history
public RepeatedField<Logging.Types.LoggingDestination> ConsumerDestinations { get; }
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.
public RepeatedField<Logging.Types.LoggingDestination> ProducerDestinations { get; }
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.
[[["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-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eLogging\u003c/code\u003e class is used for configuring how logs are sent to producer and consumer projects, offering a structured way to manage log destinations.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eLogging\u003c/code\u003e class is 2.15.0, with older versions 2.10.0 and 2.2.0 also documented, highlighting version management.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLogging\u003c/code\u003e class supports multiple logging destinations, allowing logs to be directed to either producer or consumer projects, each with its own configurations.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLogging\u003c/code\u003e class implements multiple interfaces including IMessage, IEquatable, IDeepCloneable, and IBufferMessage, indicating its functionalities within the Google Protocol Buffers ecosystem.\u003c/p\u003e\n"],["\u003cp\u003eKey properties like \u003ccode\u003eProducerDestinations\u003c/code\u003e and \u003ccode\u003eConsumerDestinations\u003c/code\u003e allow for the definition of log destinations, with each destination having a specific monitored resource type.\u003c/p\u003e\n"]]],[],null,["# Class Logging (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Logging)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.Logging)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.Logging)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.Logging) \n\n public sealed class Logging : IMessage\u003cLogging\u003e, IEquatable\u003cLogging\u003e, IDeepCloneable\u003cLogging\u003e, IBufferMessage, IMessage\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. \n\n monitored_resources:\n - type: library.googleapis.com/branch\n labels:\n - key: /city\n description: The city where the library branch is located in.\n - key: /name\n description: The name of the branch.\n logs:\n - name: activity_history\n labels:\n - key: /customer_id\n - name: purchase_history\n logging:\n producer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history\n - purchase_history\n consumer_destinations:\n - monitored_resource: library.googleapis.com/branch\n logs:\n - activity_history\n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Logging \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Logging](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Logging), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Logging](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Logging), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Logging](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Logging), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Logging()\n\n public Logging()\n\n### Logging(Logging)\n\n public Logging(Logging other)\n\nFields\n------\n\n### ConsumerDestinationsFieldNumber\n\n public const int ConsumerDestinationsFieldNumber = 2\n\nField number for the \"consumer_destinations\" field.\n\n### ProducerDestinationsFieldNumber\n\n public const int ProducerDestinationsFieldNumber = 1\n\nField number for the \"producer_destinations\" field.\n\nProperties\n----------\n\n### ConsumerDestinations\n\n public RepeatedField\u003cLogging.Types.LoggingDestination\u003e ConsumerDestinations { get; }\n\nLogging configurations for sending logs to the consumer project.\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### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cLogging\u003e Parser { get; }\n\n### ProducerDestinations\n\n public RepeatedField\u003cLogging.Types.LoggingDestination\u003e ProducerDestinations { get; }\n\nLogging configurations for sending logs to the producer project.\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\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Logging Clone()\n\n### Equals(Logging)\n\n public bool Equals(Logging other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(Logging)\n\n public void MergeFrom(Logging other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]