This has been asked before. The following link is to that discussion.
Writing to an event log in ASP.NET on Windows Server 2008 IIS7
You will need to give the application the privileges to write to the Windows Event Log.
However, it is not recommended because of several reasons.
- Does not scale.
- Introduces an attack vector to the server itself, that can be exploited if your application is not secured properly.
- Application cannot be hosted in a 'shared hosting' host solution and you would have to have access to OS itself to grant these (or a system that allows this like cPanel)
Alternatives to logging into windows event log:
- Log into a Database or to Files
- In a distributed architecture, or enterprise level system, send the event log entries into a queue system that passes the data to an aggregation system.