GithubHelp home page GithubHelp logo

Comments (7)

errm avatar errm commented on May 24, 2024

This plugin does not support multiline... see #11

If you are interested on working on this... I am happy to accept a PR... But I have no interest in implementing it myself :)

from fluent-plugin-systemd.

Jitsusama avatar Jitsusama commented on May 24, 2024

@JooyoungJeong; multiline log handling can be handled before this plugin receives the event record. Common ways of handling this is via the concat filter plugin. I've used this myself with great success.

from fluent-plugin-systemd.

errm avatar errm commented on May 24, 2024

I have not tried but it does seem that systemd might support log entries with newlines in them... If this works then this plugin should read them correctly without any further configuration ... I will try to make this work and report back

from fluent-plugin-systemd.

Jitsusama avatar Jitsusama commented on May 24, 2024

@errm; that works for events sent to systemd as a single event, but more often than not, particularly in the case of Docker when it's configured to use systemd as its log-driver, they are sent to systemd as a separate event per log line. This is something I know all too well from my own personal experience.

from fluent-plugin-systemd.

errm avatar errm commented on May 24, 2024

I guess the other option would be to configure your applications logger to escape the newlines ... This guy has some examples about doing it in Java https://fabianlee.org/2018/03/09/java-collapsing-multiline-stack-traces-into-a-single-log-event-using-spring-backed-by-logback-or-log4j2/

from fluent-plugin-systemd.

JooyoungJeong avatar JooyoungJeong commented on May 24, 2024

Thank you for reply.
The form of exception error is not fixed(each language). So I redefined log pattern in application.
I use log4j2 and i defined pattern as follows.
"exception":"%replace{%xEx}{\n|\tat}{ }"

from fluent-plugin-systemd.

errm avatar errm commented on May 24, 2024

Sounds good... I will mention these two strategies in the docs... It does seem where the application is using a logger that can be configured the best option is to replace the newlines in each message to keep them as one systemd entry ...

from fluent-plugin-systemd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.