Skip to content

farukonder/mule-log4m-connector

Repository files navigation

Log4m connector for mule4

blog

splash

Mule comes with built-in log activity, but it has some limitations. The log4m connector, however, enhances the default features by incorporating additional capabilities.

  • Built-in JSON logger
  • Correlation ID (choose between default correlation ID or a custom one)
  • Transaction ID (business transaction ID)
  • Log type (SUCCESS or FAIL)
  • Execution point name
  • Attributes of the execution point in the flow
  • Payload:
    • Payload
    • Error payload (in case of flow errors)
    • HTTP response payload (detailed information in case of HTTP errors, without requiring additional configuration)"

with combining this connector with elasticsearch, its really easy to classify any flow logs based on above fields easily.

elastic-fields

elasticsearch classification

elastic-classification

elasticsearch flow trace with details

elastic-fields

using in anypoint

after adding the connector, below is the usage details.

anypoint studio palette

palette

aynpoint action details action

compile

mvn clean package -DskipTests

define in pom.xml

Add this dependency to your application pom.xml

<dependency>
	<groupId>github.com.farukonder.mule4.connectors</groupId>
	<artifactId>mule-log4m-connector</artifactId>
	<version>0.0.1</version>
    <classifier>mule-plugin</classifier>
</dependency>

publish

put below xml snipped in your pom.xml file. and run mvn deploy in order to put this jar to artifact repository

	<distributionManagement>
		<repository>
			<id>cci-repo-mule</id>
			<url>https://pkgs.dev.azure.com/$organization/$project/_packaging/repo-mule/maven/v1</url>
		</repository>
		<snapshotRepository>
			<id>cci-repo-mule</id>
			<url>https://pkgs.dev.azure.com/$organization/$project/_packaging/repo-mule/maven/v1</url>
		</snapshotRepository>
	</distributionManagement>

know issues

issue:1 There's no XML files that has a root element, thus is impossible to auto generate a [mule-artifact.json] descriptor file. The file must start with [module-] and end with [.xml], such as [module-foo.xml]

fix:1 set JAVA_HOME like

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published