Giter Site home page Giter Site logo

chalverson / json-logger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mulesoft-consulting/json-logger

0.0 0.0 0.0 189 KB

Drop-in replacement for default Mule Logger that outputs a JSON structure based on a predefined JSON schema

License: MIT License

Java 95.77% Shell 1.06% DataWeave 3.18%

json-logger's Introduction

JSON Logger - Mule 4

Drop-in replacement for default Mule Logger that outputs a JSON structure based on a predefined JSON schema.

Why?

  • Logs are as good as the logging practices applied by developers
  • Not all developers think alike on what needs to be logged
  • No tools to enforce proper logging standards
  • Simple but essential logging best practices (e.g. tie multiple log entries to a single transaction by using a correlation id) are inconsistent and drastically impact troubleshooting capabilities
  • The rise of Splunk, ELK and other log aggregation platforms is due to their ability to aggregate, understand and exploit data
  • These platforms typically understand key=value pairs or JSON data structures. Only then, the full potential of these tools can be unlocked in the form of advanced dashboards and reports

For these reasons and based on previous customer experiences, I created this generic Java SDK JSON Logger Connector.

How?

As mentioned above, this is a Java SDK based Mule 4 connector. However, in order to maximize customization to each customer's requirements while avoiding steep Java SDK learning curves, you can easily modify the output JSON data structure as well as connector configuration by editing 2 simple JSON schemas provided under:

/json-logger/src/main/resources/schema/

In a nutshell, by defining the output JSON schema as well as providing some additional SDK specific details (e.g. default values, default expressions, etc.), we can dynamically generate a module that aligns to those schemas.

Installation

Please check these blogposts for more details:

PART 1: https://blogs.mulesoft.com/dev/anypoint-platform-dev/json-logging-in-mule-4-getting-the-most-out-of-your-logs/

PART 2: https://blogs.mulesoft.com/dev/api-dev/json-logging-in-mule-4/

Running the provided deployment script will deploy JSON Logger to your Organization's Exchange:

e.g. ./deploy-to-exchange.sh <ANYPOINT_ORG_ID>

PS1. You can only use the deploy.sh script once (unless you manually delete the previous asset from your exchange within 7 days of deployment or increase the version in the pom.xml) as you can't deploy the same version to Exchange

PS2. For EU Control Plane deployment you have to modify the <distributionManagement> element inide the json-logger/pom.xml in the following way:

<distributionManagement>
  <!-- Target Anypoint Organization Repository -->
    <repository>
      <id>Exchange2</id>
        <name>Exchange2 Repository</name>
        <url>https://maven.eu1.anypoint.mulesoft.com/api/v1/organizations/${project.groupId}/maven</url>
        <layout>default</layout>
    </repository>
</distributionManagement>

Release notes HERE

Author

Support disclaimer

In case you haven't noticed the type of license for the source code, this is provided as a side project under MIT open source license which means it won't be officially supported by MuleSoft as it is considered a custom connector.

json-logger's People

Contributors

amartino10 avatar jerneyio avatar revelant-doug avatar skuller avatar sup-mule avatar svc-scm avatar tsinovoi-mule avatar

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.