Reading Custom Log

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lee

    #1

    Reading Custom Log

    I have created a custom log for my apps to write to. Writing to the log seems
    to be no problem, it's when I go to read it I get unexpected results. I have
    an application that reads the log and displays it's contents in a grid, and
    it also receives event notification from the log when it's updated. When the
    event fires I get exactly the text that was logged in exactly the way I
    logged, but when I read the entries from the log, or view them from Event
    Viewer, I get extra text that's similar to "The description for Event ID ( 0
    ) in Source ( ReconRptBuild ) cannot be found. The local computer may not
    have the necessary registry information or message DLL files to display
    messages from a remote computer. You may be able to use the /AUXSOURCE= flag
    to retrieve this description; see Help and Support for details. The following
    information is part of the event" .... after this I get my actual event text.

    How can I write events to the log that will not generate this extra text?
  • Dave

    #2
    RE: Reading Custom Log

    I assume that you are using the .NET EventLog class and Windows 2000 or above.

    When you create a custom event log and event source, it is done by adding a
    registry entry (.NET will do this for you the first time you write an event
    to the log).

    The registry key that is created is as follows:
    HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\<event log
    name>\<event source name>

    Under this key, a value is also created (details follow):
    EventMessageFil e="C:\WINDOWS\M icrosoft.NET\Fr amework\<clr
    version>\EventL ogMessages.dll"

    It is this EventLogMessage s.dll file that allows Event Viewer to display the
    messages in the form that you are expecting, so I would begin by checking for
    the presence of the registry entry and file.

    Hope this helps.

    "Lee" wrote:
    [color=blue]
    > I have created a custom log for my apps to write to. Writing to the log seems
    > to be no problem, it's when I go to read it I get unexpected results. I have
    > an application that reads the log and displays it's contents in a grid, and
    > it also receives event notification from the log when it's updated. When the
    > event fires I get exactly the text that was logged in exactly the way I
    > logged, but when I read the entries from the log, or view them from Event
    > Viewer, I get extra text that's similar to "The description for Event ID ( 0
    > ) in Source ( ReconRptBuild ) cannot be found. The local computer may not
    > have the necessary registry information or message DLL files to display
    > messages from a remote computer. You may be able to use the /AUXSOURCE= flag
    > to retrieve this description; see Help and Support for details. The following
    > information is part of the event" .... after this I get my actual event text.
    >
    > How can I write events to the log that will not generate this extra text?[/color]

    Comment

    • Lee

      #3
      RE: Reading Custom Log

      The setting is as follows, and I have verified the existance of the dll.

      C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Ev entLogMessages. dll

      Comment

      • Dave

        #4
        RE: Reading Custom Log

        So are you saying that, when your application receives notification via the
        EntryWritten event, the Message property is correct but, if your application
        then were to read the same entry, the Message would come back with the
        incorrectly formatted string?

        If so, that seems very strange. Presumably none of your messages appear
        correctly in Event Viewer? Is this all occurring while you are logged on as
        the same user?


        "Lee" wrote:
        [color=blue]
        > The setting is as follows, and I have verified the existance of the dll.
        >
        > C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Ev entLogMessages. dll[/color]

        Comment

        • Lee

          #5
          RE: Reading Custom Log

          refer to new posting with today's date.

          The message does not appear correctly in the event view
          the Message does not appear correctly in my custom viewer, but it's
          different thn event viewer
          The message is Correct only when received "EntryWritt en" Event

          This occurs on 2 machines, 1 with XP SP2 (developement), and the other with
          Win2k SP4.

          Comment

          Working...