You can enable this feature from the event viewer UI or use command line scripts.
A. From the Event Viewer UI
1. Open the Event Viewer.
To do this, Click on Windows Start Symbol, then right-click on Computer and select “Manage”
Event Viewer is one of the nodes under System Tools under Computer Management.
Note that Event Viewer is a MMC snap-in and you need administrative privileges to access the Event Viewer.
2. In the Event Viewer, go to Application and Services Logs -> Microsoft -> Windows -> CAPI 2 to get the
CAPI 2 channel.
3. Right-click on "Operational" and select “Enable Log”. This will enable CAPI2 Diagnostics logging.
4. To save the log to a file, right click on "Operational" and select the “Save Events as” option.
You can save the log file in the .evtx format (which can be opened through the Event Viewer) or in the standard XML format.
5. If there is data present in the logs before you reproduce the problem, it is recommended that you clear the logs before the repro. This allows only the data
relevant to the problem scenario to be collected from the saved logs.
To clear the logs, right click on "Operational" and select the “Clear Log” option.
6. The default size for the event log is 1 MB. For CAPI2 Diagnostics, the logs tend to grow in size quickly and it is recommended to increase the log size to at
least 4 MB to capture relevant events. To increase the log size, Right-click on “Operational” and select the “Properties” option. In the log properties, increase the maximum log size.
B. Command line scripts
You can also enable logging and save the logs using the wevtutil.exe tool.
Launch a command line with administrative privileges. Run the following commands
1. To enable logging,
wevtutil.exe sl Microsoft-Windows-CAPI2/Operational /e:true
2. To save the log to a file,
wevtutil.exe epl Microsoft-Windows-CAPI2/Operational filename.evtx
3. To disable logging,Launch a command line with administrative privileges. Run the following commands
wevtutil.exe sl Microsoft-Windows-CAPI2/Operational /e:false
4. To clear logs,
wevtutil.exe cl Microsoft-Windows-CAPI2/Operational
5. To increase the log size
wevtutil sl Microsoft-Windows-CAPI2/Operational /ms:<log-size-in-bytes>