Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. EventLog

EventLog

Scheduled Pinned Locked Moved C#
questiondiscussion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Guinness4Strength
    wrote on last edited by
    #1

    I'm having a hell of a time using the EventLog class within a windows Service. The service runs fine...no errors but does not write to my custom event log. The service is running with LocalSystem Account privilages and I'm logged on as an admin. Here is the code I am using:

    public const string EventLogSource="BLOBUpdateService";
    public const string EventLogName="BLOBUpdateEventLog";
    ..
    ..
    ..
    ..

    //init Event Log
    m_Log = new EventLog();
    if(!EventLog.SourceExists(EventLogSource))
    EventLog.CreateEventSource(EventLogSource,EventLogName);
    m_Log.Source=EventLogSource;
    m_Log.WriteEntry("Service Started...",EventLogEntryType.Information);

    Nothing is getting written to the log. Any thoughts ?

    G 1 Reply Last reply
    0
    • G Guinness4Strength

      I'm having a hell of a time using the EventLog class within a windows Service. The service runs fine...no errors but does not write to my custom event log. The service is running with LocalSystem Account privilages and I'm logged on as an admin. Here is the code I am using:

      public const string EventLogSource="BLOBUpdateService";
      public const string EventLogName="BLOBUpdateEventLog";
      ..
      ..
      ..
      ..

      //init Event Log
      m_Log = new EventLog();
      if(!EventLog.SourceExists(EventLogSource))
      EventLog.CreateEventSource(EventLogSource,EventLogName);
      m_Log.Source=EventLogSource;
      m_Log.WriteEntry("Service Started...",EventLogEntryType.Information);

      Nothing is getting written to the log. Any thoughts ?

      G Offline
      G Offline
      Guinness4Strength
      wrote on last edited by
      #2

      I solved my problem. I started to use the static EventLog.WriteEvent method rather than using an instance of the class.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups