Skip to content

Configuration Reference

OptionTypeDefaultRequiredDescription
projectIdstringYesProject identifier, auto-creates in desktop app
mode"local" | "desktop" | "cloud"YesDetermines endpoint URL
apiKeystringNoAPI key (required for cloud mode)
endpointstringNoOverride endpoint URL
envstringNoEnvironment label
appNamestringNoApplication name
appVersionstringNoApplication version
defaultTagsRecord<string, string>{}NoTags merged into every log
batchSizenumber10NoLogs before auto-flush
flushIntervalnumber5000NoAuto-flush interval (ms)
maxQueueSizenumber1000NoDrop oldest entries when exceeded
maxLogRatenumber10NoLogs per second (token bucket, 0 = unlimited)
maxBurstnumber100NoBurst allowance for rate limiting
bucketsstring[]NoTyped bucket accessors with autocomplete
beforeSend(entry) => entry | nullNoTransform or drop logs before batching
hooksobjectNoLifecycle hooks (see below)
isDisabledbooleanfalseNoKill switch — disables all logging
isDebugbooleanfalseNoDisables gzip compression
sessionIdstringauto-generatedNoOverride auto-generated session ID
fetchfunctionglobalThis.fetchNoCustom fetch implementation
hooks: {
onLog: (entry) => void; // Called after log is added to queue
onFlush: (logs, success) => void; // Called after batch flush attempt
onError: (error) => void; // Called on flush failure
}
ModeURL
desktophttp://localhost:17655
localhttps://local.gunsole.com
cloudhttps://api.gunsole.com

LogOptions (what you pass to gunsole.info(), etc.)

Section titled “LogOptions (what you pass to gunsole.info(), etc.)”
FieldTypeRequiredDescription
messagestringYesHuman-readable log message
bucketstringYesCategory name (auto-created)
contextRecord<string, unknown>NoArbitrary structured data
tagsPartial<Tags> | TagEntry<Tags>[]NoFilterable key-value pairs
traceIdstringNoLinks related log entries

BucketLogOptions (what you pass to gunsole.payment(), etc.)

Section titled “BucketLogOptions (what you pass to gunsole.payment(), etc.)”
FieldTypeRequiredDescription
contextRecord<string, unknown>NoArbitrary structured data
tagsPartial<Tags> | TagEntry<Tags>[]NoFilterable key-value pairs
traceIdstringNoLinks related log entries

These are set automatically by the SDK and sent with every log:

FieldSource
levelDetermined by method: info(), debug(), warn(), error(), fatal()
timestampDate.now() (unix milliseconds)
userIdFrom gunsole.setUser({ id: "..." })
sessionIdFrom gunsole.setSessionId("...") or auto-generated
envFrom config
appNameFrom config
appVersionFrom config

Cannot be used with buckets config option:

log, info, debug, warn, error, fatal,
setUser, setSessionId, setDebug, flush, destroy, isDestroyed,
drainBatch, projectId, apiKey, logEndpoint,
attachGlobalErrorHandlers, detachGlobalErrorHandlers

Cannot be used as tag schema keys:

bucket, message, level, timestamp, userId, sessionId, env, appName, appVersion


ExportDescription
createGunsoleClientFactory function to create client
GunsoleClientClient class
persistSession(@gunsole/web) Cookie-based session persistence
ExportDescription
GunsoleClientConfigConfiguration options
LogEntryLog entry structure
LogLevel"info" | "debug" | "warn" | "error" | "fatal"
LogOptionsOptions passed to log methods
TagEntrySingle-key tag entry type
UserInfoUser information
ClientMode"cloud" | "desktop" | "local"
BucketLogOptionsLog options for bucket methods (no bucket/message)
BucketLoggerCallable bucket accessor interface
WithBucketsMapped type adding bucket accessors to client
ReservedBucketNameUnion of reserved bucket names
ValidateBucketsCompile-time bucket name validator
ReservedTagKeyUnion of reserved tag keys
ValidTagSchemaCompile-time tag schema constraint
  • TypeScript 5.0+ required for const generic inference (bucket literal types)
  • TypeScript 5.4+ recommended for NoInfer (bucket name compile-time validation)
  • Target: ES2020

The SDK sends logs via HTTP POST:

POST {endpoint}/logs
Content-Type: application/json
Content-Encoding: gzip
X-Gunsole-SDK-Version: 0.2.0
Authorization: Bearer {apiKey} // only in cloud mode

Retry behavior: 3 attempts with exponential backoff (1s, 2s, 4s) + jitter (0.5-1.5x). HTTP 413 splits the batch and retries. 4xx (except 429) are not retried. Logs are dropped after 10 consecutive flush failures.


SettingDefaultDescription
Log retention (days)UnlimitedAuto-delete logs older than N days
Auto-delete old logsOffEnable/disable retention enforcement
SettingDefaultDescription
Log retention (days)Inherits projectOverride project retention per bucket
SettingOptionsDescription
ThemeLight / Dark / AutoUI color scheme

SettingValue
Default port17655
Hostlocalhost only
CORSEnabled (all origins)
Compressiongzip accepted on request body

These are compiled into the desktop app and not user-configurable:

ConstantValueDescription
Log batch size50Max logs per flush to DB
Batch interval100msMax time between DB flushes
Frontend buffer~2000 logsMax in-memory logs in viewer
New log animation3 secondsGreen fade duration for new entries

SettingValue
EngineSQLite (WAL mode)
Location (macOS)~/Library/Application Support/gunsole/gunsole.db
Location (Linux)~/.local/share/gunsole/gunsole.db
Location (Windows)%APPDATA%\gunsole\gunsole.db
Tablesworkspaces, projects, buckets, filters, logs, tags, log_tag_map, app_preferences
Foreign keysEnabled
MigrationsAuto-run on startup