Results 1 to 5 of 5

Thread: Creating a event log

  1. #1
    Join Date
    Nov 2008
    Posts
    23

    Creating a event log

    Hello to all and best wishes

    Everything is in the title, I want to create an event log in my own company and in which I can incorporate my own alerts through eg eventcreate

    Thank you for your help

    regards

  2. #2
    Join Date
    May 2008
    Posts
    115

    Re: Creating a event log

    You can use the EventLog class to create a custom event log on a local or remote computer. You might create a custom log if you wanted to organize your entries in a more granular way than is allowed when your components write entries to the default Application log. For example, suppose you have a component called OrderEntry that writes entry information to an event log. You are interested in backing up and saving these entries for a longer period of time than some other entries in the Application log. Rather than registering your component to write to the Application log, you can create a custom log called OrdersLog and register your component to write entries to that log instead. That way, all of your order information is stored in one place and will not be affected if the entries in the Application log are cleared.

    You can indirectly use the CreateEventSource method to create a custom log. This method creates a new source and lets you specify the log to write to. If you specify that you want to write to a log that does not already exist, the system automatically creates a custom log for you and registers your component as a source for that log.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Creating a event log

    Hello,

    For event everything goes in:
    HKLM \ System \ CurrentControlSet \ Services \ EventLog \

    So we need an entry, for example in vbscript:

    Set WshShell = WScript.CreateObject ( "WScript.Shell")
    WshShell.RegWrite _
    "HKLM \ System \ CurrentControlSet \ Services \ EventLog \" monEvt

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Creating a event log

    To create a custom event log
    Call the CreateEventSource method and specify the source string and the name of the log file you want to create.

    The following example shows how to create a custom log called MyNewLog on the local computer. This code assumes that an Imports or using statement exists for the System.Diagnostics namespace:

    Visual Basic
    EventLog.CreateEventSource("ApplicationName", "LogName")
    C#
    System.Diagnostics.EventLog.CreateEventSource("ApplicationName", "LogName");
    To create a custom event log on a remote computer, specify the computer name as a third parameter. The following code shows an example.

    Visual Basic
    Dim creationData As New EventSourceCreationData("ApplicationName", "LogName")
    creationData.MachineName = "ServerName"
    EventLog.CreateEventSource(creationData)

    C#
    System.Diagnostics.EventSourceCreationData creationData = new
    System.Diagnostics.EventSourceCreationData("ApplicationName", "LogName");
    creationData.MachineName = "ServerName";
    EventLog.CreateEventSource(creationData);

  5. #5
    lucas999 Guest

    Re: Creating a event log

    Just use Win32 Event log apis
    "CreateEventSource () method" doesn't exist.
    It's only for .NET and wraps Win32 api (then for kids only who don't know win32 programming...)

Similar Threads

  1. Creating a Custom Event in Java
    By Jagdish Gada in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 08:16 PM
  2. Replies: 3
    Last Post: 25-02-2009, 03:42 PM
  3. Event ID: 5721 Event Source: NETLOGON member server windows 2003
    By Edwin Delgado in forum Windows Server Help
    Replies: 1
    Last Post: 08-09-2007, 12:41 AM
  4. Replies: 2
    Last Post: 30-03-2007, 11:46 PM
  5. Event Log Error: Event Source:WinMgmt Event ID:10
    By BlackSunReyes in forum Small Business Server
    Replies: 2
    Last Post: 01-03-2007, 03:27 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,053,813.24860 seconds with 17 queries