Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
genie-logger
Advanced tools
Reusable Node.js logger for platform Lambda services.
To install this library into your project
$ npm i @genie-solutions/genie-logger
This library is built using uuid, winston and winston-transport
import { createLoggerFromContext } from "./services/logging";
const createLogger = createLoggerFromContext(APP_NAME, STAGE, LOG_LEVEL);
const logger = createLogger(context.awsRequestId);
logger.info({
type: EventType.CreditAssessed,
payload: {
threadId,
tenantId,
creditBalance,
calculatedCost: cost
}
});
logger.error({
type: EventType.CreditServiceError,
error: { message: error.message }
});
logger.warn({
type: EventType.CreditServiceWarning,
error: { message: error.message }
});
logger.debug({
type: EventType.CreditServiceDebug,
error: { message: error.message }
});
//
// Start profile of 'test'
//
logger.profile('test');
setTimeout(function () {
//
// Stop profile of 'test'. Logging will now take place:
// '17 Jan 21:00:00 - info: test duration=1000ms'
//
logger.profile('test');
}, 1000);
This will output {"level":"info","durationMs":2311,"message":"test"}
in the log
// Returns an object corresponding to a specific timing. When done
// is called the timer will finish and log the duration. e.g.:
//
const profiler = logger.startTimer();
setTimeout(function () {
profiler.done({ message: 'Logging message' });
},
This will output {"message":"Logging message","level":"info","durationMs":14990}
in the log
The default logger will include the three parameter metadata(APP_NAME, STAGE, LOG_LEVEL) in the log, to extend this with extra metadata, use the extend function
const logger = createLogger(context.awsRequestId).extend(
pick({ requestId: "451" })
);
logger.info("Child logging");
This will output following log:
{"requestId":"451","message":"Child logging","level":"info"}
FAQs
Reusable Node.js logger for platform Lambda services.
We found that genie-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.