Application Logging

GTR applications include a flexible logging system that can output log messages to multiple destinations. This is useful for troubleshooting issues, monitoring application behavior, and maintaining audit trails.

Configuration File Location

The logging configuration is stored in:

C:\ProgramData\GTR mbH\LogSettings_11.ini

This file controls logging behavior for all GTR applications on the system.

Main Settings

The [Main] section controls which logging outputs are enabled:

SettingValuesDescription
Enabled0 / 1Master switch to enable or disable all logging
LogToFile0 / 1Write log messages to files on disk
LogToConsole0 / 1Display log messages in the application console
LogToSyslog0 / 1Send log messages to a Syslog server
LogToEMail0 / 1Send log messages via email
LogToDebugString0 / 1Output to Windows debug string (for developers)
AlwaysShowDebugMessages0 / 1Include debug-level messages in output
AddMemoryUsageToLogout0 / 1Append memory usage information to log entries

File Logging

When LogToFile=1, log messages are written to files on disk. Configure file logging in the [LogToFile] section:

SettingDescription
GlobalLogFolderDirectory where log files are stored (e.g., c:\gtrlogs)
LogFileMaxSizeInMBMaximum size of a single log file before rotation (in MB)
MaxBackupFilesCountNumber of backup log files to keep

Example:

[LogToFile]
LogFileMaxSizeInMB=2
MaxBackupFilesCount=5
GlobalLogFolder=c:\gtrlogs

This configuration creates log files in c:\gtrlogs, rotates them when they reach 2 MB, and keeps up to 5 backup files.

Syslog Integration

For centralized logging, GTR applications can send messages to a Syslog server. Enable with LogToSyslog=1 and configure in the [Syslog] section:

SettingDescription
ServerNameIP address or hostname of the Syslog server
ServerPortUDP port (default: 514)
SeverityMinimum severity level to send
FacilitySyslog facility identifier
AppendExecNameToLogInclude application name in messages

Severity Levels

ValueLevelDescription
slDebugDebugDetailed debugging information
slInformationalInfoGeneral operational messages
slNoticeNoticeNormal but significant events
slWarningWarningWarning conditions
slErrorErrorError conditions
slCriticalCriticalCritical conditions
slAlertAlertImmediate action required
slEmergencyEmergencySystem is unusable

Facility Values

Common facility values for local use:

ValueFacility
sfLocalUseZeroLocal0 (16)
sfLocalUseOneLocal1 (17)
sfLocalUseTwoLocal2 (18)
sfLocalUseThreeLocal3 (19)
sfLocalUseFourLocal4 (20)
sfLocalUseFiveLocal5 (21)
sfLocalUseSixLocal6 (22)
sfLocalUseSevenLocal7 (23)

Email Notifications

For critical alerts, GTR applications can send log messages via email. Enable with LogToEMail=1 and configure in the [EMail] section:

SettingDescription
HostSMTP server hostname
PortSMTP server port (default: 25)
UseTLSEnable TLS encryption (0 / 1)
UseSSLEnable SSL encryption (0 / 1)
UsernameSMTP authentication username
PasswordFileFile containing the SMTP password
FromAddressSender email address
RecipientAddressRecipient email address
MinLogLevelMinimum severity to trigger email (e.g., Error)

Example:

[EMail]
Host=smtp.company.com
Port=587
UseTLS=1
UseSSL=0
Username=alerts@company.com
PasswordFile=emailpass.txt
MinLogLevel=Error
FromAddress=alerts@company.com
RecipientAddress=admin@company.com

This configuration sends an email notification whenever an error or more severe event occurs.

UI Log Display

The [Memo] section controls how logs appear in application UI components:

SettingDescription
NumRowsMaximum number of log rows to display
PrependDateToLogAdd timestamp to each log entry (0 / 1)

Common Configurations

Development / Troubleshooting

Enable verbose logging to console and file:

[Main]
Enabled=1
LogToFile=1
LogToConsole=1
AlwaysShowDebugMessages=1

Production Server

Log to file only, with email alerts for errors:

[Main]
Enabled=1
LogToFile=1
LogToConsole=0
LogToEMail=1
AlwaysShowDebugMessages=0
 
[EMail]
MinLogLevel=Error

Centralized Logging

Send all logs to a central Syslog server:

[Main]
Enabled=1
LogToSyslog=1
LogToFile=0
 
[Syslog]
ServerName=logserver.company.local
ServerPort=514
Severity=slInformational

Troubleshooting

Logs not appearing:

  • Verify Enabled=1 in the [Main] section
  • Check that at least one output destination is enabled
  • Ensure the log folder exists and has write permissions

Log files growing too large:

  • Reduce LogFileMaxSizeInMB value
  • Increase MaxBackupFilesCount to keep more history
  • Consider using Syslog for long-term storage

Email notifications not working:

  • Verify SMTP server settings and credentials
  • Check that MinLogLevel matches your expected severity
  • Ensure the password file exists and is readable