Modifier and Type | Method and Description |
---|---|
LogEntry.Builder |
addLabel(String key,
String value)
Adds a label to the log entry's labels.
|
LogEntry |
build()
Creates a
LogEntry object for this builder. |
LogEntry.Builder |
clearLabels()
Clears all the labels of the log entry.
|
LogEntry.Builder |
setHttpRequest(HttpRequest httpRequest)
Sets information about the HTTP request associated with this log entry, if applicable.
|
LogEntry.Builder |
setInsertId(String insertId)
Sets a unique ID for the log entry.
|
LogEntry.Builder |
setLabels(Map<String,String> labels)
Sets an optional set of user-defined (key, value) data that provides additional information
about the log entry.
|
LogEntry.Builder |
setLogName(String logName)
Sets the name of the log to which this log entry belongs.
|
LogEntry.Builder |
setOperation(Operation operation)
Sets information about an operation associated with the log entry, if applicable.
|
LogEntry.Builder |
setPayload(Payload payload)
Sets the payload for this log entry.
|
LogEntry.Builder |
setReceiveTimestamp(long receiveTimestamp)
Sets the time the log entry was received by Stackdriver Logging.
|
LogEntry.Builder |
setResource(MonitoredResource resource)
Sets the monitored resource associated with this log entry.
|
LogEntry.Builder |
setSeverity(Severity severity)
Sets the severity of the log entry.
|
LogEntry.Builder |
setSourceLocation(SourceLocation sourceLocation)
Sets the source code location information associated with the log entry if any.
|
LogEntry.Builder |
setSpanId(Object spanId)
Sets the ID of the trace span associated with the log entry, if any.
|
LogEntry.Builder |
setSpanId(String spanId)
Sets the ID of the trace span associated with the log entry, if any.
|
LogEntry.Builder |
setTimestamp(long timestamp)
Sets the time at which the event described by the log entry occurred, in milliseconds.
|
LogEntry.Builder |
setTrace(Object trace)
Sets the resource name of the trace associated with the log entry, if any.
|
LogEntry.Builder |
setTrace(String trace)
Sets the resource name of the trace associated with the log entry, if any.
|
LogEntry.Builder |
setTraceSampled(boolean traceSampled)
Sets the sampling decision of the trace span associated with the log entry.
|
public LogEntry.Builder setLogName(String logName)
[A-Za-z0-9]
; and punctuation characters: _-./
. The
forward-slash (/
) characters in the log name must be URL-encoded. Examples: syslog
, library.googleapis.com%2Fbook_log
.public LogEntry.Builder setResource(MonitoredResource resource)
public LogEntry.Builder setTimestamp(long timestamp)
public LogEntry.Builder setReceiveTimestamp(long receiveTimestamp)
public LogEntry.Builder setSeverity(Severity severity)
Severity.DEFAULT
is used.public LogEntry.Builder setInsertId(String insertId)
public LogEntry.Builder setHttpRequest(HttpRequest httpRequest)
public LogEntry.Builder setLabels(Map<String,String> labels)
public LogEntry.Builder addLabel(String key, String value)
public LogEntry.Builder clearLabels()
public LogEntry.Builder setOperation(Operation operation)
public LogEntry.Builder setTrace(String trace)
public LogEntry.Builder setTrace(Object trace)
public LogEntry.Builder setSpanId(String spanId)
public LogEntry.Builder setSpanId(Object spanId)
public LogEntry.Builder setTraceSampled(boolean traceSampled)
public LogEntry.Builder setSourceLocation(SourceLocation sourceLocation)
public LogEntry.Builder setPayload(Payload payload)
Payload.StringPayload
), a JSON object (see Payload.JsonPayload
, or a
protobuf object (see Payload.ProtoPayload
).public LogEntry build()
LogEntry
object for this builder.Copyright © 2019 Google LLC. All rights reserved.