Hi Team
We are trying to capture the edge-message-processor/logs/system.logsystem.log into Datadog. But there was an issue we are facing on capturing the log continuously.
Issue: /opt/apigee/var/log/edge-message-processor/logs/system.log have setup with log rotation. once system.log was filled and zipped as gz file like (system-2024-02-14.1.log.gz) once zipped new system.log is created automatically. while creating the new system.log it's created without read permission with other users like below
-rw-r----- 1 apigee apigee 21058892 Feb 14 08:09 system.log.
Datadog agent is running with DD-agent user. We need to provide the read permission for other in the system.log.
I am able to find some logrotate setup has made on logback.xml /opt/apigee/edge-message-processor/source/conf/logback.xml.
<appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${data.dir:-..}/logs/system.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${data.dir:-..}/logs/system-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- keep max of 10 days -->
<maxHistory>10</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 50MB -->
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.apigee.logging.MaskPatternLayout">
<patternsProperty>${sensitiveDataPattern}</patternsProperty>
<pattern>${defaultPattern}</pattern>
</layout>
</encoder>
</appender>
Question: Where i need to make the changes in logback xml file to provide the read access for system.log file.
I think its not with Apigee, All the files creating on linux will follow the UMASK configured on the machine.
Try running the "umask" command & see, I think your machine will have the umask value as - 027 (-rw-r-----)
means, 0 - Owner, 2 - Groups, 7 - Others
So, check with your admin & try to update the umask value as 023 so that your DD-agent can read that newly created log file