log4js-node-yandex-cloud-logging
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Yandex Cloud Logging Appender for Log4JS

Sends logging events to Yandex Cloud Logging. This appender uses @yandex-cloud/nodejs-sdk. If you want more information on the configuration options below.

Installation

npm install log4js-node-yandex-cloud-logging

(This is a plug-in appender for log4js, so you'll need that as well)

Configuration

  • type - log4js-node-yandex-cloud-logging
  • serviceAccountID - string - id of your service account
  • keyID - string - id of your auth key
  • keyData - string - content of your private key
  • destination - string - destination group id
  • timeout - number (optional) - queue flush timeout in millisecond
  • resourceId - string (optional) - resource id
  • setCategoryAsResourceType - boolean (optional) - sets resource type from category name, if false, resourceId required

Example

log4js.configure({
  appenders: {
    yandexCloudLogging: {
      type: 'log4js-node-yandex-cloud-logging',
        serviceAccountID: "someServiceAccoutID",
        keyID: "someKeyID",
        keyData: String(fs.readFileSync("privateKey.pem")),
        destination: "someDestination"
    }
  },
  categories: {
    default: { appenders: ['yandexCloudLogging'], level: 'info' }
  }
});

const logger = log4js.getLogger();
logger.info('Some message');

Dependents (0)

Package Sidebar

Install

npm i log4js-node-yandex-cloud-logging

Weekly Downloads

3

Version

1.0.4

License

MIT

Unpacked Size

8.62 kB

Total Files

4

Last publish

Collaborators

  • redguys