Network Error Logging

Most web applications nowadays have some sort of logging to help troubleshooting bugs and get a better understanding of the system. Logs can be captured on the client via JavaScript or server with whatever language is being used.

A common restriction of such logs is that it cannot tell us whether users are having trouble connecting to our applications.

That’s where Network Error Logging (NEL) comes in. It gives us the ability to generate logs for errors that happen on a network level as well, such as DNS and TCP failures.

NEL Screenshot
An example of a Network Error Logging report collected by RepointHub.

These reports can be extremely useful to get an understanding of what’s happening on our application’s network.

Does your website have Network Error Logging enabled? Check it now.

Practical Example

To enable NEL reports, all we have to do is add two new HTTP response header.

Report-To: {"group":"default","endpoints":[{"url":"https://yoursite.ingest.repointhub.com/report"}],"max_age":86400,"include_subdomains":true}
Reporting-Endpoints: default="https://yoursite.ingest.repointhub.com/report"
NEL: {"report_to":"default","max_age":86400,"include_subdomains":true,"failure_fraction":1.0}

The setup above will tell browsers to send Network Errors reports to RepointHub, so you can take proactive actions to reduce the impact of network problems.

We can be your report collector so you don't need to build your own. Sign up for a free trial of RepointHub to get started.Try it free now!