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 .Evt file?

EventLog .Evt file?

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 2 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.
  • R Offline
    R Offline
    RadioButton
    wrote on last edited by
    #1

    Hello, I have created a CustomEventLog. I am using the EventLogInstaller class and using Installutil.exe to install my log. However I notice that the MyCustomLog.Evt file is not being generated? Does anyone know how the .Evt file gets generated? Thanks so much for the help. RB

    E 1 Reply Last reply
    0
    • R RadioButton

      Hello, I have created a CustomEventLog. I am using the EventLogInstaller class and using Installutil.exe to install my log. However I notice that the MyCustomLog.Evt file is not being generated? Does anyone know how the .Evt file gets generated? Thanks so much for the help. RB

      E Offline
      E Offline
      Eric Dahlvang
      wrote on last edited by
      #2

      I don't know about using Installutil.exe to install an event log, but I do know that when you create an Event Source using EventLog.CreateEventSource(), the event log will be created automatically if it doesn't exist already.

      if (!EventLog.SourceExists("SourceName"))
      EventLog.CreateEventSource("SourceName", "LogName");

      will create an event log for you named LogName.evt (it will be in the \System32\config directory) with a Source of SourceName. To write to it:

      EventLog myLog = new EventLog("LogName",".","SourceName");
      myLog.WriteEntry("Loggin my event...");

      Documentation: EventLog.CreateEventSource Method (String, String) [^] This method can also create a new custom log on the local computer.

      --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

      R 1 Reply Last reply
      0
      • E Eric Dahlvang

        I don't know about using Installutil.exe to install an event log, but I do know that when you create an Event Source using EventLog.CreateEventSource(), the event log will be created automatically if it doesn't exist already.

        if (!EventLog.SourceExists("SourceName"))
        EventLog.CreateEventSource("SourceName", "LogName");

        will create an event log for you named LogName.evt (it will be in the \System32\config directory) with a Source of SourceName. To write to it:

        EventLog myLog = new EventLog("LogName",".","SourceName");
        myLog.WriteEntry("Loggin my event...");

        Documentation: EventLog.CreateEventSource Method (String, String) [^] This method can also create a new custom log on the local computer.

        --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

        R Offline
        R Offline
        RadioButton
        wrote on last edited by
        #3

        Thank you.. I have been doing it this way as well. I just did not see my new LogName.evt showing up in my \System32\config directory. However I restarted my system and the file appeared. Go figure. Thank you. RB

        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