
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
ngx-logger
Advanced tools
[](https://www.npmjs.com/package/ngx-logger)
NGX Logger is a simple logging module for angular (currently supports angular 6+. Warning : you might need older version of the lib to use older versions of angular). It allows "pretty print" to the console, as well as allowing log messages to be POSTed to a URL for server-side logging.
Join our discord server! Get updated on the latest changes and newest feature! Get help faster from the community! Share implementation strategies! Make friends :)
npm install --save ngx-logger
Once installed you need to import our main module (optionally you will need to import HttpClientModule):
import { LoggerModule, NgxLoggerLevel } from "ngx-logger";
// HttpClientModule is only needed if you want to log on server or if you want to inspect sourcemaps
import { HttpClientModule } from "@angular/common/http";
The only remaining part is to list the imported module in your application module, passing in a config to initialize the logger.
@NgModule({
declarations: [AppComponent, ...],
imports:
[
// HttpClientModule is only needed if you want to log on server or if you want to inspect sourcemaps
HttpClientModule,
LoggerModule.forRoot({
serverLoggingUrl: '/api/logs',
level: NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.ERROR
}),
...
],
bootstrap: [AppComponent]
})
export class AppModule {
}
To use the Logger, you will need to import it locally, then call one of the logging functions
import { Component } from "@angular/core";
import { NGXLogger } from "ngx-logger";
@Component({
selector: "your-component",
templateUrl: "./your.component.html",
styleUrls: ["your.component.scss"],
})
export class YourComponent {
constructor(private logger: NGXLogger) {
this.logger.error("Your log message goes here");
this.logger.warn("Multiple", "Argument", "support");
}
}
For most browsers, you need to enable "verbose" or "debug" mode in the developper tools to see debug logs
Configuration is sent by the forRoot call
LoggerModule.forRoot({level: NgxLoggerLevel.DEBUG})
For more information about configuration see the doc
Since version 5 NGXLogger is fully customisable
See how in the doc
You can see more of the features supported by NGXLogger in this doc
There is a demo application with examples of how to use ngx-logger. To run it perform the following:
npm ci or npm installng buildng serve demo to serve the appA convenience script has been added to package.json that performs the above steps. Simply run npm run demo
to have the demo built and served.
If you inject any of the NGX Logger services into your application, you will need to provide them in your Testing Module.
To provide them in your Testing Module:
import { LoggerTestingModule } from 'ngx-logger/testing';
TestBed.configureTestingModule({
imports: [
LoggerTestingModule
],
...
});
All services have mocked classes that can be used for testing located here
All are welcome to contribute to NGX Logger.
See the doc to know how
FAQs
[](https://www.npmjs.com/package/ngx-logger)
The npm package ngx-logger receives a total of 72,800 weekly downloads. As such, ngx-logger popularity was classified as popular.
We found that ngx-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.