Server Logs
Mideye Server supports Syslog, SNMP and Event Viewer (Windows) for service monitoring and forwarding of log information. Mideyeserver.log is located in C:\Program Files (x86)\6\log in Windows Server and /opt/mideyeserver6/log/ in Linux.
Log files in Web Gui¶
To brows logs in the webgui. Navigate to "Logs" → "Log Files". The default settings will show info, warning and error messages but can be customized from the “Log Configuration” page located under “Server Settings”.
Except for the MideyeServer.log file, all trace files that have been created can be viewed from this page.
Log Configuration - Web Gui¶
The level of logging can be customized. The default value is "Info".
Note
Changes made to the log levels are reset when the Mideye Server service is restarted, defaulting back to "Info". For a permanent custom log level setup, please head to the Configuration File part of the documentation. Testing 123
The "Start Trace" button can be used for troubleshooting purposes and will continue until the "Stop trace" button is pressed. The trace-file will be written to %installdir%\log.
Advanced Log Configuration - Web Gui¶
All the loggers can be individually customized. These should normally not be changed.
Log Timezone Configuration¶
The Mideye Server logs are configured to display the time in UTC by default. To change this, open the file named 'logback.xml' usually located at:
Open the 'logback.xml' file and edit the following lines:
<property name="FILE_LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss.SSSXXX, UTC} %-5level [%thread] %logger{0}: %msg%n"/>
<property name="ERROR_LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss..SSSXXX, UTC} %-5level %logger{0}: %msg%n"/>
To for example, Stockholm:
<property name="ERROR_LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss.SSSXXX, Europe/Stockholm} %-5level %logger{0}: %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss.SSSXXX, Europe/Stockholm} %-5level [%thread] %logger{0}: %msg%n"/>
Once this has changed, the logs should look something like this:
2023-11-17 03:35:28.965+01:00 INFO [main] MideyeServerApp: The following 1 profile is active: "prod"
Compared to previously, when the server was configured to UTC:
For the full list of timezone identifiers, please refer to the 'IANA Time Zone Database', which is also known as the 'Tz database'.
Syslog¶
Mideye Server log files can be sent to a Syslog server through the logback configuration %installdir%\config\logback.xml. By default it is commented out.
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>172.16.3.51</syslogHost>
<facility>SYSLOG</facility>
<port>514</port>
<suffixPattern>java %d{ISO8601,UTC} %p %t %c %M - %m%n</suffixPattern>
</appender>
<root level="INFO">
<appender-ref ref="SYSLOG" />
</root>
Event Viewer¶
Windows Event Viewer logging for Mideye Server is enabled by default. All Mideye Server logs with severity Warning or higher will be sent to the Event Viewer. The location for these logs is Windows Logs – Application. To get a better overview of logs, a custom view can be created in the Event Viewer console.
Open Event Viewer and right clock “Custom Views”. Select “Create Custom View…” and choose “By Source”. Click the dropdown list and select “MideyeServer”. Click “OK”.
Now all logs from the Mideye Server will be found in the “Custom View” tree.
To change the severity level of the logs sent to the Event Viewer open %installdir%\config\logback.xml as an administrator. In the appender named “Windows” change the level of severity. Save the file and restart the Mideye Server service.
<appender name="WINDOWS" class="com.mideye.mideyeserver.logging.JNAAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>return logger.startsWith("com.mideye");</expression>
</evaluator>
<OnMismatch>DENY</OnMismatch>
<OnMatch>NEUTRAL</OnMatch>
</filter>
</appender>
SNMP¶
SNMP can be enabled by opening %installdir%\config\logback.xml as an administrator. Uncomment everything for the SNMP appender and add the necessary configuration. Add the following line under root level warn line:
<appender name="SNMP" class="com.sathwik.logback.appender.SNMPTrapAppender">
<!--properties-->
<community>public</community>
<enterpriseId>1.3.6.1.4.1.16625.1.12.5</enterpriseId>
<host>localhost</host>
<port>161</port>
<specificTrapType>1</specificTrapType>
<!-- Major, warning etc-->
<priority>Critical</priority>
<escalation>escalate immediate</escalation>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<root level="ERROR">
<appender-ref ref="SNMP"/>
</root>
Save the file and restart the service.