Centralized logging from all the servers to a single server

Which IIQ version are you inquiring about?

*8.4p1

Share all details about your problem, including any error messages you may have received.

We have 4 servers in our production. Two are task and two are UI/web servers.
All the 4 servers have the log4j2 configured to capture the logs to the individual/own servers.
We want to implement centralized logging i.e., all the logs from 4 servers should get into one file within in any server.
We have provided the common location and the logs have started to generate into one location. The problem we see is though we configured to have 20 MB in each file, the file size is crossing 300 MB and making it difficult to open or look at logs as the file is getting stuck.

Any suggestions on this how we can achieve it.

Thanks,
Sayanth

Hi @SayanthBR2,

I think using one file for 4 servers is not a good idea. First of all, the problem you have now is that 4 servers generate a lot of information and the file size increases very quickly. Later, each server can doing different things, depeding the configuration, so searching something specific in a single file could be very difficult.

Better if you use 4 file, one for each server, in the same location.

Hi @SayanthBR2 ,

Ensure that rolling logging is properly configured in the log4j.properties file. With rolling logging enabled, once the log file size reaches 20MB, Log4j will automatically create a new log file, preventing the original file from growing indefinitely.

Please refer the rolling log configuration.

appender.RollingFile.type = RollingFile
appender.RollingFile.name = file
appender.RollingFile.fileName=/opt/sailpoint/tomcat/logs/sailpoint.log
appender.RollingFile.filePattern = ${LOG_DIR}/application.%d{dd-MMM}.log.gz
appender.RollingFile.layout.type = PatternLayout
appender.RollingFile.layout.pattern = %d{ISO8601} %5p %t %c{4}:%L - %m%n
appender.RollingFile.policies.type = Policies
appender.RollingFile.policies.size.type = SizeBasedTriggeringPolicy
appender.RollingFile.policies.size.size=20MB
appender.RollingFile.strategy.type = DefaultRolloverStrategy
appender.RollingFile.strategy.max = 20

rootLogger.appenderRef.file.ref=file