+ content: "import { envBoolean, envNumber, envString } from \"@warblerjs/config\";\n\nexport const loggingConfig = {\n /*\n * Application environment.\n *\n * development and staging keep framework-owned informational logs enabled so\n * route, transport, and WebSocket behavior is easy to inspect while building.\n *\n * production disables informational hot-path logs by default. Errors and fatal\n * process failures stay enabled unless explicitly overridden below.\n */\n environment: envString(\"APP_ENV\", \"development\"),\n\n /*\n * HTTP request/access logging.\n *\n * When disabled, Warbler selects a quiet HTTP handler at startup. The request\n * path avoids request-log formatting, request-log objects, logging-only timing,\n * and stdout writes for successful requests.\n */\n requests: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_REQUESTS\", false),\n\n /*\n * Runtime lifecycle informational logs.\n *\n * Covers framework-owned runtime stop/status messages. Disable in production\n * to keep process output quiet outside exceptional conditions.\n */\n runtime: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_RUNTIME\", false),\n\n /*\n * Transport informational logs.\n *\n * Used by framework-owned transport startup/stop notices. This does not disable\n * transports or change routing, validation, security, or application behavior.\n */\n transports: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_TRANSPORTS\", false ),\n\n /*\n * WebSocket infrastructure logs.\n *\n * When disabled, Warbler avoids connection/message/disconnect log formatting\n * and logging-only timing while preserving subscriptions, publishing, guards,\n * validators, rate limits, and error boundaries.\n */\n websocket: envBoolean(\"LOG_WEBSOCKET\", envString(\"APP_ENV\", \"development\") !== \"production\"),\n\n /*\n * Error logging.\n *\n * Enabled by default in every environment. Error logs never include request\n * bodies, credentials, passwords, tokens, or secrets.\n */\n errors: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_ERRORS\", true),\n\n /*\n * Fatal process logging.\n *\n * Enabled by default in every environment. This is only for process-level\n * uncaught exceptions/unhandled rejections that escape normal boundaries.\n */\n fatal: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_FATAL\", true),\n\n /*\n * Startup output and debug logs.\n *\n * Kept separate from request logging because startup is outside the request hot\n * path. Production defaults keep it quiet unless explicitly enabled.\n */\n startup: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_STARTUP\", false),\n debug: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_DEBUG\", false),\n\n channels: {\n console: {\n enabled: envString(\"APP_ENV\", \"development\") === \"production\" ? false : envBoolean(\"LOG_CONSOLE\", true),\n },\n file: {\n enabled: envBoolean(\"LOG_FILE\", true),\n path: envString(\"LOG_FILE_PATH\", \"storage/logs\"),\n rotation: \"daily\",\n retentionDays: envNumber(\"LOG_RETENTION_DAYS\", 14),\n cleanup: \"internal\",\n format: \"pretty\",\n },\n },\n} as const;\n",
0 commit comments