Event log
The running service logs to C:\ProgramData\SofCat\Data\sofcat.log. The
commands that install and remove it do not: on Windows, every step and the
outcome of sofcat.exe -serviceinstall, -serviceremove, -servicestart
and -servicestop go to the Windows Application log. The installer runs the
first two, so setup.exe and uninstall.exe leave their record there, even
for a silent (/S) run whose output nobody sees. Each entry also goes to
stderr.
To read them, open Event Viewer, then Windows Logs → Application, and
filter by the source, which is the brand’s slug (sofcat for SofCat). From
PowerShell:
Get-WinEvent -FilterHashtable @{LogName = 'Application'; ProviderName = 'sofcat'} -MaxEvents 50The entry’s level is the record’s: Information, Warning or Error. Its text is
the message followed by the details as key=value pairs, for example
ended a running agent pid=4120 image="C:\Program Files\SofCat\sofcat-useragent.exe".
-serviceinstall and -servicestart succeed only once the service is
running. The service reports running when its pipe is listening, before its
first run, so a run that fails, or a missing config.yaml, does not fail
them. They return as soon as the service reports running, fail as soon as
it stops instead, with an error that it did not stay running, and give up
after 30 seconds of it still starting. Its reason is in sofcat.log; the
System log’s Service Control Manager entries record the exit. The wait ends
when the service reports running, so these commands do not detect a service
that fails after that. -servicestart on a service that is stopping fails
at once: run it again once the service has stopped. A failed
-serviceinstall undoes its own steps, as on any of its failures: it
removes the Run value, stops the service if it is still starting, and
deletes it.
On stderr, each step is an info-level log line on every run. When a command fails,
stderr shows the error twice: once as the level=ERROR log line and once
as the plain error line the command exits with.
Event IDs
Section titled “Event IDs”| ID | Step |
|---|---|
| 1 | Anything without its own ID below |
| 2 | A command started, succeeded or failed; the failure carries the error |
| 3 | The service registered with the service manager, or that registration undone after a failed install |
| 4 | The service started, or was already running |
| 5 | The service stopped, or was already stopped |
| 6 | The service deleted, or found not installed by -serviceremove |
| 7 | The logon Run value <slug>-user-sync written |
| 8 | The Run value removed, already absent (the uninstaller runs -serviceremove twice), or undone after a failed install |
| 9 | The ACL on the data directory or config.yaml applied, or a warning that it could not be |
| 10 | -serviceremove ended a running per-user helper or storefront |
| 11 | An ended process had not exited 5 seconds later; its executable may be left behind |
| 12 | -serviceremove could not do part of its sweep (privilege, process list, open or end a process) |
The IDs never change meaning; new kinds of step get new IDs.
The source
Section titled “The source”-serviceinstall registers the source in the Application log before its
other steps, as an EventCreate source (the messages file Windows ships for
eventcreate.exe, which accepts IDs 1 to 1000). A source that already
exists, from a reinstall or an upgrade, is left as it is, unless it has no
message file (a registration that stopped part way), which is registered
again. -serviceremove,
-servicestart and -servicestop register it too when it is missing, for a
machine installed by an older version.
A brand’s slug must not match an event source that already exists, built
in or from other software, such as MsiInstaller or Application Error.
SofCat would write its entries under that source and its message file, and
they would read wrong or not at all. Check before choosing a slug:
Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Application\<slug>'Nothing removes the source: it stays registered after uninstall, as
C:\ProgramData\SofCat stays, so the uninstall’s own entries remain readable.
Remove it by hand for a clean slate:
Remove-Item 'HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Application\sofcat'If the source cannot be registered or opened, the command says so on stderr and logs to stderr only. Logging never fails or blocks an install or a remove.
On macOS the same commands log to stderr only.