Go to file
2018-11-05 23:41:43 +01:00
test fix(core): update 2018-11-04 21:21:34 +01:00
ts fix(readme): update 2018-11-05 23:25:53 +01:00
.gitignore initial 2018-11-01 18:13:34 +01:00
.gitlab-ci.yml initial 2018-11-01 18:13:34 +01:00
.snyk fix(core): update 2018-11-04 00:05:36 +01:00
license initial 2018-11-01 18:13:34 +01:00
npmextra.json initial 2018-11-01 18:13:34 +01:00
package-lock.json 1.0.20 2018-11-05 23:29:01 +01:00
package.json 1.0.20 2018-11-05 23:29:01 +01:00
qenv.yml add tests 2018-11-02 19:12:16 +01:00
readme.md fix(core): update 2018-11-05 23:41:43 +01:00
tslint.json initial 2018-11-01 18:13:34 +01:00

@mojoio/logdna

anunoffical package for the logdna api

Availabililty

npm git git docs

Status for master

build status coverage report npm downloads per month Known Vulnerabilities TypeScript node JavaScript Style Guide

Usage

Use TypeScript for best in class instellisense.

This package is an unofficial package for the logdna. It comes with the following festures:

  • aggregates logs that require the same uri query parameters and sends them as bundle. This ensures the correct order of logs
  • resends logs that failed to send.
  • supports smartlog messages and the smartlog ecosystem
import { ILogPackage } from '@pushrocks/smartlog-interfaces'

import { LogdnaAccount, LogdnaMessage } from '@mojoio/logdna';

// lets create a logDnaAccount
const logDnaAccount = new LogdnaAccount(process.env.LOGDNA_APIKEY);

// lets create a smartlog message (smartlog normally takes care of creating those objects)
const smartlogPackage: ILogPackage = {
    timestamp: Date.now(),
    type: 'log',
    level: 'info',
    context: {
      company: 'Lossless GmbH',
      companyunit: 'lossless.cloud',
      containerName: 'ci-mojoio-logdna',
      environment: 'test',
      runtime: 'node',
      zone: 'shipzone'
    },
    message: 'this is an awesome log message sent by the tapbundle test'
  };

const logDnaMessage = LogdnaMessage.fromSmartLogPackage(smartlogPackage);

logDnaAccount.sendLogDnaMessage(logDnaMessage);

// alternatively simply send the smartlogPackage
// creation of the LogdnaMessage is done for you
logDnaAccount.sendSmartlogPackage(smartlogPackage)

// most of the above funtions return promises should you want to wait for a log to be fully sent

For further information read the linked docs at the top of this README.

MIT licensed | © Lossless GmbH | By using this npm module you agree to our privacy policy

repo-footer