Giter Site home page Giter Site logo

Comments (6)

vy avatar vy commented on July 19, 2024
  • Regarding renaming source_host to host, exception.exception_class to exception.class, and thread_name to thread, I intentionally picked those field names to be aligned with the official logstash/log4j-jsonevent-layout project. (Am I missing something here?) In case of a particular need, you can provide your own JSON template.
  • Providing an interface for variable substitution makes totally sense. I will check how can I do that.
  • Extending MDC and NDC maps can be a little bit challenging given the lack of a proper JSON schema processor solution. What do you think of adding two new properties: mdc_extension and ndc_extension? I can merge these with mdc and ndc maps respectively prior to logging.
  • About filtering MDC and NDC maps, would a simple mdcKeyPattern and ndcKeyPattern having a regex statement address your case? As you can imagine, these will definitely add quite some regex processing overhead to the logging too.

from log4j2-logstash-layout.

gquintana avatar gquintana commented on July 19, 2024

Thanks Volkan,

  • Extending context: what about an "LDC" map (logger DC) at the Logger level, and copy it in a separate JSON field instead of merging maps? Another idea: be able to add custom fields in particular type/tags fields in order to be able to process logs differently on Logstash depending on matching appender (at the moment having a different layout for each appender is painful).
  • Filtering MDC/NDC: a list of authorized fields is enough for my usecase. This means iterating over this list and fetch values from the map instead of iterating over the map entries. Another idea: make filtering plugable (a predicate over map entries).

from log4j2-logstash-layout.

vy avatar vy commented on July 19, 2024
  • Extending context: From your description I understood that you just want to have a custom map similar to MDC/NDC. Right? If so, why not creating a map entry (i.e. "ldc": {"foo": "bar", "baz": "moo"}) in a custom JSON template? Am I misinterpreting your explanation?
  • Filtering MDC/NDC: Do you want to filter on keys, values, or both?

from log4j2-logstash-layout.

vy avatar vy commented on July 19, 2024

Just pushed v0.4 to Maven Central. Added mdcKeyPattern and ndcPattern configuration parameters. Further, Log4j 2.x Lookup support is integrated.

from log4j2-logstash-layout.

gquintana avatar gquintana commented on July 19, 2024

Thanks. I'll reopen a new issue to be able to get environnement vars/system properties in template.

from log4j2-logstash-layout.

vy avatar vy commented on July 19, 2024

@gquintana, I've already released that feature. Let me know if it doesn't work for you.

from log4j2-logstash-layout.

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.