log_entry.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Copyright 2016 Google Inc.
  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. syntax = "proto3";
  15. package google.logging.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/monitored_resource.proto";
  18. import "google/logging/type/http_request.proto";
  19. import "google/logging/type/log_severity.proto";
  20. import "google/protobuf/any.proto";
  21. import "google/protobuf/struct.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option cc_enable_arenas = true;
  24. option java_multiple_files = true;
  25. option java_outer_classname = "LogEntryProto";
  26. option java_package = "com.google.logging.v2";
  27. option go_package = "google.golang.org/genproto/googleapis/logging/v2";
  28. // An individual entry in a log.
  29. message LogEntry {
  30. // Required. The resource name of the log to which this log entry
  31. // belongs. The format of the name is
  32. // `"projects/<project-id>/logs/<log-id>"`. Examples:
  33. // `"projects/my-projectid/logs/syslog"`,
  34. // `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`.
  35. //
  36. // The log ID part of resource name must be less than 512 characters
  37. // long and can only include the following characters: upper and
  38. // lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
  39. // characters: forward-slash, underscore, hyphen, and period.
  40. // Forward-slash (`/`) characters in the log ID must be URL-encoded.
  41. string log_name = 12;
  42. // Required. The monitored resource associated with this log entry.
  43. // Example: a log entry that reports a database error would be
  44. // associated with the monitored resource designating the particular
  45. // database that reported the error.
  46. google.api.MonitoredResource resource = 8;
  47. // Required. The log entry payload, which can be one of multiple types.
  48. oneof payload {
  49. // The log entry payload, represented as a protocol buffer.
  50. // You can only use `protoPayload` values that belong to a set of approved
  51. // types.
  52. google.protobuf.Any proto_payload = 2;
  53. // The log entry payload, represented as a Unicode string (UTF-8).
  54. string text_payload = 3;
  55. // The log entry payload, represented as a structure that
  56. // is expressed as a JSON object.
  57. google.protobuf.Struct json_payload = 6;
  58. }
  59. // Optional. The time the event described by the log entry occurred. If
  60. // omitted, Stackdriver Logging will use the time the log entry is received.
  61. google.protobuf.Timestamp timestamp = 9;
  62. // Optional. The severity of the log entry. The default value is
  63. // `LogSeverity.DEFAULT`.
  64. google.logging.type.LogSeverity severity = 10;
  65. // Optional. A unique ID for the log entry. If you provide this
  66. // field, the logging service considers other log entries in the
  67. // same log with the same ID as duplicates which can be removed. If
  68. // omitted, Stackdriver Logging will generate a unique ID for this
  69. // log entry.
  70. string insert_id = 4;
  71. // Optional. Information about the HTTP request associated with this log entry,
  72. // if applicable.
  73. google.logging.type.HttpRequest http_request = 7;
  74. // Optional. A set of user-defined (key, value) data that provides additional
  75. // information about the log entry.
  76. map<string, string> labels = 11;
  77. // Optional. Information about an operation associated with the log entry, if
  78. // applicable.
  79. LogEntryOperation operation = 15;
  80. }
  81. // Additional information about a potentially long-running operation with which
  82. // a log entry is associated.
  83. message LogEntryOperation {
  84. // Required. An arbitrary operation identifier. Log entries with the
  85. // same identifier are assumed to be part of the same operation.
  86. //
  87. string id = 1;
  88. // Required. An arbitrary producer identifier. The combination of
  89. // `id` and `producer` must be globally unique. Examples for `producer`:
  90. // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
  91. //
  92. string producer = 2;
  93. // Optional. Set this to True if this is the first log entry in the operation.
  94. bool first = 3;
  95. // Optional. Set this to True if this is the last log entry in the operation.
  96. bool last = 4;
  97. }