1.0.4 • Published 3 years ago

jotive-firebase-logger-module v1.0.4

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
3 years ago

Jotive Nestjs Firebase Logger Module

Nesjs module for logging to Firebase / Google Cloud stackdriver.

Usage

Needs the following environment variables:

  • process.env.GOOGLE_APPLICATION_CREDENTIALS

1. Initialize firebase admin:

import * as admin from 'firebase-admin';

admin.initializeApp({
  credential: admin.credential.applicationDefault(),
});

2. Initialize in app.module.ts for error logging:

import { LoggerModule } from '@jotive/jotive-firebase-logger-module';
//...
@Module({
  imports: [
    LoggerModule,
    //...
],
  //...
})

3. For custom messages use LoggerService

import in the module:

import { LoggerModule } from '@jotive/jotive-firebase-logger-module';
@Module({
imports: [LoggerModule],
// ...
})

and use the LoggerService for logging

import { LoggerService } from '@jotive/jotive-firebase-logger-module';
constructor(
        private readonly logger: LoggerService,
    ) {
        // verify connection configuration
        this.transporter.verify((error, success) => {
            this.logger.errorObj(error);
        });
    }
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago