Debugging an NT service is hard for the following reasons:
When testing your NtService class, run it in the Carapace interpreter. Finally, when it looks to be working as desired, run it as an installed NT service.
Carapace services write to NT's Event Log at the following stages:
If the service fails to start, the Event Log is the first place to look. If you have any catastrophic errors (eg. you registered the service using the wrong Carapace script name) then you will see an error record in the event log.
Finally, a Carapace NT service requires you to have a log in your NtService object. This is so that your service can write to a log file and record what it is doing. Of course, a log is no use if nothing relevant is written to it!
When run as an NT service, the following script function is available to a Carapace script:
logEventWrite the supplied message to the system's application Event Log at the supplied severity level. The severity level can be one of the following:
info
warn
error
Arguments:
| severity | String |
| message | String |
Return type: returns the empty List ()
| Contents | Index | Current topic: objects | Related topics: functions |