
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
mongoose-events-event-logger
Advanced tools
creates a mongoose event handler that logs mongoose events for the given event type
creates a mongoose event handler that logs mongoose events for the given event type using console.log and console.error.
npm install mongoose-events-event-logger
/**
* @param {string} event_type
* @param {Object} db_connection
* @param {Object} [custom_logger]
*
* @return {Function} logEvent
*/
createEventLogger( event_type, db_connection, custom_logger )
add an event logger to the mongoose db connection for each event type you want to log. the event logger will default to using the console to log events, however, you can optionally pass in your own logging service.
the log message is composed using new Date() and the db connection info; e.g. [info] %date connected to mongodb://%host:%port/%database
var createEventLogger = require( 'mongoose-events-event-logger' )
var db
db = mongoose.connection
db.on( 'connected', createEventLogger( 'connected', db ) )
var eventLogger = require( 'mongoose-events-event-logger' )
var db
// logging service needs to have a .log( arg1[, arg2[, ...] ] ) method
var logger = require( 'your-custom-logger' )
db = mongoose.connection
db.on( 'connected', createEventLogger( 'connected', db, logger ) )
FAQs
creates a mongoose event handler that logs mongoose events for the given event type
We found that mongoose-events-event-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.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies