HACKER Q&A
📣 gitgud

How do you manage logging in a large application?


We have a large angular web application that has grown into a big mess of console.log() output and it's now unmanageable.

What are some good strategies to do this? Ideally we want to be able to turn logging for components on/off at run-time (during development).


  👤 tcbasche Accepted Answer ✓
Not too sure about Angular / JS, but instead of console.log() I'd use something that you can determine a log level for i.e. console.error / console.info / console.debug.

Then you can determine what to ship out to a logging tool like logstash/logdna based on the environment.

Edit: Something like this https://www.scalyr.com/blog/getting-started-angular-logging/


👤 znq
We're working on a Web SDK for Bugfender, but unfortunately it'll still take a couple of months to finish and test properly, before we can release it.

On our platforms page we have a subscription to get notified once a new platform is supported: https://bugfender.com/platforms/


👤 GFischer
I'm using Application Insights, but our tool is very Microsoft-centric.

Standard recommendation like mister_hn said is Elastic stack, Logstash and Kibana or Grafana.

In a course, I also saw recommended Zipkin and Jaeger.


👤 mister_hn
Rely on logstash/Elastic stack, especially if logs are massive