Class Logging.Builder (2.38.0)

public static final class Logging.Builder extends GeneratedMessageV3.Builder<Logging.Builder> implements LoggingOrBuilder

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

Protobuf type google.api.Logging

Implements

LoggingOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllConsumerDestinations(Iterable<? extends Logging.LoggingDestination> values)

public Logging.Builder addAllConsumerDestinations(Iterable<? extends Logging.LoggingDestination> values)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
values Iterable<? extends com.google.api.Logging.LoggingDestination>
Returns
Type Description
Logging.Builder

addAllProducerDestinations(Iterable<? extends Logging.LoggingDestination> values)

public Logging.Builder addAllProducerDestinations(Iterable<? extends Logging.LoggingDestination> values)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
values Iterable<? extends com.google.api.Logging.LoggingDestination>
Returns
Type Description
Logging.Builder

addConsumerDestinations(Logging.LoggingDestination value)

public Logging.Builder addConsumerDestinations(Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

addConsumerDestinations(Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder addConsumerDestinations(Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

addConsumerDestinations(int index, Logging.LoggingDestination value)

public Logging.Builder addConsumerDestinations(int index, Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameters
Name Description
index int
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

addConsumerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder addConsumerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameters
Name Description
index int
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

addConsumerDestinationsBuilder()

public Logging.LoggingDestination.Builder addConsumerDestinationsBuilder()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
Logging.LoggingDestination.Builder

addConsumerDestinationsBuilder(int index)

public Logging.LoggingDestination.Builder addConsumerDestinationsBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination.Builder

addProducerDestinations(Logging.LoggingDestination value)

public Logging.Builder addProducerDestinations(Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

addProducerDestinations(Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder addProducerDestinations(Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

addProducerDestinations(int index, Logging.LoggingDestination value)

public Logging.Builder addProducerDestinations(int index, Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameters
Name Description
index int
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

addProducerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder addProducerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameters
Name Description
index int
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

addProducerDestinationsBuilder()

public Logging.LoggingDestination.Builder addProducerDestinationsBuilder()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
Logging.LoggingDestination.Builder

addProducerDestinationsBuilder(int index)

public Logging.LoggingDestination.Builder addProducerDestinationsBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Logging.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Logging.Builder
Overrides

build()

public Logging build()
Returns
Type Description
Logging

buildPartial()

public Logging buildPartial()
Returns
Type Description
Logging

clear()

public Logging.Builder clear()
Returns
Type Description
Logging.Builder
Overrides

clearConsumerDestinations()

public Logging.Builder clearConsumerDestinations()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
Logging.Builder

clearField(Descriptors.FieldDescriptor field)

public Logging.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Logging.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Logging.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Logging.Builder
Overrides

clearProducerDestinations()

public Logging.Builder clearProducerDestinations()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
Logging.Builder

clone()

public Logging.Builder clone()
Returns
Type Description
Logging.Builder
Overrides

getConsumerDestinations(int index)

public Logging.LoggingDestination getConsumerDestinations(int index)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination

getConsumerDestinationsBuilder(int index)

public Logging.LoggingDestination.Builder getConsumerDestinationsBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination.Builder

getConsumerDestinationsBuilderList()

public List<Logging.LoggingDestination.Builder> getConsumerDestinationsBuilderList()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
List<Builder>

getConsumerDestinationsCount()

public int getConsumerDestinationsCount()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
int

getConsumerDestinationsList()

public List<Logging.LoggingDestination> getConsumerDestinationsList()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
List<LoggingDestination>

getConsumerDestinationsOrBuilder(int index)

public Logging.LoggingDestinationOrBuilder getConsumerDestinationsOrBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestinationOrBuilder

getConsumerDestinationsOrBuilderList()

public List<? extends Logging.LoggingDestinationOrBuilder> getConsumerDestinationsOrBuilderList()

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Returns
Type Description
List<? extends com.google.api.Logging.LoggingDestinationOrBuilder>

getDefaultInstanceForType()

public Logging getDefaultInstanceForType()
Returns
Type Description
Logging

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getProducerDestinations(int index)

public Logging.LoggingDestination getProducerDestinations(int index)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination

getProducerDestinationsBuilder(int index)

public Logging.LoggingDestination.Builder getProducerDestinationsBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestination.Builder

getProducerDestinationsBuilderList()

public List<Logging.LoggingDestination.Builder> getProducerDestinationsBuilderList()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
List<Builder>

getProducerDestinationsCount()

public int getProducerDestinationsCount()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
int

getProducerDestinationsList()

public List<Logging.LoggingDestination> getProducerDestinationsList()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
List<LoggingDestination>

getProducerDestinationsOrBuilder(int index)

public Logging.LoggingDestinationOrBuilder getProducerDestinationsOrBuilder(int index)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
index int
Returns
Type Description
Logging.LoggingDestinationOrBuilder

getProducerDestinationsOrBuilderList()

public List<? extends Logging.LoggingDestinationOrBuilder> getProducerDestinationsOrBuilderList()

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Returns
Type Description
List<? extends com.google.api.Logging.LoggingDestinationOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Logging other)

public Logging.Builder mergeFrom(Logging other)
Parameter
Name Description
other Logging
Returns
Type Description
Logging.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Logging.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Logging.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Logging.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Logging.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Logging.Builder
Overrides

removeConsumerDestinations(int index)

public Logging.Builder removeConsumerDestinations(int index)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameter
Name Description
index int
Returns
Type Description
Logging.Builder

removeProducerDestinations(int index)

public Logging.Builder removeProducerDestinations(int index)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameter
Name Description
index int
Returns
Type Description
Logging.Builder

setConsumerDestinations(int index, Logging.LoggingDestination value)

public Logging.Builder setConsumerDestinations(int index, Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameters
Name Description
index int
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

setConsumerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder setConsumerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination consumer_destinations = 2;

Parameters
Name Description
index int
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Logging.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Logging.Builder
Overrides

setProducerDestinations(int index, Logging.LoggingDestination value)

public Logging.Builder setProducerDestinations(int index, Logging.LoggingDestination value)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameters
Name Description
index int
value Logging.LoggingDestination
Returns
Type Description
Logging.Builder

setProducerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

public Logging.Builder setProducerDestinations(int index, Logging.LoggingDestination.Builder builderForValue)

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.

repeated .google.api.Logging.LoggingDestination producer_destinations = 1;

Parameters
Name Description
index int
builderForValue Logging.LoggingDestination.Builder
Returns
Type Description
Logging.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Logging.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Logging.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Logging.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Logging.Builder
Overrides