Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@thecolvinco/nodejs-logger
Advanced tools
A logger abstraction to log message with standard structure and with some useful middlewares
import { Logger } from '@thecolvinco/nodejs-logger';
const logger = new Logger({
appName: 'My foo app',
appVersion: '1',
enviroment: 'production',
isProduction: true,
loggerOptions: {}, // Optional for override pourpose
});
logger.info('A simple message')
logger.info('Some fancy message with tags', { tags: ['super-drama', 'fancy-error'] })
logger.info('Some fancy message with tags and extra object data', { tags: ['super-drama', 'fancy-error'], meta: { foo: 'bar' } })
Development output
{
tags: [ 'super-drama', 'fancy-error' ],
meta: { foo: 'bar' },
level: 'info',
message: 'Some fancy message with tags and extra object data'
}
Production output
{"version":"1","appName":"My foo app","enviroment":"production","tags":["super-drama","fancy-error"],"meta":{"foo":"bar"},"level":"info","message":"Some fancy message with tags and extra object data"}
import { Logger, expressErrorMiddleware, expressWinstonRequestMiddleware } from '@thecolvinco/nodejs-logger';
const server = express();
const logger = new Logger(
{
appName: 'foo',
appVersion: '1',
enviroment: 'production',
isProduction: true,
}
);
// Log non controlled errors
server.use(expressErrorMiddleware(logger));
// Log all express requests with winston
server.use(expressWinstonRequestMiddleware(logger);
// Log all express requests with winston adding some winston options
server.use(expressWinstonRequestMiddleware(logger, {
headerBlacklist: ['cookie'],
dynamicMeta: (req) => ({
countryCode: req?.cookies?.hc,
locale: req?.cookies?.hl,
})},
));
This package is maintained by TheColvinCo
Code is licensed under the MIT License.
FAQs
Nodejs/Express colvin logs standard
The npm package @thecolvinco/nodejs-logger receives a total of 14 weekly downloads. As such, @thecolvinco/nodejs-logger popularity was classified as not popular.
We found that @thecolvinco/nodejs-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.