Repository navigation
feat!: unified pino logger replaces eventsLog and internalError - #65
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BREAKING CHANGE: eventsLog (lib-express) and internalError (lib-node/observer) are removed, use log from @data-fair/lib-node/log.js. Log output is now JSON lines on stdout (pretty in dev), EVENTS_LOG_LEVEL is removed. session.middleware() hands session loading failures to next(err) instead of rejecting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a malformed X-Forwarded-For no longer breaks requests through the session middleware - error messages and stack headers are truncated to 1000 characters - counters already registered by another copy of the module are reused - an Error passed as the message is logged as err - fields named like pino keys are renamed instead of duplicating them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uld fail loudly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- reqIp in optional mode flags a non-IP X-Forwarded-For and returns undefined instead of throwing, strict mode still throws - reserved pino keys and non-string messages are left to conventions and types - the error serializer relies on its depth limit and on the logger's try/catch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One logger for the whole stack in
@data-fair/lib-node/log.js, replacingeventsLog,internalErrorand ad-hoc console output:log.info|warn|alert|error(msg, { code?, err?, ... }): JSON lines on stdout whenNODE_ENV=production, pretty otherwise (LOG_FORMAToverrides);alertis a custom level for events that deserve the scrutiny of errorswarn/alert/errorlines counted indf_logs{level, code, host};df_internal_erroranddf_events_logstill emitted, deprecatedwithLogContext/getLogContext(also for worker threads);session.middleware()opens it per request with ip, host, user and accountdebugstays the debug API, its output is redirected into the loggerreqIpin optional mode flags a non-IPX-Forwarded-Forand returns undefined instead of throwingWhy: uniform, structured output for everything (audit events, errors, debug) so logs can be filtered by host, account, level and code in Loki/VictoriaLogs and grouped by trace id, with minimal setup and no logger instances passed around.
Heads-up:
eventsLog,internalErrorandEVENTS_LOG_LEVELremoved; release lib-node as a major first, then bump lib-express's peer range to^3.0.0(and its README) before releasing it as a majordf-event:prefix, JSON on stdout): fluent-bit routes must be adapted before services upgradesession.middleware()now passes session loading failures tonext(err)instead of rejectinginfolines no longer incrementdf_events_log