1// Copyright 2021 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.servicecontrol.v1; 18 19import "google/api/servicecontrol/v1/http_request.proto"; 20import "google/logging/type/log_severity.proto"; 21import "google/protobuf/any.proto"; 22import "google/protobuf/struct.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.ServiceControl.V1"; 26option go_package = "cloud.google.com/go/servicecontrol/apiv1/servicecontrolpb;servicecontrolpb"; 27option java_multiple_files = true; 28option java_outer_classname = "LogEntryProto"; 29option java_package = "com.google.api.servicecontrol.v1"; 30option php_namespace = "Google\\Cloud\\ServiceControl\\V1"; 31option ruby_package = "Google::Cloud::ServiceControl::V1"; 32 33// An individual log entry. 34message LogEntry { 35 // Required. The log to which this log entry belongs. Examples: `"syslog"`, 36 // `"book_log"`. 37 string name = 10; 38 39 // The time the event described by the log entry occurred. If 40 // omitted, defaults to operation start time. 41 google.protobuf.Timestamp timestamp = 11; 42 43 // The severity of the log entry. The default value is 44 // `LogSeverity.DEFAULT`. 45 google.logging.type.LogSeverity severity = 12; 46 47 // Optional. Information about the HTTP request associated with this 48 // log entry, if applicable. 49 HttpRequest http_request = 14; 50 51 // Optional. Resource name of the trace associated with the log entry, if any. 52 // If this field contains a relative resource name, you can assume the name is 53 // relative to `//tracing.googleapis.com`. Example: 54 // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` 55 string trace = 15; 56 57 // A unique ID for the log entry used for deduplication. If omitted, 58 // the implementation will generate one based on operation_id. 59 string insert_id = 4; 60 61 // A set of user-defined (key, value) data that provides additional 62 // information about the log entry. 63 map<string, string> labels = 13; 64 65 // The log entry payload, which can be one of multiple types. 66 oneof payload { 67 // The log entry payload, represented as a protocol buffer that is 68 // expressed as a JSON object. The only accepted type currently is 69 // [AuditLog][google.cloud.audit.AuditLog]. 70 google.protobuf.Any proto_payload = 2; 71 72 // The log entry payload, represented as a Unicode string (UTF-8). 73 string text_payload = 3; 74 75 // The log entry payload, represented as a structure that 76 // is expressed as a JSON object. 77 google.protobuf.Struct struct_payload = 6; 78 } 79 80 // Optional. Information about an operation associated with the log entry, if 81 // applicable. 82 LogEntryOperation operation = 16; 83 84 // Optional. Source code location information associated with the log entry, 85 // if any. 86 LogEntrySourceLocation source_location = 17; 87} 88 89// Additional information about a potentially long-running operation with which 90// a log entry is associated. 91message LogEntryOperation { 92 // Optional. An arbitrary operation identifier. Log entries with the 93 // same identifier are assumed to be part of the same operation. 94 string id = 1; 95 96 // Optional. An arbitrary producer identifier. The combination of 97 // `id` and `producer` must be globally unique. Examples for `producer`: 98 // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. 99 string producer = 2; 100 101 // Optional. Set this to True if this is the first log entry in the operation. 102 bool first = 3; 103 104 // Optional. Set this to True if this is the last log entry in the operation. 105 bool last = 4; 106} 107 108// Additional information about the source code location that produced the log 109// entry. 110message LogEntrySourceLocation { 111 // Optional. Source file name. Depending on the runtime environment, this 112 // might be a simple name or a fully-qualified name. 113 string file = 1; 114 115 // Optional. Line within the source file. 1-based; 0 indicates no line number 116 // available. 117 int64 line = 2; 118 119 // Optional. Human-readable name of the function or method being invoked, with 120 // optional context such as the class or package name. This information may be 121 // used in contexts such as the logs viewer, where a file and line number are 122 // less meaningful. The format can vary by language. For example: 123 // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` 124 // (Python). 125 string function = 3; 126} 127