Class Logging (2.40.0)

public final class Logging extends GeneratedMessageV3 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 Fields

CONSUMER_DESTINATIONS_FIELD_NUMBER

public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER
Field Value
Type Description
int

PRODUCER_DESTINATIONS_FIELD_NUMBER

public static final int PRODUCER_DESTINATIONS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Logging getDefaultInstance()
Returns
Type Description
Logging

getDescriptor()

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

newBuilder()

public static Logging.Builder newBuilder()
Returns
Type Description
Logging.Builder

newBuilder(Logging prototype)

public static Logging.Builder newBuilder(Logging prototype)
Parameter
Name Description
prototype Logging
Returns
Type Description
Logging.Builder

parseDelimitedFrom(InputStream input)

public static Logging parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Logging parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Logging parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Logging parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Logging parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Logging parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Logging parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Logging parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Logging parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Logging parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Logging parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Logging parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Logging
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Logging> parser()
Returns
Type Description
Parser<Logging>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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

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

getParserForType()

public Parser<Logging> getParserForType()
Returns
Type Description
Parser<Logging>
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

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>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Logging.Builder newBuilderForType()
Returns
Type Description
Logging.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Logging.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Logging.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Logging.Builder toBuilder()
Returns
Type Description
Logging.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException