Registry / observability / exframe-logger

exframe-logger

JSON →
library3.8.7jsnpmunverified

Exframe Logger is a foundational logging module designed for the Harmony Framework, built on top of the popular Winston logging library. It provides a structured approach to application-level logging, offering standard log levels such as `debug`, `info`, `warn`, and `error`. Currently at version 3.8.7, the package generally follows a stable release cadence with patch updates for bug fixes and minor improvements. Its key differentiator is its integration within the Exframe ecosystem, providing a consistent logging experience for applications leveraging other Exframe modules. Developers looking for a robust, Winston-backed logger within a structured framework context will find it suitable, though it can also be used standalone. It ships with TypeScript types, promoting better developer experience and type safety.

npm install exframe-logger
INSTALL
IMPORT
SIG · EXFRAME-LOGGER
E
exframe-logger
observabilityjavascriptv3.8.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Logger
import ExframeLogger from 'exframe-logger'; const logger = ExframeLogger.create();
const Logger = require("logger").create();
The primary way to instantiate a logger. The package likely exports a module object as default, with a 'create' method. Ensure you use the correct package name `exframe-logger`, not just `logger`.
create
import { create } from 'exframe-logger'; const logger = create();
import ExframeLogger from 'exframe-logger'; const logger = ExframeLogger.create(); // not strictly wrong, but potentially less direct if 'create' is a named export
If `create` is a direct named export, this is the preferred ESM import. Some setups might require the default import pattern shown above.
ExframeLoggerConfig
import type { ExframeLoggerConfig } from 'exframe-logger';
Type import for configuring the logger, useful for type-checking and autocompletion in TypeScript projects.

Demonstrates how to import and instantiate the Exframe Logger, then log messages across various severity levels with optional metadata.

import ExframeLogger from 'exframe-logger'; // Create a logger instance with default configuration (or pass an object for custom options) const logger = ExframeLogger.create(); // Log messages at different levels logger.info('Application started successfully.'); logger.debug('Database connection string: ' + process.env.DB_CONNECTION_STRING ?? 'default_connection'); logger.warn('Potential performance bottleneck detected.', { component: 'auth-service', durationMs: 1200 }); try { throw new Error('Failed to process user request'); } catch (error) { logger.error('An unhandled error occurred.', { errorMessage: error.message, stack: error.stack, userId: 'user-123' }); }
Debug
Known issues
gotchaThe README example `require("logger")` is misleading. The correct package name for importing is `exframe-logger`. Using `logger` directly will result in a 'module not found' error unless `logger` is a symlink or an alias in your project.
fix
Always use `import ... from 'exframe-logger'` for ESM or `const ... = require('exframe-logger')` for CommonJS.
affects: >=1.0.0
breakingThe package requires Node.js version 14.0.0 or higher. Older Node.js versions will encounter syntax errors or fail to install due to engine restrictions.
fix
Upgrade your Node.js runtime to version 14.0.0 or newer (e.g., using `nvm install 18` or `nvm use 18`).
affects: >=3.0.0
gotchaBy default, `exframe-logger` might only log 'info' level and above, depending on its internal Winston configuration. Debug messages may not appear in production or even development environments without explicit configuration.
fix
Configure the logger's level during instantiation (e.g., `ExframeLogger.create({ level: 'debug' })`) or via environment variables if the library supports it, to ensure desired log levels are captured.
affects: >=1.0.0
gotchaWhile built on Winston, direct access to underlying Winston transports or advanced configurations might require understanding Exframe Logger's abstraction layer. Don't assume direct Winston API compatibility without consulting documentation.
fix
Refer to the `exframe-logger` documentation for custom transport setup or advanced configuration options. If specific Winston features are needed directly, consider using Winston independently.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'logger'
Incorrect package name used in `require()` or `import` statement.
fix
Change `require('logger')` to `require('exframe-logger')` or `import ... from 'exframe-logger'`.
TypeError: ExframeLogger.create is not a function
The module was imported incorrectly, or `create` is not directly exposed as a method on the default export.
fix
Ensure you are importing the default export correctly (e.g., `import ExframeLogger from 'exframe-logger'; const logger = ExframeLogger.create();`) or if `create` is a named export, use `import { create } from 'exframe-logger'; const logger = create();`.
SyntaxError: Cannot use import statement outside a module
Attempting to use ES module `import` syntax in a CommonJS context (e.g., in a `.js` file without `"type": "module"` in `package.json` or without `.mjs` extension).
fix
Either convert your project to use ES Modules by adding `"type": "module"` to your `package.json` and updating file extensions, or use CommonJS `require()` syntax: `const ExframeLogger = require('exframe-logger'); const logger = ExframeLogger.create();`.
Upgrade
Version history
3.8.7latest on npm
Audit
Dependencies
winstonrequiredCore logging engine and transport management.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
2
Resources
exframe-logger — npm install exframe-logger · libregistry