Web App Accesing eventlogs

Discussion in 'ASP .Net Security' started by Rabia [Xavor], Aug 4, 2004.

  1. 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
    Rabia [Xavor], Aug 4, 2004
    #1
    1. Advertising

  2. Rabia [Xavor]

    MattC Guest

    Have you checked that the user your Webapplication is running as has
    priviledges to write to the event log.
    "Rabia [Xavor]" <> wrote in message
    news:...
    > 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
    > 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/ht
    ml/THCMCh09.asp
    >
    > any suggestions wld be great help
    >
    MattC, Aug 9, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Valentin Tihomirov

    Structural VHDL - Accesing signals of instances

    Valentin Tihomirov, Nov 1, 2003, in forum: VHDL
    Replies:
    2
    Views:
    530
    Paul Uiterlinden
    Nov 2, 2003
  2. Gönen EREN

    Accesing Items in datalist edittemplate

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    626
    Gönen EREN
    Aug 22, 2003
  3. Ken Varn

    Can't get EventLogs of type Security.

    Ken Varn, Oct 11, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,896
    Ken Varn
    Oct 12, 2005
  4. JJ

    Eventlogs

    JJ, Dec 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    432
  5. Sergio Lera via .NET 247
    Replies:
    1
    Views:
    223
    Joe Kaplan \(MVP - ADSI\)
    Apr 6, 2005
Loading...

Share This Page