RE: NT Services and EventLog problems

Discussion in 'Python' started by Pieter Claerhout, Mar 2, 2004.

  1. Hi Larry,

    try the following:

    win32evtlogutil.AddSourceToRegistry('AFR',
    'C:\Python22\Lib\site-Packages\win32\servicemanager.pyd',
    'Application')

    The PythonService.exe doesn't contain the messages, but servicemanager.pyd
    does.

    cheers,


    pieter

    Creo
    pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
    | www.creo.com

    IMAGINE CREATE BELIEVE(tm)

    -----Original Message-----
    From: python-list-bounces+pieter.claerhout=
    [mailto:python-list-bounces+pieter.claerhout=] On Behalf
    Of Larry Bates
    Sent: 02 March 2004 00:20
    To:
    Subject: NT Services and EventLog problems

    I have tried everything I know to get my NT service
    to make correct entries in the NT Event Log when the
    service is started and stopped (and eventually when
    permanent failures occur).

    I'm copying the code I see on page 356 of Python
    Programming on Win32 and for the life of me I cannot
    get this to work properly. Basically I have
    the following code snippet at the top of my SvcDoRun
    method:

    import servicemanager
    servicemanager.LogMsg(
    servicemanager.EVENTLOG_INFORMATION_TYPE,
    servicemanager.PYS_SERVICE_STARTED,
    (self._svc_name_,''))

    I also inserted the following to make the proper
    registry entries when the service is installed:

    win32evtlogutil.AddSourceToRegistry('AFR',
    'C:\Python22\Lib\site-Packages\win32\PythonService.exe',
    'Application')

    The entry that gets put into the Event Log is as follows:

    The description for Event ID ( 4098 ) in Source
    ( PythonService ) 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: AFR, .

    Note: _svc_name_="AFR"

    Something is not set correctly, but for the life of me
    I cannot determine what.

    Thanks in advance for any assistance.

    Regards,
    Larry Bates


    --
    http://mail.python.org/mailman/listinfo/python-list
     
    Pieter Claerhout, Mar 2, 2004
    #1
    1. Advertising

  2. Pieter Claerhout

    Larry Bates Guest

    I made the change, but get the exact same error message.

    I went back and checked the book again and it reads
    (on page 359):

    "The files PythonService.exe, win32evtlog.pyd, and
    win32service.pyd each have a set of generic messages.
    Each file has nine messages for each of the classes
    Error, Informational, Warning, and Success."

    I tried all three of these AND servicemanager.pyd
    and I can't make any of them work.

    Mark Hammond, are you out there anywhere?

    Regards,
    Larry

    "Pieter Claerhout" <> wrote in message
    news:...
    > Hi Larry,
    >
    > try the following:
    >
    > win32evtlogutil.AddSourceToRegistry('AFR',
    > 'C:\Python22\Lib\site-Packages\win32\servicemanager.pyd',
    > 'Application')
    >
    > The PythonService.exe doesn't contain the messages, but servicemanager.pyd
    > does.
    >
    > cheers,
    >
    >
    > pieter
    >
    > Creo
    > pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
    > | www.creo.com
    >
    > IMAGINE CREATE BELIEVE(tm)
    >
    > -----Original Message-----
    > From: python-list-bounces+pieter.claerhout=
    > [mailto:python-list-bounces+pieter.claerhout=] On

    Behalf
    > Of Larry Bates
    > Sent: 02 March 2004 00:20
    > To:
    > Subject: NT Services and EventLog problems
    >
    > I have tried everything I know to get my NT service
    > to make correct entries in the NT Event Log when the
    > service is started and stopped (and eventually when
    > permanent failures occur).
    >
    > I'm copying the code I see on page 356 of Python
    > Programming on Win32 and for the life of me I cannot
    > get this to work properly. Basically I have
    > the following code snippet at the top of my SvcDoRun
    > method:
    >
    > import servicemanager
    > servicemanager.LogMsg(
    > servicemanager.EVENTLOG_INFORMATION_TYPE,
    > servicemanager.PYS_SERVICE_STARTED,
    > (self._svc_name_,''))
    >
    > I also inserted the following to make the proper
    > registry entries when the service is installed:
    >
    > win32evtlogutil.AddSourceToRegistry('AFR',
    > 'C:\Python22\Lib\site-Packages\win32\PythonService.exe',
    > 'Application')
    >
    > The entry that gets put into the Event Log is as follows:
    >
    > The description for Event ID ( 4098 ) in Source
    > ( PythonService ) 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: AFR, .
    >
    > Note: _svc_name_="AFR"
    >
    > Something is not set correctly, but for the life of me
    > I cannot determine what.
    >
    > Thanks in advance for any assistance.
    >
    > Regards,
    > Larry Bates
    >
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Larry Bates, Mar 2, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    1
    Views:
    584
    Thomas Kratz
    Sep 29, 2003
  2. omoore

    Writing to Windows EventLog

    omoore, Aug 20, 2004, in forum: Perl
    Replies:
    0
    Views:
    532
    omoore
    Aug 20, 2004
  3. Larry Bates

    NT Services and EventLog problems

    Larry Bates, Mar 1, 2004, in forum: Python
    Replies:
    1
    Views:
    319
    F. Petitjean
    Mar 2, 2004
  4. Richard Heesbeen

    Eventlog problems

    Richard Heesbeen, Jun 8, 2005, in forum: ASP .Net Web Services
    Replies:
    6
    Views:
    143
    Richard Heesbeen
    Jun 13, 2005
  5. JimM

    EventLog logName and source Usage.

    JimM, Aug 4, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    118
    [MSFT]
    Aug 8, 2005
Loading...

Share This Page