Skip to content

Setting up the Windows Event Log, or "The point of sale is crashing on this new computer!"

Joel McIntyre edited this page Apr 4, 2019 · 2 revisions

Event log details

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.

Workarounds for existing installations

If you have administrator credentials for the computer, there are three options to quickly fix the problem.

Run the POS app as an administrator

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.

  1. Right-click the crashing point of sale application and select Run as administrator.
  2. Once the software is running, initiate a connection to a Clover device. The SDK is initialized and creates the event source in the log.
  3. Close the application and run it again with standard user credentials.
  4. Verify the error message does not appear.

Add the log source using PowerShell

  1. Right-click Start and select Windows PowerShell (Admin).
  2. If a User Account Control warning appears, click Yes.
  3. Run the following command:
New-EventLog -LogName "Application" -Source "_TransportEventLog"

Add the log source using the Windows Command Prompt

  1. Select Start > Windows System.
  2. Right-click Command Prompt and select Run as administrator.
  3. If a User Account Control warning appears, click Yes.
  4. Run the following command:
eventcreate /ID 1 /L APPLICATION /T INFORMATION  /SO _TransportEventLog /D "Clover SDK Logging"

Deployment scenarios

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.

Configure the logs when installing

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.

Create a custom configuration utility

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");
}

Configure the log when running a deployment script

The PowerShell or Command Prompt commands provided above work in deployment scripts.