MID Server Log File Handler and Log File CompressionSummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } In Xanadu release, MID Server has a new log file handler named MIDLogFileHandler. This handler replaces the Java Util Logging (JUL) file handler as the default log file handler. The log configuration settings in glide.properties are changed as follows: Washington DC and previous releases glide.log.handlers=java.util.logging.FileHandler glide.log.formatter=com.service_now.mid.logging.MidLogFormatter #java.util.logging.FileHandler.level=Level.ALL #java.util.logging.FileHandler.filter= #java.util.logging.FileHandler.encoding= #java.util.logging.FileHandler.limit= #java.util.logging.FileHandler.count= java.util.logging.FileHandler.pattern=logs/agent%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.limit=10000000 java.util.logging.FileHandler.count=10 Xanadu, Yokohama, and newer releases mid.buildstamp=2024-12-02-1408 glide.log.handlers=com.service_now.mid.logging.MIDLogFileHandler glide.log.formatter=com.service_now.mid.logging.MidLogFormatter ## MIDLogFileHandler settings (See https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1637658 for more details) com.service_now.mid.logging.MIDLogFileHandler.pattern=logs/agent%u.log com.service_now.mid.logging.MIDLogFileHandler.append=true com.service_now.mid.logging.MIDLogFileHandler.limit=10000000 com.service_now.mid.logging.MIDLogFileHandler.count=10 com.service_now.mid.logging.MIDLogFileHandler.compression=none com.service_now.mid.logging.MIDLogFileHandler.cleanupOnStart=false MIDLogFileHandler can do log file compression. However, the compression mode is not enabled out of the box. When the compression mode is disabled, MIDLogFileHandler forwards the log API calls to an internal instance of the JUL FileHandler, so everything should work just like in the previous releases. To enable the compression, the user must change the compression setting from none to zip and restart MID Server: com.service_now.mid.logging.MIDLogFileHandler.compression=zip When the compression mode is enabled, all log files except the agent0.log.0 is compressed in the ZIP format. The compression happens during the log file rotation when the size (in bytes) of agent0.log.0 exceeds the value of the limit setting. The cleanupOnStart setting is dealing with the orphan log files when the file count setting changes from n to m where m < n. In this case, the JUL file handler doesn't clean up the log files with the ordinal number from m to n-1, so they must be removed manually. With cleanupOnStart set to true, MIDLogFileHandler will automatically remove those files. The following log settings are provided out of the box as MID Server properties [ecc_agent_property] on the instance: com.service_now.mid.logging.MIDLogFileHandler.limit=10000000com.service_now.mid.logging.MIDLogFileHandler.count=10com.service_now.mid.logging.MIDLogFileHandler.compression=nonecom.service_now.mid.logging.MIDLogFileHandler.cleanupOnStart=false These properties apply for all MID Servers, by having the ecc_agent field empty. Initially, their values do match the values of the same settings in the glide.properties file of a new MID Server. The users cannot delete, change name or the ecc_agent field. They can only change the value field. If they want to override the global settings for specific MID Servers, they must create new property records. Do not edit the file manually. On MID Server startup or whenever the properties change, they are synced down to MID Server and written to the glide.properties file if there are discrepancies. MID Server needs to restart to make the changes become effective. If that happens during the startup, MID Server will be automatically restarted and a message with the reason is added to agent log. If the users update the properties manually, a message will be displayed on the UI asking to restart the MID Server at their convenience. If these properties are missing from the instance please follow the steps provided in KB2664275 to resolve the MID Server Issue with source "Missing MID Log Handler Properties":KB2664275 Missing MIDLogFileHandler MID Server Properties Cause MID Servers To Go Into an Infinite Loop of Restarting During Start Up Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } The new feature is available in Xanadu or later. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Some applications, such as Splunk, want to pull agent log files for big data processing. If the compression is not enabled, they used to monitor all the agent log files in the MID Server logs folder. However, if the compression is on, they cannot work with the ZIP files. In this case, they can try to only monitor the agent0.log.0 file instead. Remember that this file is not compressed. All MID Server log messages are first written to agent0.log.0 and then the log files are rotated when the log file size exceeds the limit. In each rotation, the JUL file handler moves agent0.log.0 to agent0.log.1 and creates a new empty agent0.log.0 file. If a process is monitoring agent0.log.0, it may not be able to read data from the new file. To solve that issue, MIDLogFileHandler rotates agent0.log.0 by copying it to agent0.log.1 and then truncating agent0.log.0. Please note that it only works when the compression is enabled. If the compression is not enabled, MIDLogFileHandler forwards all log API calls to an internal JUL file handler and it doesn't have any control over the log rotation. In Zurich, there was a problem related to these properties being missing in the instance. This known error article contains a workaround:KB2664275 Missing MIDLogFileHandler MID Server Properties Cause MID Servers To Go Into an Infinite Loop of Restarting During Start Up