This package has been deprecated

Author message:

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

@bizappframework/ng-logging
TypeScript icon, indicating that this package has built-in type declarations

7.1.0 • Public • Published

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

Package Sidebar

Install

npm i @bizappframework/ng-logging

Weekly Downloads

2

Version

7.1.0

License

MIT

Unpacked Size

249 kB

Total Files

93

Last publish

Collaborators

  • baf-contrib1
  • mmzliveid