469,275 Members | 1,543 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Error writing to the Applicaton Log on a Windows 2003 server

I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6
The error message is "InvalidOperationException: Cannot open log for source {0}."

I have created a Key called "TEST" under the Application in the Registry based on the
microsoft article 329291 and using Solution 1 in that article

In the code I basically do the following

Dim MyLog as new EventLog(
MyLog.Source = "TEST

Then when an error occurs I do thi

MyLog.WriteEntry(MyLog.Source, "ErrorMessage", EventLogEntryType.Error

But I still get the error "InvalidOperationException: Cannot open log for source {0}.
Before I added the Key to the Registry I was getting Registry Access Denied error

Any suggestions????

Nov 22 '05 #1
2 2140
2003 is pretty much locked down by default. This is possibly being caused by
the security policy settings. Can you do the same thing on a W2K server?
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Paul P" <an*******@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6. The error message is "InvalidOperationException: Cannot open log for source {0}."
I have created a Key called "TEST" under the Application in the Registry based on the microsoft article 329291 and using Solution 1 in that article.

In the code I basically do the following:

Dim MyLog as new EventLog()
MyLog.Source = "TEST"

Then when an error occurs I do this

MyLog.WriteEntry(MyLog.Source, "ErrorMessage", EventLogEntryType.Error)

But I still get the error "InvalidOperationException: Cannot open log for source {0}." Before I added the Key to the Registry I was getting Registry Access Denied error.
Any suggestions?????

Nov 22 '05 #2
So it's probably security. You'll need to relax the server's policy to let
you do that.

You'll get a more specific response if you post to one of the Windows
security or admin groups.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Paul P" <an*******@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
No on Win2K which is running IIS 5 it works just fine. No problems writing to the log.
----- Klaus H. Probst wrote: -----

2003 is pretty much locked down by default. This is possibly being caused by the security policy settings. Can you do the same thing on a W2K server?

--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Paul P" <an*******@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
> I am having a problem writing errors to the application log on a Windows
2003 server running IIS 6.
> The error message is "InvalidOperationException: Cannot open log
for source {0}." >> I have created a Key called "TEST" under the Application in the Registry
based on the
> microsoft article 329291 and using Solution 1 in that article.
>> In the code I basically do the following:
>> Dim MyLog as new EventLog() > MyLog.Source = "TEST"
>> Then when an error occurs I do this
>> MyLog.WriteEntry(MyLog.Source, "ErrorMessage",
EventLogEntryType.Error) >> But I still get the error "InvalidOperationException: Cannot open

log for source {0}."
> Before I added the Key to the Registry I was getting Registry
Access Denied error. >> Any suggestions?????

>

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Brian Burgess | last post: by
5 posts views Thread by Tony Wright | last post: by
6 posts views Thread by Peter Frost | last post: by
1 post views Thread by Keith | last post: by
4 posts views Thread by Matthew Louden | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.