ObjectStackObjectStack

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

TypeScript Usage

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);

ConsoleDestinationConfig

Console destination configuration

Properties

PropertyTypeRequiredDescription
streamEnum<'stdout' | 'stderr'>optional (default: "stdout")
colorsbooleanoptional (default: true)
prettyPrintbooleanoptional (default: false)

ExtendedLogLevel

Extended log severity level

Allowed Values

  • trace
  • debug
  • info
  • warn
  • error
  • fatal

ExternalServiceDestinationConfig

External service destination configuration

Properties

PropertyTypeRequiredDescription
endpointstringoptional
regionstringoptional
credentials{ accessKeyId?: string; secretAccessKey?: string; apiKey?: string; environmentId?: string }optional
logGroupstringoptional
logStreamstringoptional
indexstringoptional
configRecord<string, any>optional

FileDestinationConfig

File destination configuration

Properties

PropertyTypeRequiredDescription
pathstring✅Log file path
rotation{ maxSize?: string; maxFiles?: integer; compress?: boolean; interval?: Enum<'hourly' | 'daily' | 'weekly' | 'monthly'> }optional
encodingstringoptional (default: "utf8")
appendbooleanoptional (default: true)

HttpDestinationConfig

HTTP destination configuration

Properties

PropertyTypeRequiredDescription
urlstring✅HTTP endpoint URL
methodEnum<'POST' | 'PUT'>optional (default: "POST")
headersRecord<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
timeoutMsintegeroptional (default: 30000)Timeout in milliseconds
timeoutneveroptional[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.

Nested Shape: HttpDestinationConfig.auth

PropertyTypeRequiredDescription
typeEnum<'basic' | 'bearer' | 'api_key'>✅Auth type
usernamestringoptional
passwordstringoptional
tokenstringoptional
apiKeystringoptional
apiKeyHeaderstringoptional (default: "X-API-Key")

Nested Shape: HttpDestinationConfig.batch

PropertyTypeRequiredDescription
maxSizeintegeroptional (default: 100)
flushIntervalMsintegeroptional (default: 5000)Flush interval in milliseconds
flushIntervalneveroptional[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.

Nested Shape: HttpDestinationConfig.retry

PropertyTypeRequiredDescription
maxAttemptsintegeroptional (default: 3)
initialDelayMsintegeroptional (default: 1000)Initial retry delay in milliseconds
initialDelayneveroptional[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.
backoffMultipliernumberoptional (default: 2)

LogDestination

Log destination configuration

Properties

PropertyTypeRequiredDescription
namestring✅Destination name (snake_case)
typeEnum<'console' | 'file' | 'syslog' | 'elasticsearch' | 'cloudwatch' | 'stackdriver' | 'azure_monitor' | 'datadog' | 'splunk' | 'loki' | 'http' | 'kafka' | 'redis' | 'custom'>✅Destination type
levelEnum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>optional (default: "info")Extended log severity level
enabledbooleanoptional (default: true)
console{ stream?: Enum<'stdout' | 'stderr'>; colors?: boolean; prettyPrint?: boolean }optionalConsole destination configuration
file{ path: string; rotation?: object; encoding?: string; append?: boolean }optionalFile destination configuration
http{ url: string; method?: Enum<'POST' | 'PUT'>; headers?: Record<string, string>; auth?: object; … }optionalHTTP destination configuration
externalService{ endpoint?: string; region?: string; credentials?: object; logGroup?: string; … }optionalExternal service destination configuration
formatEnum<'json' | 'text' | 'pretty'>optional (default: "json")
filterIdstringoptionalFilter function identifier

Nested Shape: LogDestination.file

PropertyTypeRequiredDescription
pathstring✅Log file path
rotation{ maxSize?: string; maxFiles?: integer; compress?: boolean; interval?: Enum<'hourly' | 'daily' | 'weekly' | 'monthly'> }optional
encodingstringoptional (default: "utf8")
appendbooleanoptional (default: true)

Nested Shape: LogDestination.http

PropertyTypeRequiredDescription
urlstring✅HTTP endpoint URL
methodEnum<'POST' | 'PUT'>optional (default: "POST")
headersRecord<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
timeoutMsintegeroptional (default: 30000)Timeout in milliseconds
timeoutneveroptional[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.

LogDestinationType

Log destination type

Allowed Values

  • console
  • file
  • syslog
  • elasticsearch
  • cloudwatch
  • stackdriver
  • azure_monitor
  • datadog
  • splunk
  • loki
  • http
  • kafka
  • redis
  • custom

LogEnrichmentConfig

Log enrichment configuration

Properties

PropertyTypeRequiredDescription
staticFieldsRecord<string, any>optionalStatic fields added to every log
dynamicEnrichersstring[]optionalDynamic enricher function IDs
addHostnamebooleanoptional (default: true)
addProcessIdbooleanoptional (default: true)
addEnvironmentbooleanoptional (default: true)
addTimestampFormats{ unix?: boolean; iso?: boolean }optional
addCallerbooleanoptional (default: false)
addCorrelationIdsbooleanoptional (default: true)

LogEntry

Properties

PropertyTypeRequiredDescription
timestampstring✅ISO 8601 timestamp
levelEnum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>✅Log severity level
messagestring✅Log message
contextRecord<string, any>optionalStructured context data
errorRecord<string, any>optionalError object if present
traceIdstringoptionalDistributed trace ID
spanIdstringoptionalSpan ID
servicestringoptionalService name
componentstringoptionalComponent name (e.g. plugin id)

LogFormat

Log output format

Allowed Values

  • json
  • text
  • pretty

LogLevel

Log severity level

Allowed Values

  • debug
  • info
  • warn
  • error
  • fatal
  • silent

LoggerConfig

Properties

PropertyTypeRequiredDescription
namestringoptionalLogger name identifier
levelEnum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info")Log severity level
formatEnum<'json' | 'text' | 'pretty'>optional (default: "json")Log output format
redactstring[]optional (default: ["password","token","secret","key"])Keys to redact from log context
sourceLocationbooleanoptional (default: false)Include file and line number
filestringoptionalPath to log file
rotation{ maxSize?: string; maxFiles?: number }optional

LoggingConfig

Logging configuration

Properties

PropertyTypeRequiredDescription
namestring✅Configuration name (snake_case, max 64 chars)
labelstring✅Display label
enabledbooleanoptional (default: true)
levelEnum<'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[]; … }optionalDefault logger configuration
loggersRecord<string, { name?: string; level?: Enum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>; format?: Enum<'json' | 'text' | 'pretty'>; redact?: string[]; … }>optionalNamed 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; … }optionalLog enrichment configuration
redactstring[]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

Nested Shape: LoggingConfig.default

PropertyTypeRequiredDescription
namestringoptionalLogger name identifier
levelEnum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info")Log severity level
formatEnum<'json' | 'text' | 'pretty'>optional (default: "json")Log output format
redactstring[]optional (default: ["password","token","secret","key"])Keys to redact from log context
sourceLocationbooleanoptional (default: false)Include file and line number
filestringoptionalPath to log file
rotation{ maxSize?: string; maxFiles?: number }optional

Nested Shape: LoggingConfig.loggers[string]

PropertyTypeRequiredDescription
namestringoptionalLogger name identifier
levelEnum<'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent'>optional (default: "info")Log severity level
formatEnum<'json' | 'text' | 'pretty'>optional (default: "json")Log output format
redactstring[]optional (default: ["password","token","secret","key"])Keys to redact from log context
sourceLocationbooleanoptional (default: false)Include file and line number
filestringoptionalPath to log file
rotation{ maxSize?: string; maxFiles?: number }optional

Nested Shape: LoggingConfig.destinations[number]

Log destination configuration

PropertyTypeRequiredDescription
namestring✅Destination name (snake_case)
typeEnum<'console' | 'file' | 'syslog' | 'elasticsearch' | 'cloudwatch' | 'stackdriver' | …>✅Destination type
levelEnum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>optional (default: "info")Extended log severity level
enabledbooleanoptional (default: true)
console{ stream?: Enum<'stdout' | 'stderr'>; colors?: boolean; prettyPrint?: boolean }optionalConsole destination configuration
file{ path: string; rotation?: object; encoding?: string; append?: boolean }optionalFile destination configuration
http{ url: string; method?: Enum<'POST' | 'PUT'>; headers?: Record<string, string>; auth?: object; … }optionalHTTP destination configuration
externalService{ endpoint?: string; region?: string; credentials?: object; logGroup?: string; … }optionalExternal service destination configuration
formatEnum<'json' | 'text' | 'pretty'>optional (default: "json")
filterIdstringoptionalFilter function identifier

Nested Shape: LoggingConfig.enrichment

PropertyTypeRequiredDescription
staticFieldsRecord<string, any>optionalStatic fields added to every log
dynamicEnrichersstring[]optionalDynamic enricher function IDs
addHostnamebooleanoptional (default: true)
addProcessIdbooleanoptional (default: true)
addEnvironmentbooleanoptional (default: true)
addTimestampFormats{ unix?: boolean; iso?: boolean }optional
addCallerbooleanoptional (default: false)
addCorrelationIdsbooleanoptional (default: true)

Nested Shape: LoggingConfig.buffer

PropertyTypeRequiredDescription
enabledbooleanoptional (default: true)
sizeintegeroptional (default: 1000)
flushIntervalMsintegeroptional (default: 1000)Flush interval in milliseconds
flushIntervalneveroptional[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.
flushOnShutdownbooleanoptional (default: true)

StructuredLogEntry

Structured log entry

Properties

PropertyTypeRequiredDescription
timestampstring✅ISO 8601 timestamp
levelEnum<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>✅Log severity level
messagestring✅Log message
contextRecord<string, any>optionalStructured context
error{ name?: string; message?: string; stack?: string; code?: string; … }optionalError details
trace{ traceId: string; spanId: string; parentSpanId?: string; traceFlags?: integer }optionalDistributed tracing context
source{ service?: string; component?: string; file?: string; line?: integer; … }optionalSource information
host{ hostname?: string; pid?: integer; ip?: string }optionalHost information
environmentstringoptionalEnvironment (e.g., production, staging)
user{ id?: string; username?: string; email?: string }optionalUser context
request{ id?: string; method?: string; path?: string; userAgent?: string; … }optionalRequest context
labelsRecord<string, string>optionalCustom labels
metadataRecord<string, any>optionalAdditional metadata

Nested Shape: StructuredLogEntry.trace

PropertyTypeRequiredDescription
traceIdstring✅Trace ID
spanIdstring✅Span ID
parentSpanIdstringoptionalParent span ID
traceFlagsintegeroptionalTrace flags

Nested Shape: StructuredLogEntry.source

PropertyTypeRequiredDescription
servicestringoptionalService name
componentstringoptionalComponent name
filestringoptionalSource file
lineintegeroptionalLine number
functionstringoptionalFunction name

On this page