egg-logger-sentry

Logger transport for Sentry

Usage no npm install needed!

<script type="module">
  import eggLoggerSentry from 'https://cdn.skypack.dev/egg-logger-sentry';
</script>

README

egg-logger-sentry

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

Sentry SDK for Egg

Install

$ npm i egg-logger-sentry --save

Configuration

Change ${app_root}/config/plugin.js to enable egg-logger-sentry plugin:

exports.loggerSentry = {
  enable: true,
  package: 'egg-logger-sentry',
};

Configure information in ${app_root}/config/config.default.js:

exports.loggerSentry = {
  dsn: 'https://<hash>@sentry.example.com/<id>'
};

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

Usage

ctx.logger.debug('debug info');
ctx.logger.info('some request data: %j', ctx.request.body);
ctx.logger.warn('WARNNING!!!!');

Questions & Suggestions

Please open an issue here.

License

MIT