Class LogEntry (1.13.0)

  LogEntry 
 ( 
 log_name 
 = 
 None 
 , 
 labels 
 = 
 None 
 , 
 insert_id 
 = 
 None 
 , 
 severity 
 = 
 None 
 , 
 http_request 
 = 
 None 
 , 
 timestamp 
 = 
 None 
 , 
 resource 
 = 
 Resource 
 ( 
 type 
 = 
 "global" 
 , 
 labels 
 = 
 {}), 
 trace 
 = 
 None 
 , 
 span_id 
 = 
 None 
 , 
 trace_sampled 
 = 
 None 
 , 
 source_location 
 = 
 None 
 , 
 operation 
 = 
 None 
 , 
 logger 
 = 
 None 
 , 
 payload 
 = 
 None 
 , 
 ) 
 

Log entry.

Parameters

Name
Description
log_name
str

the name of the logger used to post the entry.

labels
dict

(optional) mapping of labels for the entry

insert_id
text

(optional) the ID used to identify an entry uniquely.

severity
str

(optional) severity of event being logged.

http_request
dict

(optional) info about HTTP request associated with the entry.

timestamp
datetime.datetime

(optional) timestamp for the entry

resource
Resource

(Optional) Monitored resource of the entry

trace
str

(optional) traceid to apply to the entry.

span_id
str

(optional) span_id within the trace for the log entry. Specify the trace parameter if span_id is set.

trace_sampled
bool

(optional) the sampling decision of the trace associated with the log entry.

source_location
dict

(optional) location in source code from which the entry was emitted.

operation
dict

(optional) additional information about a potentially long-running operation associated with the log entry.

logger

Methods

LogEntry

  LogEntry 
 ( 
 log_name 
 = 
 None 
 , 
 labels 
 = 
 None 
 , 
 insert_id 
 = 
 None 
 , 
 severity 
 = 
 None 
 , 
 http_request 
 = 
 None 
 , 
 timestamp 
 = 
 None 
 , 
 resource 
 = 
 Resource 
 ( 
 type 
 = 
 "global" 
 , 
 labels 
 = 
 {}), 
 trace 
 = 
 None 
 , 
 span_id 
 = 
 None 
 , 
 trace_sampled 
 = 
 None 
 , 
 source_location 
 = 
 None 
 , 
 operation 
 = 
 None 
 , 
 logger 
 = 
 None 
 , 
 payload 
 = 
 None 
 , 
 ) 
 

Create new instance of LogEntry(log_name, labels, insert_id, severity, http_request, timestamp, resource, trace, span_id, trace_sampled, source_location, operation, logger, payload)

from_api_repr

  from_api_repr 
 ( 
 resource 
 , 
 client 
 , 
 loggers 
 = 
 None 
 ) 
 

Factory: construct an entry given its API representation

Parameters
Name
Description
resource
dict

text entry resource representation returned from the API

client
Client

Client which holds credentials and project configuration.

loggers
dict

(Optional) A mapping of logger fullnames -> loggers. If not passed, the entry will have a newly-created logger.

Returns
Type
Description
Log entry parsed from resource .

to_api_repr

  to_api_repr 
 () 
 

API repr (JSON format) for entry.

Create a Mobile Website
View Site in Mobile | Classic
Share by: