Open the application named Windows Firewall with Advanced Security
Access the properties of the Windows firewall.
On the top of the firewall properties screen, we have 3 firewall profiles.
• Domain profile
• Private profile
• Public profile
Select the desired firewall profile tab.
Locate the Logging area and click on the Customize button.
On the Logging settings screen, you need to select the desired configuration.
To log packets dropped by the firewall, select the option YES on the first box.
To log successful connections, select the option YES on the second box.
Optionally, you may also specify the Log file location.
The default Log file location is listed below.
As an example, here is the file content.
Congratulations! You have configured the Windows firewall to log blocked connections.