Skip to main content

Log Field Reference

CloudBase logs are stored as key-value records, and each log consists of several fields. This page describes the log sources, field meanings, and types, and how to write them in search statements. Use it when you write search statements, configure indexes, or set up alerts.

Log Sources​

Logs produced by different resources are distinguished by different search conditions:

Log sourceSearch conditionDescription
Cloud functionsfunction_name:"function-name"Function runtime logs, including system logs and user code logs
CloudRunSelect CloudRun in the console; use --service tcbr in the CLIContainer standard output logs
Gateway accesslogType:accesslogHTTP access logs
Document databasemodule:databaseDatabase operation logs
SQL databasemodule:rdbSQL database event logs
Data modelmodule:modelData model logs
User authenticationmodule:authSign-in and authentication events
Large language modelmodule:llm AND logType:llm-tracelogAI invocation tracing
WeDa applicationmodule:appWeDa application publish and delete events

Common System Fields​

Platform logs carry the following system fields by default:

FieldTypeDescription
levelstringLog level: log, info, warn, or error
requestIdstringRequest ID, used to correlate logs of the same request
modulestringModule name, matching the modules in "Log Sources" above
resourceNamestringResource name, identifying the resource the request actually accessed
errorCodestringError code
errorMessagestringError message
requeststringRequest parameters
responsestringResponse parameters
msgstringSimple log content; not a default field
userstringUser identifier
srcstringLog source: system for system logs, app for user code logs
startTimestringRequest start time
timeCoststringRequest duration, in milliseconds
servicestringThe service that was called

Cloud Function Log Fields​

Cloud function logs contain the following fields:

FieldDescriptionExample
function_nameFunction namefunction_name:"user-login"
function_idFunction IDfunction_id:"lam-xxxxxxxx"
request_idUnique ID of the invocationrequest_id:"abc123"
qualifierFunction versionqualifier:"$LATEST"
aliasFunction aliasalias:"prod"
statusInvocation status
status_codeInvocation status code: 200 for success, 202 for an intermediate statestatus_code>200 AND status_code!=202
status_msgInvocation status message
ret_codeReturn code
ret_msgReturn message
srcLog source: system for system logs, app for user code logssrc:app
logLog bodylog:"Error"
log_sizeLog size
durationExecution duration, in millisecondsduration:>5000
bill_durationBilled duration
memoryMemory usagememory:512
mem_usageMemory usage amount
mem_durationMemory duration
function_invoke_timeFunction invocation time
function_invoke_end_timeFunction invocation end time
start_timeInvocation start time
event_typeInvocation type
request_sourceRequest source, for example TRIGGER_TIMER for a timer triggerrequest_source:TRIGGER_TIMER
retry_numRetry count; use retry_num=0 to filter out retried requestsretry_num=0
caller, caller_ipCaller and its IP
report_ipReport IP
wan_trafficPublic network traffic
cluster_nameCluster name
container_idContainer ID
user_idUser IDuser_id:"1307589412"
namespaceEnvironment IDnamespace:"my-env"
stampInvocation stamp
tcb_logAdditional CloudBase log
@timestampLog timestamp
Note

The request ID field of cloud function logs is request_id, while other logs use requestId. Always use request_id when you search cloud function logs or write SQL analysis statements for them.

CloudRun Log Fields​

FieldDescriptionExample
__CONTENT__Log content, used for full-text search"error" AND "timeout"
__TAG__.container_nameContainer name, in the format of service name plus instance name; regular expressions are supported/servername-[0-9]+/
__TAG__.pod_nameInstance name in the cluster__TAG__.pod_name:"xxx"
__TAG__.pod_uidInstance UID in the cluster
__TAG__.pod_ipInstance private IP in the cluster
__TAG__.pod_label_k8s-appService name and instance version
__TAG__.pod_label_pod-template-hashTemplate hash
__TAG__.image_nameImage name
__TAG__.cluster_idCluster ID
__TAG__.namespaceInstance namespace in the cluster
__TAG__.envIdEnvironment ID
__TAG__.streamLog collection source

Gateway Access Log Fields​

Gateway access logs are filtered with logType:accesslog. Fields:

FieldTypeDescriptionExample
logTypestringLog typeaccesslog
statusCodestringResponse status code"200", "502"
codestringService call error code
messagestringError message
host, matchedHoststringRequested domain namexxx.api.tcloudbasegateway.com
path, urlstringRequest path, request URL/auth/v1/certs
querystringQuery parameters
method, actionstringHTTP request methodGET
modulestringBackend module that handled the requestauth
resourceNamestringResource actually accessed by the request; empty for authentication APIsPostgresREST
timeCoststringRequest duration, in milliseconds26
startTime, startAt, endAtstringRequest start and end time
timestampstringTimestamp
sourceIp, xffstringSource IP, X-Forwarded-For header175.24.212.162
requestId, logIdstringUnique request identifier, used to look up a single request9be5592e-11ea-4f45-9c83-e44ff20e7ed4
levelstringLog levelinfo
accessSourcestringAccess sourcehttp_openapi
sourcestringSource identifier
reqSize, resSizestringRequest body and response body size
contentTypestringHTTP Content-Type
originstringHTTP Origin
referrerstringHTTP Referrer
userAgentstringHTTP User-Agent
secchuastringHTTP Sec-Ch-UA
sdkVersionstringSDK version
versionstringVersion
userIdstringUser ID
userTypestringUser type
authMethodstringAuthentication method
isAdministratorstringWhether the call is made as an administrator
upstream.typestringUpstream type, for example database
upstream.requestIdstringUpstream request ID
upstream.statusstringUpstream status code
upstream.timeCoststringUpstream duration

A sample gateway access log:

{
"logType": "accesslog",
"statusCode": "200",
"host": "xxx.api.tcloudbasegateway.com",
"path": "/auth/v1/certs",
"method": "GET",
"module": "auth",
"timeCost": "26",
"requestId": "9be5592e-11ea-4f45-9c83-e44ff20e7ed4",
"sourceIp": "175.24.212.162"
}

statusCode is a string. Write it as statusCode:"502" in searches.

Document Database Log Fields​

Document database logs are filtered with module:database. They include the request fields of gateway access logs (host, path, method, statusCode, requestId, timeCost, sourceIp, userId, upstream.*, and so on), plus the following fields:

FieldDescription
msgLog content
resourceNameResource
actionOperation
queryQuery parameters
codeError code
isAdministratorWhether the call is made as an administrator

SQL Database Log Fields​

SQL database logs are filtered with module:rdb:

FieldDescription
msgLog content
actionOperation
resultExecution result
schemaDatabase
tableTable name
latencyMsDuration, in milliseconds
requestIdRequest ID
envIdEnvironment ID
appIdApplication ID
uinUser UIN
moduleModule
timestampTimestamp

User Authentication Log Fields​

User authentication logs are filtered with module:auth:

FieldDescription
levelLog level
requestIdRequest ID
request, responseRequest and response
clientIdClient ID
deviceIdDevice ID
userUser
hostHost
originOrigin header
refererReferer header
errorError type
errorCodeError code
errorMessageError message
timeCostDuration
startTimeStart time
timestampTimestamp
moduleModule

Large Language Model Log Fields​

Large language model tracing logs are filtered with module:llm AND logType:llm-tracelog:

FieldDescription
modelProviderModel group
modelModel name
inputRequest content
outputResponse content
streamWhether the call is streaming
maxTokensMaximum output tokens specified in the request
promptTokensInput tokens
completionTokensOutput tokens
totalTokensTotal tokens
firstTokenDurationInterval to the first token, in milliseconds
timeCostDuration, in milliseconds
statusCodeHTTP status code
startTimeRequest start time
userUser ID
requestIdUnique request identifier
traceId, spanIdTrace IDs
logTypeLog type
moduleModule name

WeDa Application Log Fields​

WeDa application logs are filtered with module:app:

FieldDescription
msgLog content
requestIdRequest ID
moduleModule
eventTypeEvent type; see "Platform Event Types" below for values
resourceNameResource name
timestampTimestamp

Platform Event Types​

Some platform logs identify events with the eventType field. You can combine it with module to filter:

ModuleeventType valuesDescription
databaseMongoSlowQueryDocument database slow queries
rdbMysqlSlowQuery, MysqlFreeze, MysqlRecoverSQL database slow queries, freeze, and recovery
appAppProdPub, AppProdDelWeDa application publish and delete

Limits​

  • After the log content is split by token delimiters, a single token cannot exceed 32 KB.
  • A key-value index only applies to logs written after the index is modified. Historical logs are not re-indexed.
  • Only fields with a key-value index can be used in SQL analysis statements.

Viewing Log Fields​