Cannot open log for source *. You may not have write access.

If you have a web part or control that is reporting this error it is because the problem application is trying to write to the event log but doesn’t have the required access. This is because the application and therefore the writeEntry method is executing under the account of the user viewing the page. One way to test this is to sign in as a farm admin account which will have access to the log. This issue can also manifest in an Access Denied error which will prevent the page from displaying at all: System.ComponentModel.Win32Exception: Access is denied.

As far as I know there is only one solution to this problem and unfortunately it is a registry change. Before making a registry change remember to take a backup. You can decide to make the change at your own risk.

  1. Click Start -> Run and type: regedit
  2. Click Ok
  3. Locate: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ Eventlog\Application
  4. Modify CustomSD to give all users read/write access to the Application event log by appending the string (A;;0x3;;;AU) to the  CustomSD entry.

For example

O:BAG:SYD:(D;;0xf0007;;;AN)(D;;0xf0007;;;BG)(A;;0xf0007;;;SY)(A;;0x7;;;BA) (A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)(A;;0x3;;;AU)

And that should do it! Good luck solving the real error your web part is throwing and attempting to log ;)


5 thoughts on “Cannot open log for source *. You may not have write access.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s