Network Error Logging


What is NEL?

NEL defines a new HTTP response header, NEL, that allows you to collect information from the browser when visitors to your site encounter one of a variety of different problems.

You can collect reports that provide information about DNS, TCP, TLS and application issues experienced by the client.


Getting Started

Enabling the Reporting API is easy and requires the delivery of a single HTTP response header.


NEL: {"report_to":"default","max_age":31536000,"include_subdomains":true}


To deploy this header on your website you will need to also setup the Reporting API, as this is how the browser will deliver NEL reports. Please click that link and follow the steps there before continuing.


PHP
header('NEL: {"report_to":"default","max_age":31536000,"include_subdomains":true}')


Nginx
add_header "NEL" "{\"report_to\":\"default\",\"max_age\":31536000,\"include_subdomains\":true}"


Apache
Header set NEL "{\"report_to\":\"default\",\"max_age\":31536000,\"include_subdomains\":true}"


IIS

Open IIS Manager and navigate to the level you want to manage, In Features View, double-click HTTP Response Headers. On the HTTP Response Headers page, in the Actions pane, click Add. In the Add Custom HTTP Response Header dialog box use the following name and value and then click OK.

Name: NEL

Value: {"report_to":"default","max_age":31536000,"include_subdomains":true}


Filtering Reports

You can configure filters for your inbound reports in the Filters section in your account. These filters allow you to reduce the amount of noise and make it easier to find reports that matter.


We recommend keeping the default set of filters enabled to keep your report data manageable.


The 'Sites to collect reports for' field must be filled in and informs us of the domain names you expect to receive reports from. This is a space separated list of domain names.


https://www.w3.org/TR/network-error-logging/

https://github.com/w3c/network-error-logging/issues

https://developers.google.com/web/updates/2018/09/reportingapi#nel