'Windows credential provider logging

I am simply looking to add logging output to a file in a Windows credential provider v2, I am not sure on the best way to achieve it.

I am also looking to run a loop within Credential provider to check if a file exists but unsure where to start the function from?



Solution 1:[1]

To monitor for some system Hardware have a look at SampleHardwareEventCredentialProvider.

To log something you can always use system event log in two simple calls.

Solution 2:[2]

If you develop it using Visual Studio, you can use Nuget library called Plog

You can install it by right clicking the project name --> Manage NuGet packages ... --> then search Plog

I started to use this library last year, and it works like charm. https://github.com/SergiusTheBest/plog

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexander
Solution 2 MH Rahman