0.2.0 • Published 6 years ago

firebase-winston v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

firebase-winston

npm Travis Codecov

A Firebase transport for Winston

Usage

const winston = require('winston');
const admin = require('firebase-admin');
const FirebaseLogger = require('firebase-winston');

const db = admin.database();

winston.add(FirebaseLogger, { ref: db.ref('logs') });

winston.log('info', 'This is a message', { anything: 'This is metadata' })

Firebase Realtime Database

Options

Required is that you set the ref option when adding a transport. Firebase needs a key to store an object. If no key option is set, the current timestamp will be used. If you do set the key option, all your logs that use the FirebaseLogger have to include a key/value in the metadata with that name.

winston.add(FirebaseLogger, {
	ref: db.ref('logging'),
	key: 'my_key'
});

winston.log('error', 'Something went wrong', { anything: 'This is metadata', my_key: 123 })

Firebase Realtime Database

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago