I am getting the following exception. I have given full control to Asp.net account on Eventlogs in Registry edit.
[SecurityException: The source was not
If you just want to sniff if a Source exists on the local machine but don't have ability to get authorization to do this, you can finger it through the following example (VB).
This bypasses the security error. You could similarly modify this function to return the LogName for the Source.
Public Shared Function eventLogSourceExists(sSource as String) as Boolean
Try
EventLog.LogNameFromSourceName(sSource, ".")
Return True
Catch
Return False
End Try
End Function