-
Notifications
You must be signed in to change notification settings - Fork 30
Setting up the Windows Event Log, or "The point of sale is crashing on this new computer!"
The Windows Clover Connector SDK uses the Microsoft Windows Event Log to perform logging. This log can only be set up with administrator credentials. If the log is not configured when the SDK is initialized, an error like the following is reported:
The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
The error frequently appears when the Clover Example POS project is run for the first time or a POS application is moved to a different computer without any configuration being performed.
An event source named _TransportEventLog
needs to exist for the Clover SDK to successfully submit log data. This event source can be located in any event log, and usually is placed either in the Application
event log or a custom log with the same _TransportEventLog
name.
NOTE: The following instructions are written for Windows 10 and Clover SDK v3.0. Other versions of Windows may require you to modify the steps to properly configure the log.
If you have administrator credentials for the computer, there are three options to quickly fix the problem.
When the POS app is run as an admin, the Clover SDK will have permission to set up the event source. Once the source has been set up, the application can be closed and relaunched as a standard user without error.
- Right-click the crashing point of sale application and select Run as administrator.
- Once the software is running, initiate a connection to a Clover device. The SDK is initialized and creates the event source in the log.
- Close the application and run it again with standard user credentials.
- Verify the error message does not appear.
- Right-click Start and select Windows PowerShell (Admin).
- If a User Account Control warning appears, click Yes.
- Run the following command:
New-EventLog -LogName "Application" -Source "_TransportEventLog"
- Select Start > Windows System.
- Right-click Command Prompt and select Run as administrator.
- If a User Account Control warning appears, click Yes.
- Run the following command:
eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO _TransportEventLog /D "Clover SDK Logging"
The Windows event log source can be configured during setup and deployment scenarios.
A point of sale application that uses the Clover Connector Windows SDK should configure the event log during installation.
Windows installer applications can set up event logs and sources when run with the usual setup.exe administrator credentials. Microsoft MSI tools like the WiX framework can create the log source as part of software installation and setup.
For example, you can use the WiX framework's UtilExtension to create an EventSource
. See the WiX documentation for more information.
<util:EventSource Log="Application" Name="_TransportEventLog" EventMessageFile="EventLogMessages.dll"/>
Other installer frameworks (such as InstallShield or NSIS) have similar capabilities.
The Clover SDK can be used to perform the event log source setup if wrapped in a configuration toll. This configuration application can be written to your specifications.
Microsoft has several APIs for creating event sources. As an example, from a .NET C# application, you may call EventLog.CreateEventSource from a custom configuration utility run with administrator credentials.
if(!EventLog.SourceExists("_TransportEventLog"))
{
EventLog.CreateEventSource("_TransportEventLog", "Application");
}
The PowerShell or Command Prompt commands provided above work in deployment scripts.