日志来源和字段
每个事件都是 ClickHouse logs 表中的一行。过滤 source 列来选择一个服务。下面的表格列出了它的字段;字段不一定在每个事件中都有值。
🌐 Each event is a row in the ClickHouse logs table. Filter the source column to select a service. The tables below list its fields; a field is not necessarily populated on every event.
id、timestamp、event_message、severity_text 和 source 是顶层列。服务字段在 log_attributes 中都是字符串值,即使原始事件中包含数字或布尔值。直接使用 ClickHouse 查询字段 列。有关类型转换和字段查找,请查看 使用 SQL 查询日志。
来源 #
🌐 Sources
source | 事件 |
|---|---|
edge_logs | 通过 API 网关的 HTTP 请求,包括 REST 和 GraphQL |
postgres_logs | 数据库活动、语句和错误 |
postgrest_logs | PostgREST 服务器日志 |
auth_logs | 认证服务器:登录、JWT、OAuth、邮箱 |
auth_audit_logs | 认证审计事件 |
storage_logs | 存储 API:上传和对象访问 |
realtime_logs | 实时服务器:通道、在线状态、广播 |
function_edge_logs | Edge Function 调用的 HTTP 请求和响应 |
function_logs | Edge Function 内部的 console 输出 |
supavisor_logs | 共享连接池:池化和超时 |
pgbouncer_logs | 专用连接池 |
pg_upgrade_logs | 数据库版本升级 |
对于 postgres_logs,语句文本和错误详情可以出现在 event_message。缺少结构化字段并不意味着事件没有细节。
🌐 For postgres_logs, statement text and error details can appear in event_message. A missing structured field does not mean the event has no detail.
捕获的 HTTP 头 #
🌐 Captured HTTP headers
API 网关日志只会记录下面的这些头信息。其他头信息仍然会送到应用和客户端,但不会出现在这些日志里。
🌐 API Gateway logs capture only the headers below. Other headers still reach the application and client but are omitted from these logs.
请求头:
🌐 Request headers:
acceptcf-connecting-ipcf-ipcountryhostuser-agentx-forwarded-protoreferercontent-lengthx-real-ipx-client-infox-forwarded-user-agentrangeprefer
响应头:
🌐 Response headers:
cf-cache-statuscf-raycontent-locationcontent-rangecontent-typecontent-lengthdatetransfer-encodingx-kong-proxy-latencyx-kong-upstream-latencysb-gateway-modesb-gateway-version
捕获限制 #
🌐 Capture limits
- 托管的 Postgres 事件超过 100,000 个字符,Edge Function 日志信息超过 10,000 个字符的会被截断。
- 内部 Supabase 服务连接事件不会记录在托管的 Postgres 日志中。
- 一个 Edge Function 调用使用
function_edge_logs;它的控制台输出使用function_logs。 - 对于 API 负载均衡器 流量,
log_attributes['load_balancer_redirect_identifier']用来识别上游数据库。
按来源分类的字段 #
🌐 Fields by source
来源: edge_logs
event_messagestringidstringidentifierstringidentifierlog_attributes['identifier']load_balancer_redirect_identifierstringmetadata.load_balancer_redirect_identifierlog_attributes['load_balancer_redirect_identifier']request.cf.asnnumbermetadata.request.cf.asnlog_attributes['request.cf.asn']request.cf.asOrganizationstringmetadata.request.cf.asOrganizationlog_attributes['request.cf.asOrganization']request.cf.botManagement.corporateProxybooleanmetadata.request.cf.botManagement.corporateProxylog_attributes['request.cf.botManagement.corporateProxy']request.cf.botManagement.detectionIdsnumber[]metadata.request.cf.botManagement.detectionIdslog_attributes['request.cf.botManagement.detectionIds']request.cf.botManagement.ja3Hashstringmetadata.request.cf.botManagement.ja3Hashlog_attributes['request.cf.botManagement.ja3Hash']request.cf.botManagement.scorenumbermetadata.request.cf.botManagement.scorelog_attributes['request.cf.botManagement.score']request.cf.botManagement.staticResourcebooleanmetadata.request.cf.botManagement.staticResourcelog_attributes['request.cf.botManagement.staticResource']request.cf.botManagement.verifiedBotbooleanmetadata.request.cf.botManagement.verifiedBotlog_attributes['request.cf.botManagement.verifiedBot']request.cf.citystringmetadata.request.cf.citylog_attributes['request.cf.city']request.cf.clientTcpRttnumbermetadata.request.cf.clientTcpRttlog_attributes['request.cf.clientTcpRtt']request.cf.clientTrustScorenumbermetadata.request.cf.clientTrustScorelog_attributes['request.cf.clientTrustScore']request.cf.colostringmetadata.request.cf.cololog_attributes['request.cf.colo']request.cf.continentstringmetadata.request.cf.continentlog_attributes['request.cf.continent']request.cf.countrystringmetadata.request.cf.countrylog_attributes['request.cf.country']request.cf.edgeRequestKeepAliveStatusnumbermetadata.request.cf.edgeRequestKeepAliveStatuslog_attributes['request.cf.edgeRequestKeepAliveStatus']request.cf.httpProtocolstringmetadata.request.cf.httpProtocollog_attributes['request.cf.httpProtocol']request.cf.latitudestringmetadata.request.cf.latitudelog_attributes['request.cf.latitude']request.cf.longitudestringmetadata.request.cf.longitudelog_attributes['request.cf.longitude']request.cf.metroCodestringmetadata.request.cf.metroCodelog_attributes['request.cf.metroCode']request.cf.postalCodestringmetadata.request.cf.postalCodelog_attributes['request.cf.postalCode']request.cf.regionstringmetadata.request.cf.regionlog_attributes['request.cf.region']request.cf.timezonestringmetadata.request.cf.timezonelog_attributes['request.cf.timezone']request.cf.tlsCipherstringmetadata.request.cf.tlsCipherlog_attributes['request.cf.tlsCipher']request.cf.tlsClientAuth.certPresentedstringmetadata.request.cf.tlsClientAuth.certPresentedlog_attributes['request.cf.tlsClientAuth.certPresented']request.cf.tlsClientAuth.certRevokedstringmetadata.request.cf.tlsClientAuth.certRevokedlog_attributes['request.cf.tlsClientAuth.certRevoked']request.cf.tlsClientAuth.certVerifiedstringmetadata.request.cf.tlsClientAuth.certVerifiedlog_attributes['request.cf.tlsClientAuth.certVerified']request.cf.tlsExportedAuthenticator.clientFinishedstringmetadata.request.cf.tlsExportedAuthenticator.clientFinishedlog_attributes['request.cf.tlsExportedAuthenticator.clientFinished']request.cf.tlsExportedAuthenticator.clientHandshakestringmetadata.request.cf.tlsExportedAuthenticator.clientHandshakelog_attributes['request.cf.tlsExportedAuthenticator.clientHandshake']request.cf.tlsExportedAuthenticator.serverFinishedstringmetadata.request.cf.tlsExportedAuthenticator.serverFinishedlog_attributes['request.cf.tlsExportedAuthenticator.serverFinished']request.cf.tlsExportedAuthenticator.serverHandshakestringmetadata.request.cf.tlsExportedAuthenticator.serverHandshakelog_attributes['request.cf.tlsExportedAuthenticator.serverHandshake']request.cf.tlsVersionstringmetadata.request.cf.tlsVersionlog_attributes['request.cf.tlsVersion']request.headers.cf_connecting_ipstringmetadata.request.headers.cf_connecting_iplog_attributes['request.headers.cf_connecting_ip']request.headers.cf_ipcountrystringmetadata.request.headers.cf_ipcountrylog_attributes['request.headers.cf_ipcountry']request.headers.cf_raystringmetadata.request.headers.cf_raylog_attributes['request.headers.cf_ray']request.headers.hoststringmetadata.request.headers.hostlog_attributes['request.headers.host']request.headers.refererstringmetadata.request.headers.refererlog_attributes['request.headers.referer']request.headers.x_client_infostringmetadata.request.headers.x_client_infolog_attributes['request.headers.x_client_info']request.headers.x_forwarded_protostringmetadata.request.headers.x_forwarded_protolog_attributes['request.headers.x_forwarded_proto']request.headers.x_real_ipstringmetadata.request.headers.x_real_iplog_attributes['request.headers.x_real_ip']request.hoststringmetadata.request.hostlog_attributes['request.host']request.methodstringmetadata.request.methodlog_attributes['request.method']request.pathstringmetadata.request.pathlog_attributes['request.path']request.protocolstringmetadata.request.protocollog_attributes['request.protocol']request.searchstringmetadata.request.searchlog_attributes['request.search']request.urlstringmetadata.request.urllog_attributes['request.url']response.headers.cf_cache_statusstringmetadata.response.headers.cf_cache_statuslog_attributes['response.headers.cf_cache_status']response.headers.cf_raystringmetadata.response.headers.cf_raylog_attributes['response.headers.cf_ray']response.headers.content_locationstringmetadata.response.headers.content_locationlog_attributes['response.headers.content_location']response.headers.content_rangestringmetadata.response.headers.content_rangelog_attributes['response.headers.content_range']response.headers.content_typestringmetadata.response.headers.content_typelog_attributes['response.headers.content_type']response.headers.datestringmetadata.response.headers.datelog_attributes['response.headers.date']response.headers.sb_gateway_versionstringmetadata.response.headers.sb_gateway_versionlog_attributes['response.headers.sb_gateway_version']response.headers.transfer_encodingstringmetadata.response.headers.transfer_encodinglog_attributes['response.headers.transfer_encoding']response.headers.x_kong_proxy_latencystringmetadata.response.headers.x_kong_proxy_latencylog_attributes['response.headers.x_kong_proxy_latency']response.origin_timenumbermetadata.response.origin_timelog_attributes['response.origin_time']response.status_codenumbermetadata.response.status_codelog_attributes['response.status_code']severity_textStringsourceStringtimestampdatetime