G
Guest
Writing to a registered source in the Application event log
I have an asp.net framework 2.0 app that I created on a winxp machine and
now I am deploying it to IIS6 on a win server2003 machine. This application
has to write to the application event log.
After deployment of the application I have verified that my source
“MySource†exists in the Application event log. I then wrote some text to
the event source in a forms app and verified that it showed up in the
Application event log.
Since I don’t require my Application to create the event log source I don’t
believe I should have to give Network Service additional rights. I have
spent the day reading posts about writing to the event log to no avail.
Thanks in advance
-Jeff
My application throws this exception when it hits the line requiring it to
write to the event log :
Access to the path 'C:\Documents and Settings\Default User\Application
Data\Microsoft Corporation\Internet Information Services\6.0.3790.1830' is
denied.
//--------- Writing to the event log
My.Log.WriteEntry(“Success I have written to the event logâ€)
// ----------- Excerpt from my webConfig file ----------------
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event
Log -->
<add name="EventLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME (now
'default') with the name of your application to write to the Application
Event Log -->
<add name="EventLog" type="System.Diagnostics.EventLogTraceListener"
initializeData="MySource"/>
</sharedListeners>
</system.diagnostics>
I have an asp.net framework 2.0 app that I created on a winxp machine and
now I am deploying it to IIS6 on a win server2003 machine. This application
has to write to the application event log.
After deployment of the application I have verified that my source
“MySource†exists in the Application event log. I then wrote some text to
the event source in a forms app and verified that it showed up in the
Application event log.
Since I don’t require my Application to create the event log source I don’t
believe I should have to give Network Service additional rights. I have
spent the day reading posts about writing to the event log to no avail.
Thanks in advance
-Jeff
My application throws this exception when it hits the line requiring it to
write to the event log :
Access to the path 'C:\Documents and Settings\Default User\Application
Data\Microsoft Corporation\Internet Information Services\6.0.3790.1830' is
denied.
//--------- Writing to the event log
My.Log.WriteEntry(“Success I have written to the event logâ€)
// ----------- Excerpt from my webConfig file ----------------
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event
Log -->
<add name="EventLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME (now
'default') with the name of your application to write to the Application
Event Log -->
<add name="EventLog" type="System.Diagnostics.EventLogTraceListener"
initializeData="MySource"/>
</sharedListeners>
</system.diagnostics>