Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Win32::Daemon problem

by $code or die (Deacon)
on Sep 21, 2001 at 03:44 UTC ( [id://113746]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Win32::Daemon problem
in thread Win32::Daemon problem

Ahh. I've run into similar problems before. Win32 services are more difficult to debug because you can't see what's going on. What I've done in the past is log errors to a text file. This is fine for development, but in production you probably want to use the Event Log, with Win32::EventLog or Win32::EventLog::Message - I don't have a link, but I think it's another one of Dave Roth's.

I find something along these lines useful:
BEGIN { $SIG{__WARN__} = $SIG{__DIE__} = sub { open ERRORLOG, ">>/myerror.log" or die "error opening logfile"; print ERRORLOG, scalar localtime, " - $0\n", @_, "\n\n"; close ERRORLOG; } }
I think this would have caught your problem and written it to a log file.

John M. Dlugosz pointed out recently that you can also use Win32::MessageBox from within a Service. So you could replace that logfile with a more immediate and visual prompt.

Simon Flack ($code or die)
$,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
=~y'_"' ';eval"die";print $_,lc substr$@,0,3;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://113746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 04:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found