Windows Service

The Windows service (Q-ENGINE_service.exe) can be registered or removed as a service via the command line.

To do this, enter the application name followed by the parameter in the Windows command prompt.

It is best to open the command prompt with administrator rights, otherwise the command cannot register or remove the service:

  • Service installation
    • Q-ENGINE_service /i
    • Q-ENGINE_service /install
  • Service removal
    • Q-ENGINE_service /u
    • Q-ENGINE_service /uninstall

If the program is started without a parameter, the application runs in the command prompt.

For example, all logging is then also output in the command prompt.

If the command prompt is closed or the Windows user logs off, this service is also terminated.

For the service to run independently of a Windows user login or command prompt,

the service must be installed as described above.

The service can then be started / stopped via the Windows service settings or via the command line:

net stop "<service>"     for example: net stop Q-ENGINE_test or net stop "Q-ENGINE prod"

net start "<service>"     for example: net start Q-ENGINE_test or net start "Q-ENGINE prod"

The quotation marks (") are only necessary if the service name contains spaces.

Configuration

The Windows service is configured via settings in the file Q-ENGINE_service.exe.config.

Settings can be made starting at line 22. These are:

ServiceNameThe service name suffix with which the service runs on the system. For example: _test or _prod
WaitInSecondsThe time in seconds between service runs (wait time). The minimum is 5 and the maximum is 50. Values outside this range will cause the service not to run.
LicenseKeyPathBy default, the service checks its execution directory for a valid license. If a directory path for the license is set, the service also checks whether a valid license is available at this location. For example: C:\Q-Matrix™\
Without a valid license, the service cannot run.
QPORTAL_URLA URL / web address at which Q-PORTAL (if present / available) can be reached, for example: http://localhost/qportal/
DBBackupPathA directory path for temporarily storing database backups, for example: C:\tmp\

For the configured logging variants, the level of detail is set in the RULES element:

    <rules>
      <!-- Debug: minLevel = Trace - Prod: minLevel = Info -->
      <logger name="*" minlevel="Trace" writeTo="debugger" />
      <logger name="*" minlevel="Trace" writeTo="console" />
      <logger name="*" minlevel="Trace" writeTo="file" />
    </rules>

The following logging levels of detail can be set:

OFFLogs no application events
FATALLogs only application events defined as FATAL
ERRORLogs only application events defined as ERROR and FATAL
WARNLogs only application events defined as WARN, ERROR, and FATAL
INFOLogs only application events defined as INFO, WARN, ERROR, and FATAL
DEBUGLogs only application events defined as DEBUG, INFO, WARN, ERROR, and FATAL
TRACELogs all defined application events

The logging level is defined starting at line 42, and the default setting for productively used services is set to the INFO level of detail.