Reputation: 191
I've a application Java/Spring boot that is running in a Kubernetes pod, the logs is configure to stdout, fluentd get logs from default path:
<source>
@type tail
path /var/log/containers/*.log
pos_file /pos/containers.pos
time_key time
time_format %Y-%m-%dT%H:%M:%S.%NZ
tag kubernetes.*
format json
read_from_head true
</source>
In my logback xml configs i've a appender json file:
<appender name="jsonAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/spring-boot-logger.log</file>
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>1</maxIndex>
<fileNamePattern>${LOG_PATH}.%i</fileNamePattern>
</rollingPolicy>
<KeyValuePair key="service" value="java-app" />
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>1MB</MaxFileSize>
</triggeringPolicy>
</appender>
How do I integrate this separate log file other than stdout in my Kubernete settings along with Fluentd, to send my json logs in a different path
Upvotes: 2
Views: 3215
Reputation: 44579
resources
folder.Upvotes: 1
Reputation: 54211
You need to:
Upvotes: 1