npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

angular-logz-io

0.0.3 • Public • Published

angular-logz-io

Integrate logzio logging in your Angular app.

Installation

npm i --save logzio-ts angular-logz-io

How to use in app code

In order to use angular-logz-io in your module, add the following definitions:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
import { AngularLogzIoModule, LogzioOptions, AbstractLogger, AngularLogzIoService } from 'angular-logz-io';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AngularLogzIoModule
  ],
  providers: [
    { provide: LogzioOptions, useValue: { token: 'YOUR_LOGZIO_TOKEN' }},
    { provide: AbstractLogger, useClass: AngularLogzIoService},
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

You can then inject the AbstractLogger service to use it in a component:

constructor(private logz: AbstractLogger) {}

Logging is very simple to use:

testService() {
  console.log('Logging to logz.io');
  this.logz.info('got event logzio');
}

install

npm i angular-logz-io

Downloadsweekly downloads

21

version

0.0.3

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability