1

I have a project running on the CLI for Angular2. During local development, I'd like to see the http requests the come in. The server is started using ng serve Does anyone know how to turn logging on for this?

AFrieze
  • 844
  • 1
  • 10
  • 26

2 Answers2

1

I got error logs by using this command:

node 2> widgets.container_err.log ./node_modules/@angular/cli/bin/ng serve

The output is not that great, but it does output any errors thrown through node

Johan Aspeling
  • 765
  • 1
  • 13
  • 38
0

There is no out-of-the-box logger for angular 2 cli.

However, there is a compatible library you can install: ng2-logger https://www.npmjs.com/package/ng2-logger

All you need to do is a simple npm install and import it directly into the files you want to use it (no need to register it in the modules).

David Pascoal
  • 1,431
  • 3
  • 21
  • 26
  • 1
    It sounds like @AFrieze is asking how to enable server-side logging, rather than a client-side logging framework like `ng2-logger`... – Jan Nielsen Oct 19 '16 at 20:43