CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    2

    Angry EventLog entry written to wrong log

    I am developing a Windows Service in C#, and wish to have a custom log for it, instead of using the Application Log. I have created a project installer that includes the creation of the Custom log. All of that works just fine, but when my service writes to the custom event log, the messages end up in the Application log.

    This is despite the fact that if I write an entry that shows the result of a call to LogNameFromSource name returns the name of my custom log.

    Also, the log entries are all of the form
    Event Type: Information
    Event Source: WciLogMonitorService
    Event Category: None
    Event ID: 2
    Date: 3/18/2005
    Time: 10:01:35 AM
    User: N/A
    Computer: DAVE-HOOS
    Description:
    The description for Event ID ( 2 ) in Source ( WciLogMonitorService ) 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: Current event log name for source "WciLogMonitorService": "WciLogMonitor".

    I suspect that the cause of the entries going into the wrong log is the same as what causes the events not to be displayed properly.

    I will appreciate any enlightenment on the subject.

  2. #2
    Join Date
    Sep 2004
    Location
    Toronto, Canada
    Posts
    103

    Re: EventLog entry written to wrong log

    what is your code for the creation of / writing to the event log? are you setting the source in the application (not the installer) before writing?
    ten ni hibari ningen umi ni asobu hi zo
    larks in the sky
    people in the sea...
    a holiday

  3. #3
    Join Date
    Mar 2005
    Posts
    2

    Re: EventLog entry written to wrong log

    Yes, the source is being set in the application, and I found out that re-booting the machine solved the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured