diff --git a/docker/fluentd/Dockerfile b/docker/fluentd/Dockerfile index e39f44d..f22e162 100644 --- a/docker/fluentd/Dockerfile +++ b/docker/fluentd/Dockerfile @@ -4,5 +4,6 @@ USER root COPY go-glitch / RUN chmod 777 /go-glitch COPY fluent.conf /fluentd/etc/ -RUN chown -R fluent:fluent /fluentd && chmod -R 700 /fluentd/etc +RUN chown -R fluent:fluent /fluentd && chmod -R 700 /fluentd/etc && \ + gem install fluent-plugin-gelf USER fluent \ No newline at end of file diff --git a/docker/fluentd/fluent.conf b/docker/fluentd/fluent.conf index 42336aa..cc1ffdd 100644 --- a/docker/fluentd/fluent.conf +++ b/docker/fluentd/fluent.conf @@ -8,10 +8,11 @@ @type parser key_name log reserve_data true - expression /^(?.*)\b(SIGTERM|SEVERE ERROR|FATAL|CRITICAL)\b/i + expression /^(?.*)\b(SIGTERM|SEVERE ERROR|FATAL|CRITICAL)\b/i - +# Route 1: Errors to Glitchtip + # Matches docker logs containing the severity terms @type exec command "/go-glitch" @@ -22,3 +23,11 @@ run_interval 10s + +# Route 2: Unfiltered to stdout + # Catch-all match for logs not matched by the error filter + @type copy # Duplicate to prevent original event modification + + @type stdout + + \ No newline at end of file