I’m hoping you can help me troubleshoot some issues we are experiencing with AlwaysUp. We are currently using version 12.9.0.46.
A user reported that something wasn’t working correctly with the application we’re running as a service. Upon investigating the issue, I noticed that AlwaysUp doesn’t appear to be writing any logs to the event viewer as stated on this page.
I thought I was maybe just missing any messages, so I stopped and restarted the service after about 1 minute. However, this also didn’t write anything to the Application Logs in Event Viewer.
Could you assist me in sorting out the reporting please?
— Lewis
Hi Lewis. Let’s dig into your situation.
Which account runs your application as a Windows Service?
Do you have a user specified on the Logon tab in AlwaysUp? That’s the account where your application will run.
For example, this screenshot shows OneDrive configured to run as a service in the “Mike Jones” account:
When we start OneDrive in AlwaysUp, the executable runs as “Mike Jones”:
And as Process Explorer shows, even AlwaysUpService.exe — the headless application that runs your application as a service in the background — operates as the same user:
Note that most Windows Services run in the LocalSystem account — a predefined local account used by the Service Control Manager. Indeed, AlwaysUp will run your application as LocalSystem unless you override it by providing an alternate account.
But running in a “regular” user account is often the best choice when installing an application as a service. That’s because most desktop applications are tied to the account where they were installed. Starting them in an account where they were not installed (and cannot find settings saved during installation and configuration) usually ends in failure.
That account must have permission to create event logs
As illustrated above, the service that AlwaysUp creates runs entirely in the context of the account specified on the Logon tab.
In your set up, the account doesn’t appear to have the necessary permissions to write to the event logs. That’s why you’re not seeing any records from AlwaysUp.
Test the account’s event log permissions with PowerShell
You can test this theory by running the following PowerShell command from the user’s account:
Please replace APPNAME with the name of your application in AlwaysUp.
Essentially, the Write-EventLog command simulates how AlwaysUp works. If Write-EventLog fails, then AlwaysUp will fail too.
Here is the result of running the command from the “Mike Jones” account for our OneDrive service. Write-EventLog succeeded:
And a new event showed up in the Application log:
So everything looked good for Mike.
How to enable event logging from your AlwaysUp service
You can fix the permission problem in one of three ways:
Grant the user administrative rights. As an admin, they will definitely be able to write to the event logs. This may be your easiest way forward.
Leave the user as a non-admin but grant the account specific rights to the Application event log. Depending on where the issue is, you may have to update the registry and perform other administrative surgery. These links offer guidance:
Enter a different user with administrative rights on the AlwaysUp Logon tab. That account shouldn’t have any problems creating records in any event logs.
Hope this helps!