Logging schema — System Protocol reference Logging Protocol - Comprehensive Observability Logging. Reference for ConsoleDestinationConfig and 13 more: every property with its type and default.
Logging Protocol - Comprehensive Observability Logging
Unified logging protocol that combines:
Basic kernel logging (LoggerConfig)
Enterprise-grade features (LoggingConfig)
Multiple log destinations (file, console, external services)
Structured logging with enrichment
Log aggregation and forwarding
Integration with external log management systems
Source: packages/spec/src/system/logging.zod.ts
import { ConsoleDestinationConfigSchema, ExtendedLogLevel, ExternalServiceDestinationConfigSchema, FileDestinationConfigSchema, HttpDestinationConfigSchema, LogDestinationSchema, LogDestinationType, LogEnrichmentConfigSchema, LogEntrySchema, LogFormat, LogLevel, LoggerConfigSchema, LoggingConfigSchema, StructuredLogEntrySchema } from '@objectstack/spec/system' ;
import type { ConsoleDestinationConfig, ExtendedLogLevel, ExternalServiceDestinationConfig, FileDestinationConfig, HttpDestinationConfig, LogDestination, LogDestinationType, LogEnrichmentConfig, LogEntry, LogFormat, LogLevel, LoggerConfig, LoggingConfig, StructuredLogEntry } from '@objectstack/spec/system' ;
// Validate data
const result = ConsoleDestinationConfigSchema. parse (data);
Console destination configuration
Property Type Required Description stream Enum<'stdout' | 'stderr'>optional (default: "stdout") colors booleanoptional (default: true) prettyPrint booleanoptional (default: false)
Extended log severity level
trace
debug
info
warn
error
fatal
External service destination configuration
Property Type Required Description endpoint stringoptional region stringoptional credentials { accessKeyId?: string; secretAccessKey?: string; apiKey?: string; environmentId?: string }optional logGroup stringoptional logStream stringoptional index stringoptional config Record<string, any>optional
File destination configuration
Property Type Required Description path string✅ Log file path rotation { maxSize?: string; maxFiles?: integer; compress?: boolean; interval?: Enum<'hourly' | 'daily' | 'weekly' | 'monthly'> }optional encoding stringoptional (default: "utf8") append booleanoptional (default: true)
HTTP destination configuration
Property Type Required Description url string✅ HTTP endpoint URL method Enum<'POST' | 'PUT'>optional (default: "POST") headers Record<string, string>optional auth { type: Enum<'basic' | 'bearer' | 'api_key'>; username?: string; password?: string; token?: string; … }optional batch { maxSize?: integer; flushIntervalMs?: integer }optional retry { maxAttempts?: integer; initialDelayMs?: integer; backoffMultiplier?: number }optional timeoutMs integeroptional (default: 30000) Timeout in milliseconds timeout neveroptional [REMOVED] HttpDestinationConfig.timeout was renamed to timeoutMs in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Its unit (milliseconds) lived in a source JSDoc only and the key carried no .describe() at all, so the reference page published a bare 30000. Rename the key to timeoutMs; the value (milliseconds) and the 30000 default are unchanged.
Property Type Required Description type Enum<'basic' | 'bearer' | 'api_key'>✅ Auth type username stringoptional password stringoptional token stringoptional apiKey stringoptional apiKeyHeader stringoptional (default: "X-API-Key")
Property Type Required Description maxSize integeroptional (default: 100) flushIntervalMs integeroptional (default: 5000) Flush interval in milliseconds flushInterval neveroptional [REMOVED] HttpDestinationConfig.batch.flushInterval was renamed to flushIntervalMs in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Its unit (milliseconds) lived in a source JSDoc only and the key carried no .describe() at all, so the reference page published a bare 5000. Rename the key to flushIntervalMs; the value (milliseconds) and the 5000 default are unchanged. This is the batch flush on an HTTP log destination — LoggingConfig.buffer.flushInterval is a different key with its own rename.
Property Type Required Description maxAttempts integeroptional (default: 3) initialDelayMs integeroptional (default: 1000) Initial retry delay in milliseconds initialDelay neveroptional [REMOVED] HttpDestinationConfig.retry.initialDelay was renamed to initialDelayMs in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Its unit (milliseconds) lived in a source JSDoc only and the key carried no .describe() at all, so the reference page published a bare 1000. Rename the key to initialDelayMs; the value (milliseconds) and the 1000 default are unchanged. backoffMultiplier numberoptional (default: 2)
Log destination configuration
Property Type Required Description name string✅ Destination name (snake_case) type Enum<'console' | 'file' | 'syslog' | 'elasticsearch' | 'cloudwatch' | 'stackdriver' | 'azure_monitor' | 'datadog' | 'splunk' | 'loki' | 'http' | 'kafka' | 'redis' | 'custom'>✅ Destination type level Enum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>optional (default: "info") Extended log severity level enabled booleanoptional (default: true) console { stream?: Enum<'stdout' | 'stderr'>; colors?: boolean; prettyPrint?: boolean }optional Console destination configuration file { path: string; rotation?: object; encoding?: string; append?: boolean }optional File destination configuration http { url: string; method?: Enum<'POST' | 'PUT'>; headers?: Record<string, string>; auth?: object; … }optional HTTP destination configuration externalService { endpoint?: string; region?: string; credentials?: object; logGroup?: string; … }optional External service destination configuration format Enum<'json' | 'text' | 'pretty'>optional (default: "json") filterId stringoptional Filter function identifier
Property Type Required Description path string✅ Log file path rotation { maxSize?: string; maxFiles?: integer; compress?: boolean; interval?: Enum<'hourly' | 'daily' | 'weekly' | 'monthly'> }optional encoding stringoptional (default: "utf8") append booleanoptional (default: true)
Property Type Required Description url string✅ HTTP endpoint URL method Enum<'POST' | 'PUT'>optional (default: "POST") headers Record<string, string>optional auth { type: Enum<'basic' | 'bearer' | 'api_key'>; username?: string; password?: string; token?: string; … }optional batch { maxSize?: integer; flushIntervalMs?: integer }optional retry { maxAttempts?: integer; initialDelayMs?: integer; backoffMultiplier?: number }optional timeoutMs integeroptional (default: 30000) Timeout in milliseconds timeout neveroptional [REMOVED] HttpDestinationConfig.timeout was renamed to timeoutMs in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Its unit (milliseconds) lived in a source JSDoc only and the key carried no .describe() at all, so the reference page published a bare 30000. Rename the key to timeoutMs; the value (milliseconds) and the 30000 default are unchanged.
Log destination type
console
file
syslog
elasticsearch
cloudwatch
stackdriver
azure_monitor
datadog
splunk
loki
http
kafka
redis
custom
Log enrichment configuration
Property Type Required Description staticFields Record<string, any>optional Static fields added to every log dynamicEnrichers string[]optional Dynamic enricher function IDs addHostname booleanoptional (default: true) addProcessId booleanoptional (default: true) addEnvironment booleanoptional (default: true) addTimestampFormats { unix?: boolean; iso?: boolean }optional addCaller booleanoptional (default: false) addCorrelationIds booleanoptional (default: true)
Property Type Required Description timestamp string✅ ISO 8601 timestamp level Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>✅ Log severity level message string✅ Log message context Record<string, any>optional Structured context data error Record<string, any>optional Error object if present traceId stringoptional Distributed trace ID spanId stringoptional Span ID service stringoptional Service name component stringoptional Component name (e.g. plugin id)
Log output format
Log severity level
debug
info
warn
error
fatal
silent
Property Type Required Description name stringoptional Logger name identifier level Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info") Log severity level format Enum<'json' | 'text' | 'pretty'>optional (default: "json") Log output format redact string[]optional (default: ["password","token","secret","key"]) Keys to redact from log context sourceLocation booleanoptional (default: false) Include file and line number file stringoptional Path to log file rotation { maxSize?: string; maxFiles?: number }optional
Logging configuration
Property Type Required Description name string✅ Configuration name (snake_case, max 64 chars) label string✅ Display label enabled booleanoptional (default: true) level Enum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>optional (default: "info") Extended log severity level default { name?: string; level?: Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>; format?: Enum<'json' | 'text' | 'pretty'>; redact?: string[]; … }optional Default logger configuration loggers Record<string, { name?: string; level?: Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>; format?: Enum<'json' | 'text' | 'pretty'>; redact?: string[]; … }>optional Named logger configurations destinations { name: string; type: Enum<'console' | 'file' | 'syslog' | 'elasticsearch' | 'cloudwatch' | 'stackdriver' | …>; level?: Enum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>; enabled?: boolean; … }[]✅ Log destinations enrichment { staticFields?: Record<string, any>; dynamicEnrichers?: string[]; addHostname?: boolean; addProcessId?: boolean; … }optional Log enrichment configuration redact string[]optional (has default) Fields to redact sampling { enabled?: boolean; rate?: number; rateByLevel?: Record<string, number> }optional buffer { enabled?: boolean; size?: integer; flushIntervalMs?: integer; flushOnShutdown?: boolean }optional performance { async?: boolean; workers?: integer }optional
Property Type Required Description name stringoptional Logger name identifier level Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info") Log severity level format Enum<'json' | 'text' | 'pretty'>optional (default: "json") Log output format redact string[]optional (default: ["password","token","secret","key"]) Keys to redact from log context sourceLocation booleanoptional (default: false) Include file and line number file stringoptional Path to log file rotation { maxSize?: string; maxFiles?: number }optional
Property Type Required Description name stringoptional Logger name identifier level Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info") Log severity level format Enum<'json' | 'text' | 'pretty'>optional (default: "json") Log output format redact string[]optional (default: ["password","token","secret","key"]) Keys to redact from log context sourceLocation booleanoptional (default: false) Include file and line number file stringoptional Path to log file rotation { maxSize?: string; maxFiles?: number }optional
Log destination configuration
Property Type Required Description name string✅ Destination name (snake_case) type Enum<'console' | 'file' | 'syslog' | 'elasticsearch' | 'cloudwatch' | 'stackdriver' | …>✅ Destination type level Enum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>optional (default: "info") Extended log severity level enabled booleanoptional (default: true) console { stream?: Enum<'stdout' | 'stderr'>; colors?: boolean; prettyPrint?: boolean }optional Console destination configuration file { path: string; rotation?: object; encoding?: string; append?: boolean }optional File destination configuration http { url: string; method?: Enum<'POST' | 'PUT'>; headers?: Record<string, string>; auth?: object; … }optional HTTP destination configuration externalService { endpoint?: string; region?: string; credentials?: object; logGroup?: string; … }optional External service destination configuration format Enum<'json' | 'text' | 'pretty'>optional (default: "json") filterId stringoptional Filter function identifier
Property Type Required Description staticFields Record<string, any>optional Static fields added to every log dynamicEnrichers string[]optional Dynamic enricher function IDs addHostname booleanoptional (default: true) addProcessId booleanoptional (default: true) addEnvironment booleanoptional (default: true) addTimestampFormats { unix?: boolean; iso?: boolean }optional addCaller booleanoptional (default: false) addCorrelationIds booleanoptional (default: true)
Property Type Required Description enabled booleanoptional (default: true) size integeroptional (default: 1000) flushIntervalMs integeroptional (default: 1000) Flush interval in milliseconds flushInterval neveroptional [REMOVED] LoggingConfig.buffer.flushInterval was renamed to flushIntervalMs in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Its unit (milliseconds) lived in a source JSDoc only and the key carried no .describe() at all, so the reference page published a bare 1000. Rename the key to flushIntervalMs; the value (milliseconds) and the 1000 default are unchanged. This is the in-process log buffer — HttpDestinationConfig.batch.flushInterval is a different key with its own rename. flushOnShutdown booleanoptional (default: true)
Structured log entry
Property Type Required Description timestamp string✅ ISO 8601 timestamp level Enum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>✅ Log severity level message string✅ Log message context Record<string, any>optional Structured context error { name?: string; message?: string; stack?: string; code?: string; … }optional Error details trace { traceId: string; spanId: string; parentSpanId?: string; traceFlags?: integer }optional Distributed tracing context source { service?: string; component?: string; file?: string; line?: integer; … }optional Source information host { hostname?: string; pid?: integer; ip?: string }optional Host information environment stringoptional Environment (e.g., production, staging) user { id?: string; username?: string; email?: string }optional User context request { id?: string; method?: string; path?: string; userAgent?: string; … }optional Request context labels Record<string, string>optional Custom labels metadata Record<string, any>optional Additional metadata
Property Type Required Description traceId string✅ Trace ID spanId string✅ Span ID parentSpanId stringoptional Parent span ID traceFlags integeroptional Trace flags
Property Type Required Description service stringoptional Service name component stringoptional Component name file stringoptional Source file line integeroptional Line number function stringoptional Function name