xref: /aosp_15_r20/external/googleapis/google/api/logging.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.api;
18
19option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20option java_multiple_files = true;
21option java_outer_classname = "LoggingProto";
22option java_package = "com.google.api";
23option objc_class_prefix = "GAPI";
24
25// Logging configuration of the service.
26//
27// The following example shows how to configure logs to be sent to the
28// producer and consumer projects. In the example, the `activity_history`
29// log is sent to both the producer and consumer projects, whereas the
30// `purchase_history` log is only sent to the producer project.
31//
32//     monitored_resources:
33//     - type: library.googleapis.com/branch
34//       labels:
35//       - key: /city
36//         description: The city where the library branch is located in.
37//       - key: /name
38//         description: The name of the branch.
39//     logs:
40//     - name: activity_history
41//       labels:
42//       - key: /customer_id
43//     - name: purchase_history
44//     logging:
45//       producer_destinations:
46//       - monitored_resource: library.googleapis.com/branch
47//         logs:
48//         - activity_history
49//         - purchase_history
50//       consumer_destinations:
51//       - monitored_resource: library.googleapis.com/branch
52//         logs:
53//         - activity_history
54message Logging {
55  // Configuration of a specific logging destination (the producer project
56  // or the consumer project).
57  message LoggingDestination {
58    // The monitored resource type. The type must be defined in the
59    // [Service.monitored_resources][google.api.Service.monitored_resources]
60    // section.
61    string monitored_resource = 3;
62
63    // Names of the logs to be sent to this destination. Each name must
64    // be defined in the [Service.logs][google.api.Service.logs] section. If the
65    // log name is not a domain scoped name, it will be automatically prefixed
66    // with the service name followed by "/".
67    repeated string logs = 1;
68  }
69
70  // Logging configurations for sending logs to the producer project.
71  // There can be multiple producer destinations, each one must have a
72  // different monitored resource type. A log can be used in at most
73  // one producer destination.
74  repeated LoggingDestination producer_destinations = 1;
75
76  // Logging configurations for sending logs to the consumer project.
77  // There can be multiple consumer destinations, each one must have a
78  // different monitored resource type. A log can be used in at most
79  // one consumer destination.
80  repeated LoggingDestination consumer_destinations = 2;
81}
82