Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomyitav/angular-logzio
Log from your angular app to logzio
https://github.com/tomyitav/angular-logzio
angular dependency-injection elk logging logzio
Last synced: about 4 hours ago
JSON representation
Log from your angular app to logzio
- Host: GitHub
- URL: https://github.com/tomyitav/angular-logzio
- Owner: tomyitav
- Created: 2018-06-23T12:03:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T17:48:10.000Z (over 6 years ago)
- Last Synced: 2024-10-11T16:51:21.446Z (26 days ago)
- Topics: angular, dependency-injection, elk, logging, logzio
- Language: TypeScript
- Size: 213 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# angular-logz-io
[![npm](https://img.shields.io/npm/v/angular-logz-io.svg)](https://www.npmjs.com/package/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:
```js
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:
```js
constructor(private logz: AbstractLogger) {}
```Logging is very simple to use:
```js
testService() {
console.log('Logging to logz.io');
this.logz.info('got event logzio');
}
```