2

I my Angular application, I use NGXLogger, but the loggername is always the same

[app-app-module.js:2740]

regardless of where the logging takes place.

If would expect the logger name to reflect the module name that has the log.debug('x')

import { NGXLogger } from 'ngx-logger';

constructor (private logger: NGXLogger) 
  {
    _log = logger; 
  }
Ivan Sager
  • 175
  • 1
  • 2
  • 12
  • Can you show us which line is `[app-app-module.js:2740]`? – Cullub Aug 09 '19 at 18:52
  • export class SidebarComponent extends SagerSystems.ComponentBase implements OnInit ... Then I log the data. **_log.debug(this.menuItems);** I would assume the log would be [SidebarComponen .ts:2740] – Ivan Sager Aug 10 '19 at 18:40

1 Answers1

1

In order to see a "clear" component name you need to set enableSourceMaps to true in logger config

Be careful, for this to work you need to generate source maps when building

More info in the doc : https://github.com/dbfannin/ngx-logger/blob/master/docs/features.md

bmtheo
  • 974
  • 1
  • 7
  • 16