Publish JSON Logger on Exchange
How to published JSON logger on Anypoint Exchange
As the name suggests, the JSON logger prints the JSON format logs, which can be helpful when logging into any external log analytics tool such as ELK or Splunk.
JSON Logger connector looks like below in Anypoint Exchange.
- For any project if we are using a JSON logger it will be helpful for logging purposes to see the logs for any API which we implement.
- Make a clone of the JSON logger from the repository below mentioned in the reference.
- From the json-logger open the pom with any editor from the below screenshot.
4. In the pom file you will get <groupId>organizationId</groupId> tag.
5. If you see the color part is your organization-Id,which you will get in Anypoint platform as mentioned in the below step.
Anypoint Platform -> Management Center -> Access Management -> Organisation
6. The tags you have to use as mentioned below.
<name>JSON Logger — Mule 4</name>
<! — Target Anypoint Organization Repository →
<! — Shared Mule Services Repository →
10. In your .m2 folder you have to create the setting.xml file.
11. The below screenshot you see we have to write in the same manner.
<?xml version=”1.0" encoding=”UTF-8"?>
12. In the setting.xml file write the<settings> tag. if you miss it then it will throw an error.
13. Now, go to the path below as show.
14. In the template-files you are able to see in the settings file we have the tags as below mentioned.
<! — Provided by Support →
<! — Customer Exchange Repository →
<! — <server>
<! — NOTE: In order to be able to publish assets to exchange, this user will need Exchange Contributor Role
<! — NOTE: In order to be able to publish assets to exchange, this user will need Exchange Contributor Role →
15. Once we done all the changes as mentioned above steps then open the cmd and write mvn clean deploy.
16. Below are some screenshot of your JSON logger build successfully.
17. In the below image you will see JSON logger BUILD SUCCESS.
18. Now, go to Anypoint Exchange and click on the JSON Connector. you are able to see the different tabs on it as shown below.
19. In Dependency Snippets you are able to find the different tabs.
Maven as below:
<dependency> <groupId>7c63b543-fbe9–4c06-b113–6dcc66f9e02c</groupId> <artifactId>json-logger</artifactId> <version>2.0.1</version> <classifier>mule-plugin</classifier> </dependency>
Gradle as below:
compile group: '7c63b543-fbe9-4c06-b113-6dcc66f9e02c', name: 'json-logger', version: '2.0.1', classifier: 'mule-plugin'
SBT as below:
libraryDependencies += “7c63b543-fbe9–4c06-b113–6dcc66f9e02c” % “json-logger” % “2.0.1” classifier “mule-plugin”
20. Now add the maven dependency of your project in the pom.xml as below.
21. If you are building any API you don’t have to and search in Exchange and search for that connector you have just add the dependency in the pom.xml and the connector will able to see in your mule palette as shown below.
22. Below is the Data that was logged using JSON Logger.
22. The biggest benefit of logging in JSON is that it has a structured format. This makes it possible to analyze application logs just like Big Data. It’s not just readable, but a database that can be queried for each and every field.
By using JSON logger, we can logging into any external log analytics tool such as ELK or Splunk.
- Clone Repo:
json-logger/json-logger at mule-4.x · mulesoft-consulting/json-logger
Bug fixes: Added support for large payloads New features: External Destinations Data masking Improvements: More details…