Web App Accesing eventlogs

R

Rabia [Xavor]

Hi All
I'm badly stick with this issue. My Web App needs to right into the system event log.
But when ever this attempted the following error shows up
++++++++++++++++++stack trace+++++++++++++++++
Win32Exception (0x80004005): Access is denied]

[InvalidOperationException: Cannot open log for source {0}. You may not have write access.]
System.Diagnostics.EventLog.OpenForWrite() +367
System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16 category, EventLogEntryType type, String[] strings, Byte[] rawData) +280
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +462
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID) +15
Xavor.Logger.writeEntry(String source, String className, String[] message, EventLogEntryType entryType, overloadTypeEnum overloadType)
Xavor.Logger.LogException(Exception ex)
Virgin.LPS.Administration.Security.GetUserInfo(String AdminGroup, String UserGroup) in F:\BiztalkRTM\Development\Reporting\Virgin.LPS.Administration\Security.cs:96
Virgin.LPS.Administration.LP_Manager.Page_Load(Object sender, EventArgs e) in F:\BiztalkRTM\Development\Reporting\Virgin.LPS.Administration\LP_Manager.aspx.cs:65
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
+++++++++++++++++++++++++++++++++++++++++++++
I have tried sandboxing the code but this web app still fails. The refrence for
sandboxing the code was taken from the following resource
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh09.asp

any suggestions wld be great help
 
M

MattC

Have you checked that the user your Webapplication is running as has
priviledges to write to the event log.
Rabia said:
Hi All
I'm badly stick with this issue. My Web App needs to right into the system event log.
But when ever this attempted the following error shows up
++++++++++++++++++stack trace+++++++++++++++++
Win32Exception (0x80004005): Access is denied]

[InvalidOperationException: Cannot open log for source {0}. You may not have write access.]
System.Diagnostics.EventLog.OpenForWrite() +367
System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16 category,
EventLogEntryType type, String[] strings, Byte[] rawData) +280
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +462
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID) +15
Xavor.Logger.writeEntry(String source, String className, String[]
message, EventLogEntryType entryType, overloadTypeEnum overloadType)
Xavor.Logger.LogException(Exception ex)
Virgin.LPS.Administration.Security.GetUserInfo(String AdminGroup,
String UserGroup) in
F:\BiztalkRTM\Development\Reporting\Virgin.LPS.Administration\Security.cs:96
Virgin.LPS.Administration.LP_Manager.Page_Load(Object sender, EventArgs
e) in
F:\BiztalkRTM\Development\Reporting\Virgin.LPS.Administration\LP_Manager.asp
x.cs:65
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top