Nutmeg Plundering Muse

    egg-mongoose-logger

    1.0.6 • Public • Published

    egg-mongoose-logger

    NPM version build status Test coverage David deps Known Vulnerabilities npm download

    Install

    $ npm i egg-mongoose-logger --save

    Usage

    // {app_root}/config/plugin.js
    exports.mongooseLogger = {
      enable: true,
      package: 'egg-mongoose-logger',
    };

    Configuration

    // {app_root}/config/config.default.js
    exports.mongooseLogger = {
      debug: true,
      // custom formatter, optional
      formatter: function(meta) {
        const query = JSON.stringify(meta.query);
        const options = JSON.stringify(meta.options || {});
        return `db.getCollection('${meta.collectionName}').${meta.methodName}(${query}${options})`;
      },
    };

    see config/config.default.js for more detail.

    Example

    Questions & Suggestions

    Please open an issue here.

    License

    MIT

    Install

    npm i egg-mongoose-logger

    DownloadsWeekly Downloads

    9

    Version

    1.0.6

    License

    MIT

    Last publish

    Collaborators

    • quinton.xu