
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
hmpo-logger
Advanced tools
Consistent logging for hmpo apps
Top level logging configuration:
var hmpoLogger = require('hmpo-logger');
hmpoLogger.config();
var app = require('express')();
app.use(hmpoLogger.middleware());
Logging messages:
var logger = require('hmpo-logger').get();
logger.log('error', 'This is an error');
logger.warn('This is a warning');
logger.warn('This is an %s warning', 'interpolated');
logger.info('This is just info with :meta', {meta: 'metavalue'});
logger.info(':method :url took :responseTime ms and was res[content-length] bytes', {req: req, res: res});
get(name)
Get a named winston logger. The name is prepended to the log entry messages.
require('hmpo-logger').get(name);
If name is ommited it is guessed from the nearest package.json file found in the calling package.
require('hmpo-logger').get();
If name begins with a colon it is appended to the guessed name.
require('hmpo-logger').get(':subname');
Returns a winston
logger.
config(options)
Initialise the logger at the top level of the app, specifying the log locations and logging levels of three pre-defined transports: console, app, and error.
var hmpoLogger = require('hmpo-logger');
hmpoLogger.config({
logPublicRequests: false,
console: true,
connsoleJSON: false,
consoleLevel: 'debug',
consoleColor: true,
app: './app.log',
appJSON: true,
appLevel: 'info',
error: './error.log',
errorJSON: false,
errorLevel: ['error', 'warn'],
meta: {
host: 'host',
sessionID: 'sessionID',
verb: 'method',
request: 'request'
},
requestMeta: {
clientip: 'clientip',
remoteAddress: 'connection.remoteAddress',
hostname: 'hostname',
port: 'port',
response: 'statusCode',
responseTime: 'responseTime',
httpversion: 'version',
bytes: 'res.content-length'
},
format: ':clientip :sessionID :method :request HTTP/:httpVersion :statusCode :res[content-length] - :responseTime ms'
});
Returns hmpoLogger
.
middleware()
Log incomming requests from an express
app.
var hmpoLogger = require('hmpo-logger');
var app = require('express')();
app.use(hmpoLogger.middleware());
Returns express compatible middleware
FAQs
Consistent logging for hmpo apps
The npm package hmpo-logger receives a total of 349 weekly downloads. As such, hmpo-logger popularity was classified as not popular.
We found that hmpo-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.