Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@bizappframework/ng-logging

bizappframework3MITdeprecated7.1.0TypeScript support: included

This package has been moved to @dagonmetric/ng-log. Please use it instead.

Contains logging abstractions and a few implementations for Angular projects based on Microsoft ASP.Net Logging.

angular, logging, angular-logging, aspnet-core-angular-logging

readme

ng-logging

npm version
Gitter

Contains logging abstractions and a few implementations for Angular projects based on Microsoft ASP.Net Logging.

Installation

npm install @bizappframework/ng-logging

Setup

import { ConsoleLoggerModule, LoggerModule } from '@bizappframework/ng-logging';

@NgModule({
    imports: [
        // Other module imports

        // Logging
        LoggerModule.forRoot({ minLevel: 'trace' }),
        ConsoleLoggerModule
    ]
})
export class AppModule { }

Usage

import { Component, OnInit } from '@angular/core';

import { Logger, LoggerFactory } from '@bizappframework/ng-logging';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {
    private readonly _logger: Logger;

    constructor(loggerFactory: LoggerFactory) {
        this._logger = loggerFactory.createLogger('app');
    }

    ngOnInit(): void {
        this._logger.trace('Testing trace');
        this._logger.debug('Testing debug');
        this._logger.info('Testing info');
        this._logger.warn('Testing warn');
        this._logger.error('Testing error');
    }
}

Example

ng-logging-aspnetcore-sample

License

MIT License