Date Posted:
Product: TIBCO Spotfire®
Product: TIBCO Spotfire®
Problem:
How to increase the log files retention period on the TIBCO Spotfire Server
Solution:
This article describes how to increase the log files retention on server for a longer period.
Spotfire Version 10.3 and higher
From 10.3 onwards, we have a number of properties in "log4j2-custom.xml" that controls the size of log files and number of log files retained.1. Open "log4j2-custom.xml" located at "<Spotfire Server install dir>\tomcat\spotfire-config\log4j2-custom.xml"
2. Edit below properties as per your requirement.
<Property name="serverLogSizePolicy">20MB</Property> <Property name="serverLogDefaultRollover">39</Property> <Property name="nonServerLogsSizePolicy">10MB</Property> <Property name="nonServerLogsDefaultRollover">9</Property>3. Increase serverLogSizePolicy if you want your server log files to be larger than 20MB, increase serverLogDefaultRollover to increase the number of backups retained. The other two properties are similar but controls the sizes and number of the other log files.
NOTE: Neither of these properties controls Tomcat logs or the user action log
4. Save
Spotfire Version 7.9 to 10.2
From 7.9 log4j2 is used, and you can find the settings in "log4j2.xml" located at "<Spotfire Server install dir>\tomcat\spotfire-config\log4j2.xml"1. Open "log4j2.xml"
2. Locate the main server.log appender (or other log appender):
<RollingFile name="serverlog" fileName="${basedir}/server.log" filePattern="${basedir}/server.log.%i"> <Policies> <SizeBasedTriggeringPolicy size="20MB"/> </Policies> <DefaultRolloverStrategy max="39" fileIndex="min"/> <PatternLayout pattern="${standardLogPattern}"/> </RollingFile>3. Increase SizeBasedTriggeringPolicy size in the above section which is 20MB as shown to increase the size of each file, or increase the DefaultRolloverStrategy to increase the number of backups retained..
4. Save
Spotfire Version 7.8 and lower
Below is the example when the logging configuration is set to log4j.properties. Please note that you can update these settings on INFO (log4j.properties), DEBUG (log4j.debug.properties) or any logging level which each have their own separate properties file.1. Open log4j.properties file from "<Spotfire Server install dir>tomcat\webapps\spotfire\WEB-INF\log4j.properties" in text/xml editor
2. Locate the main server.log appender (or other log appender):
# Define the main log appender log4j.appender.serverlog=org.apache.log4j.RollingFileAppender log4j.appender.serverlog.File=${log.dir}/server.log log4j.appender.serverlog.MaxFileSize=10000KB log4j.appender.serverlog.MaxBackupIndex=9 log4j.appender.serverlog.layout=org.apache.log4j.PatternLayout log4j.appender.serverlog.layout.ConversionPattern=%p %d{yyyy-MM-dd'T'HH:mm:ss,SSSZ} [%X{thread.info}] %c{3}: %m%n log4j.appender.serverlog.encoding=UTF-8
3. Increase the MaxBackupIndex or MaxFileSize.In the above section,"log4j.appender.serverlog.MaxFileSize" is the property for server.log file size which is 10MB as defined and "log4j.appender.serverlog.MaxBackupIndex" is the property for backup file count. Also,It should be ensured that there is adequate disk space to accomodate the additional logs (existing configuration requires 100MB for server.logs)
4. Save.
Comments
0 comments
Article is closed for comments.