{"id":13808689,"url":"https://github.com/dbfannin/ngx-logger","last_synced_at":"2026-02-13T02:31:05.065Z","repository":{"id":20562961,"uuid":"90264252","full_name":"dbfannin/ngx-logger","owner":"dbfannin","description":"Angular logger","archived":false,"fork":false,"pushed_at":"2024-06-21T12:15:29.000Z","size":1383,"stargazers_count":428,"open_issues_count":21,"forks_count":111,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-09-07T23:57:16.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbfannin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-04T13:06:52.000Z","updated_at":"2024-09-06T15:21:33.000Z","dependencies_parsed_at":"2024-06-18T12:31:18.693Z","dependency_job_id":"fa12d827-2df2-4eb9-b43d-3c0d130f0d78","html_url":"https://github.com/dbfannin/ngx-logger","commit_stats":{"total_commits":295,"total_committers":40,"mean_commits":7.375,"dds":0.5830508474576271,"last_synced_commit":"f6f3e05f26d8f275b3c0c5411ce373b52f20e798"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfannin%2Fngx-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfannin%2Fngx-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfannin%2Fngx-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbfannin%2Fngx-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbfannin","download_url":"https://codeload.github.com/dbfannin/ngx-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225273259,"owners_count":17448074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:01:49.364Z","updated_at":"2026-02-13T02:31:00.046Z","avatar_url":"https://github.com/dbfannin.png","language":"TypeScript","funding_links":[],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"readme":"[![npm version](https://badge.fury.io/js/ngx-logger.svg)](https://www.npmjs.com/package/ngx-logger)\n\n# NGX Logger\n\nNGX 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*).\nIt allows \"pretty print\" to the console, as well as allowing log messages to be POSTed to a URL for server-side logging.\n\n## Join the NGX Logger discord server!\n\n[Join our discord server!](https://discord.gg/zzkz9ny) Get updated on the latest changes and newest feature! Get help faster from the community! Share implementation strategies! Make friends :)\n\n## Installation\n\n```shell\nnpm install --save ngx-logger\n```\n\nOnce installed you need to import our main module (optionally you will need to import HttpClientModule):\n\n```typescript\nimport { LoggerModule, NgxLoggerLevel } from \"ngx-logger\";\n// HttpClientModule is only needed if you want to log on server or if you want to inspect sourcemaps\nimport { HttpClientModule } from \"@angular/common/http\";\n```\n\nThe only remaining part is to list the imported module in your application module, passing in a config to initialize the logger.\n\n```typescript\n@NgModule({\n  declarations: [AppComponent, ...],\n  imports:\n  [\n    // HttpClientModule is only needed if you want to log on server or if you want to inspect sourcemaps\n    HttpClientModule,\n    LoggerModule.forRoot({\n      serverLoggingUrl: '/api/logs',\n      level: NgxLoggerLevel.DEBUG,\n      serverLogLevel: NgxLoggerLevel.ERROR\n    }),\n    ...\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n```\n\n## Usage\n\nTo use the Logger, you will need to import it locally, then call one of the logging functions\n\n```typescript\nimport { Component } from \"@angular/core\";\nimport { NGXLogger } from \"ngx-logger\";\n\n@Component({\n  selector: \"your-component\",\n  templateUrl: \"./your.component.html\",\n  styleUrls: [\"your.component.scss\"],\n})\nexport class YourComponent {\n  constructor(private logger: NGXLogger) {\n    this.logger.error(\"Your log message goes here\");\n    this.logger.warn(\"Multiple\", \"Argument\", \"support\");\n  }\n}\n```\n*For most browsers, you need to enable \"verbose\" or \"debug\" mode in the developper tools to see debug logs*\n\n## Configuration\n\nConfiguration is sent by the forRoot call\n`LoggerModule.forRoot({level: NgxLoggerLevel.DEBUG})`\n\nFor more information about configuration see the [doc](docs/config.md)\n\n## Customise logger behavior\n\nSince version 5 NGXLogger is fully customisable\n\nSee how in the [doc](docs/customising.md)\n\n## Features\n\nYou can see more of the features supported by NGXLogger in this [doc](docs/features.md)\n\n## Demo App\n\nThere is [a demo application](https://github.com/dbfannin/ngx-logger/tree/master/projects/demo/src) with examples of how to use ngx-logger. To run it perform the following:\n\n- Clone the repo\n- Run `npm ci` or `npm install`\n- Build ngx-logger using `ng build`\n- Run `ng serve demo` to serve the app\n\nA convenience script has been added to `package.json` that performs the above steps. Simply run `npm run demo`\nto have the demo built and served.\n\n## Dependencies\n\n- @angular/common\n- @angular/core\n\n## Testing Your App When Using NGXLogger\n\nIf you inject any of the NGX Logger services into your application, you will need to provide them in your Testing Module.\n\nTo provide them in your Testing Module:\n\n```typescript\nimport { LoggerTestingModule } from 'ngx-logger/testing';\n\nTestBed.configureTestingModule({\n  imports: [\n    LoggerTestingModule\n  ],\n  ...\n});\n```\n\nAll services have mocked classes that can be used for testing located [here](testing/src/lib)\n\n## Contribute\n\nAll are welcome to contribute to NGX Logger.\n\nSee the [doc](docs/contributing.md) to know how\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbfannin%2Fngx-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbfannin%2Fngx-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbfannin%2Fngx-logger/lists"}