DEV Community

Discussion on: Is there a topic you wish there was an article about?

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

As in where to put in log statements in the code or where to store the results or which application to store and visualize logs?

Usually you have Express, Flask, etc. logging requests which get logged to an app log on a standard out or a custom directory you set.

e.g. /var/log/my_app/access.log

You might have an error log and an access log as separate files.

And then if you have Nginx or Apache on top, then you write those to the preferred location. Roughly /var/log/apache2/access.log

And then use a system like AWS CloudWatch or Grafana or Datadog to make your logs visible in a dashboard.

Collapse
 
deexter profile image
deexter

How about SPA application only?
What is your favourite system where to filter/visualize logs?

Thread Thread
 
michaelcurrin profile image
Michael Currin

Oh right forgot about that side. So if there a SPA setup and have a folder of assets served, your console logs would disappear.

We use Datadog and previously New Relic. They let you add a JS snippet on your frontend to send your error messages and RUM (real user monitoring) to find out which pages and devices have slowest performance or most errors. And then you consume logs as dashboards in those systems.

Netlify has added an analytics plugin to their paid tier which does analysis on the server side even if JS is not loaded on the frontend. Don't know how it handles SPA but might be nice for static site. As it doesnt add Google Analytics overhead to your frontend.