You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A module to provide logging and monitoring integrations (Winston, Pino, Sentry, Application Insights, etc.) for NexusDI, with injectable loggers/clients and optional decorators for error reporting, tracing, and context propagation.
Motivation
Centralized, injectable logging/monitoring: Make it easy to inject and mock loggers or monitoring clients in services.
Support for multiple providers: Allow users to choose their preferred logger and monitoring backend.
Declarative error reporting and tracing: Use decorators for error reporting, tracing, and context propagation.
Extensibility: Enable advanced features (structured logging, log levels, async error reporting, etc.) and pass options directly to providers.
Proposed Features
Register logger/monitoring providers via config (e.g., in container.json)
Inject loggers/clients into services using @InjectLogger() or @InjectMonitor()
Support for multiple named loggers/monitors (e.g., default, audit, etc.)
Decorators for error reporting (@ReportError()), tracing (@Trace()), and context propagation
Support for structured logging, log levels, and context
Pass all options/config down to the underlying logger/monitoring provider
Easy mocking/overriding of loggers/monitors for testing
Example Workflow
Configure the logging/monitoring module in container.json:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
A module to provide logging and monitoring integrations (Winston, Pino, Sentry, Application Insights, etc.) for NexusDI, with injectable loggers/clients and optional decorators for error reporting, tracing, and context propagation.
Motivation
Proposed Features
container.json)@InjectLogger()or@InjectMonitor()default,audit, etc.)@ReportError()), tracing (@Trace()), and context propagationExample Workflow
Configure the logging/monitoring module in
container.json:{ "logging": { "default": { "provider": "winston", "level": "info", "transports": [ { "type": "console" } ] }, "audit": { "provider": "pino", "level": "warn" } }, "monitoring": { "sentry": { "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0" }, "appInsights": { "instrumentationKey": "YOUR_INSTRUMENTATION_KEY" } } }Register the logging/monitoring module:
Inject loggers/monitors and use decorators:
Open Questions
API Sketch
Call for Feedback
Beta Was this translation helpful? Give feedback.
All reactions