{"id":13660745,"url":"https://github.com/DagonMetric/ng-log","last_synced_at":"2025-04-24T23:30:40.621Z","repository":{"id":38240384,"uuid":"179057921","full_name":"DagonMetric/ng-log","owner":"DagonMetric","description":"Vendor-agnostic logging, analytics and telemetry service abstractions and some implementations for Angular applications.","archived":false,"fork":false,"pushed_at":"2024-08-14T20:34:20.000Z","size":4117,"stargazers_count":15,"open_issues_count":23,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T03:01:55.625Z","etag":null,"topics":["analytics","angular","angular-analytics","angular-log","angular-logging","angular-logging-service","angular-telemetry-client","log","logging","telemetry","telemetry-client","typescript"],"latest_commit_sha":null,"homepage":"","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/DagonMetric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"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":"2019-04-02T10:54:04.000Z","updated_at":"2023-05-12T16:54:26.000Z","dependencies_parsed_at":"2023-09-29T20:18:32.124Z","dependency_job_id":"99264b60-1217-4588-86f9-35b39fe40763","html_url":"https://github.com/DagonMetric/ng-log","commit_stats":{"total_commits":1056,"total_committers":3,"mean_commits":352.0,"dds":"0.22916666666666663","last_synced_commit":"a447cabf0b9805eef90adc4613b1b931f45a2a19"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DagonMetric%2Fng-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DagonMetric%2Fng-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DagonMetric%2Fng-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DagonMetric%2Fng-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DagonMetric","download_url":"https://codeload.github.com/DagonMetric/ng-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250727441,"owners_count":21477316,"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":["analytics","angular","angular-analytics","angular-log","angular-logging","angular-logging-service","angular-telemetry-client","log","logging","telemetry","telemetry-client","typescript"],"created_at":"2024-08-02T05:01:25.287Z","updated_at":"2025-04-24T23:30:40.198Z","avatar_url":"https://github.com/DagonMetric.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Angular Logging, Analytics and Telemetry Service\n\n[![GitHub Actions Status](https://github.com/DagonMetric/ng-log/workflows/Main%20Workflow/badge.svg)](https://github.com/DagonMetric/ng-log/actions)\n[![Azure Pipelines Status](https://dev.azure.com/DagonMetric/ng-log/_apis/build/status/DagonMetric.ng-log?branchName=master)](https://dev.azure.com/DagonMetric/ng-log/_build?definitionId=10)\n[![codecov](https://codecov.io/gh/DagonMetric/ng-log/branch/master/graph/badge.svg)](https://codecov.io/gh/DagonMetric/ng-log)\n[![npm version](https://badge.fury.io/js/%40dagonmetric%2Fng-log.svg)](https://www.npmjs.com/package/@dagonmetric/ng-log)\n[![Gitter](https://badges.gitter.im/DagonMetric/general.svg)](https://gitter.im/DagonMetric/general?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nVendor-agnostic logging, analytics and telemetry service abstractions and some implementations for Angular applications.\n\n## Features\n\n* Log service provides both application scoped root logger and category scoped child loggers with `createLogger(categoryName)` method.\n* Category scoped child loggers can be destroyed with `destroyLogger(categoryName)` method\n* Supports both standard logging api (`trace`, `debug`, `info`, `warn`, `error`, `fatal`) and telemetry tracking api (`trackPageView`, `trackEvent`, etc.)\n* Support measuring user timings for events and page views with `startTrackEvent`, `stopTrackEvent`, `startTrackPage` and `stopTrackPage`\n* Extendable and plugable logging providers (see built-in [ConsoleLoggerProvider](https://github.com/DagonMetric/ng-log/blob/master/modules/ng-log/console/src/console-logger-provider.ts) for implementation demo)\n* Flexable logging configuration\n* Latest version of Angular and compatible with server side rendering (SSR / Angular Universal)\n\n## Getting Started\n\n### Installation\n\nnpm\n\n```bash\nnpm install @dagonmetric/ng-log\n```\n\nor yarn\n\n```bash\nyarn add @dagonmetric/ng-log\n```\n\n### Module Setup (app.module.ts)\n\nThe following code is a simple module setup with `ConsoleLoggerModule`.\n\n```typescript\nimport { LogModule } from '@dagonmetric/ng-log';\nimport { ConsoleLoggerModule } from '@dagonmetric/ng-log/console';\n\n@NgModule({\n  imports: [\n    // Other module imports\n\n    // ng-log modules\n    LogModule.withConfig({ minLevel: 'debug' }),\n    ConsoleLoggerModule\n  ]\n})\nexport class AppModule { }\n```\n\nSee [log-config.ts](https://github.com/DagonMetric/ng-log/blob/master/modules/ng-log/src/log-config.ts) source file to learn more about options for `LogModule`.\n\nLive edit [app.module.ts in stackblitz](https://stackblitz.com/github/dagonmetric/ng-log/tree/master/samples/demo-app?file=src%2Fapp%2Fapp.module.ts)\n\n### Usage (app.component.ts)\n\n```typescript\nimport { Component, OnInit } from '@angular/core';\n\nimport { LogService } from '@dagonmetric/ng-log';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html'\n})\nexport class AppComponent implements OnInit {\n  constructor(private readonly logService: LogService) { }\n\n  ngOnInit(): void {\n    // Track traces\n    this.logService.trace('Testing trace');\n    this.logService.debug('Testing debug');\n    this.logService.info('Testing info');\n    this.logService.warn('Testing warn');\n\n    // Track exceptions\n    this.logService.error(new Error('Testing error'));\n    this.logService.fatal(new Error('Testing critical'));\n\n    // Track page view\n    this.logService.trackPageView({\n      name: 'My Angular App',\n      uri: '/home'\n    });\n\n    // Track custom event\n    this.logService.trackEvent({\n      name: 'video_auto_play_start',\n      properties: {\n        non_interaction: true\n      }\n    });\n\n    // Create child logger with category name\n    const childLogger = this.logService.createLogger('component1');\n\n    // Log with child logger\n    childLogger.info('Testing info');\n\n    // Destroy child logger\n    this.logService.destroyLogger('component1');\n  }\n}\n```\n\nLive edit [app.component.ts in stackblitz](https://stackblitz.com/github/dagonmetric/ng-log/tree/master/samples/demo-app?file=src%2Fapp%2Fapp.component.ts)\n\n## Samples\n\n* Demo app [view source](https://github.com/DagonMetric/ng-log/tree/master/samples/demo-app) / [live edit in stackblitz](https://stackblitz.com/github/dagonmetric/ng-log/tree/master/samples/demo-app)\n\n## Sub-modules\n\n* [ng-log-console](https://github.com/DagonMetric/ng-log/tree/master/modules/ng-log/console) - Console logging implementation for `ng-log`\n\n## Integrations\n\n* [ng-log-applicationinsights](https://github.com/DagonMetric/ng-log-applicationinsights) - Microsoft Azure Application Insights implementation for `ng-log`\n* [ng-log-gtag](https://github.com/DagonMetric/ng-log-gtag) - Google Analytics Global Site Tag gtag.js implementation for `ng-log`\n* [ng-log-firebase-analytics](https://github.com/DagonMetric/ng-log-firebase-analytics) - Google Firebase Analytics implementation for `ng-log`\n* [ng-log-facebook-analytics](https://github.com/DagonMetric/ng-log-facebook-analytics) - Facebook Pixel Analytics implementation for `ng-log`\n\n## Related Projects\n\n* [ng-config](https://github.com/DagonMetric/ng-config) - Configuration \u0026 options service for Angular applications\n* [ng-cache](https://github.com/DagonMetric/ng-cache) - Caching service for Angular applications\n\n## Build \u0026 Test Tools\n\nWe use [lib-tools](https://github.com/lib-tools/lib-tools) for bundling, testing and packaging our library projects.\n\n[![Lib Tools](https://repository-images.githubusercontent.com/273890506/28038a00-dcea-11ea-8b4a-7d655158ccf2)](https://github.com/lib-tools/lib-tools)\n\n## Feedback and Contributing\n\nCheck out the [Contributing](https://github.com/DagonMetric/ng-log/blob/master/CONTRIBUTING.md) page.\n\n## License\n\nThis repository is licensed with the [MIT](https://github.com/DagonMetric/ng-log/blob/master/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDagonMetric%2Fng-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDagonMetric%2Fng-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDagonMetric%2Fng-log/lists"}