Hi,

I'll give it some thought. I know I avoided the use of Windows event
logs for a reason but I can't remember what that reason was. I'll see
if I can refresh my memory! :-) In addition, logging to a file allows
for errors to be reported earlier and with considerably greater detail
than would be possible with event logs -- the event log system isn't
always available whereas writing to a file is.

This is probably getting to your point about minimal documentation :-)
but there is a solution for you.

Specifically, you can pass a parameter to the service which is
expected to be the associated INI file. If no name is specified it
searches for <ExecutableName>.ini instead. Inside that INI file it
looks for the following:

[Logging]
FileName=
Level=
Prefix=
MaxFiles=
MaxFileSize=

There are defaults for these and these are what you are using.
FileName=<ExecutableName>.log
Level=ERROR
Prefix=[%i] %d %d
MaxFiles=1
MaxFileSize=1 MB

See the documentation for cx_Logging for additional information.

With that you should be able to specify where you want the file to go,
how much information you would like in it and whether you want to keep
a set of log files from previous invocations, etc.

Hope that helps. I'll make sure that I add this information to my
rather sparse documentation. :-) Thanks.

Anthony

On Tue, Mar 2, 2010 at 3:00 AM, Wolfgang Langner <[email protected]> wrote:
> Hi,
>
> thanks for this great package. I'm a heavy user of cx_freeze.
>
> We use also the new Windows service support. This is a must have for use.
>
> Documentation is a bit sparse. ;-) But I got all running.
>
> Usage is as Windows service. The same executable is used to start more than
> one service. This works with the additional configuration ore name parameter.
>
> But there are still to problems.
>
> 1. Dependency to cx_Logging. We must ship this package too, only because the
>    Service executable is linked to it. But essentially it is not really
>    needed for use.
>
> 2. cx_Logging starts always the logging to a file. We immediately disable this
> with:
> import cx_Logging
> cx_Logging.StopLogging()
>
> in the service handler. But a file is still created in the directory of the
> service exe with two messages. (start logging stop logging)
>
> Because of this behavior we get in trouble if the same service exe starts two
> services with different names. But the logfile from cx_Logging is created and
> locked for the other service start.
> Also there are problems if the directory of the service exe is not writable
> after installation.
>
> Is it possible to remove the dependency of cx_Logging in the windows service
> based exe and log all errors for start up to the windows event log ?
> (As every other windows service does this.)
>
> The code change is minimal. I can help out with testing all of this.
>
>
> Regards
>
> Wolfgang
> --
> Wolfgang Langner
> Dipl.-Ing.(FH)                                 phone: +49 711 782380 43
> flexis AG                                        fax: +49 711 782380 78
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> cx-freeze-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to