Publish Log From Naked MuleSoft Deployment to Logz.io
MuleSoft supports configuration and dependencies in log4j to publish logs to logz.io from CloudHub and Naked Mulesoft deployment. Find out more!
Join the DZone community and get the full member experience.
Join For FreeAgenda
- Introduction.
- What is Logz.io ?
- Naked deployed MuleSoft configuration to send log to Logz.io.
Introduction
MuleSoft Feature
MuleSoft supports configuration and dependencies in log4j to publish logs to logz.io from CloudHub and Naked Mulesoft deployment.
About Logz.io
Logz.io provides a cloud-based log analysis service which is based on the open source log analysis platform — the ELK Stack (Elasticsearch, Logstash, Kibana).
About Logz.io
The features provided by Logz.io include: alerting, user control, parsing services, support, integrations, and audit trail.
- The platform uses machine learning algorithms to identify and reveal critical errors hidden within the log data.
Major Feature
- Log management.
- Infrastructure Monitoring.
It supports well-designed with Kibana to helps engineers quickly find the information needed.
Users Leverage:
- The most familiar log searching syntaxes: Lucene and KQL
- Rich visualization capabilities offered by Kibana
- Premade dashboards built to monitor popular cloud technologies
Naked Deployed MuleSoft Configuration to Send Log to Logz.io
- MuleSoft application helps to customize log to transmit to custom appender defined in Log4j file.
- Following the same method, we can configure MuleSoft logz.io custom library and dependencies in pom.xml and log4j file to publish logs to Logz.io tool.
- Below configuration approach can be defined as below :
- Package need to configured in log4j file.
- Appender need to define.
- Dependencies need to define in pom.xml file.
Package need to configured in log4j file.
<Configuration packages="io.logz.log4j2">
Appender need to define.
xxxxxxxxxx
<LogzioAppender name="logzio"> <logzioToken>CpIrnNqZuDUmcekXXXXXXXXXXXXXlLt</logzioToken>
<logzioType>MuleSoft</logzioType>
<logzioUrl>https://listener.logz.io:8071</logzioUrl>
<debug>false</debug>
<drainTimeoutSec>1</drainTimeoutSec>
<addHostname>true</addHostname>
</LogzioAppender>
xxxxxxxxxx
<Loggers>
<AsyncLogger name="com.mulesoft.ps.transaction"
level="INFO">
<AppenderRef ref="logzio" />
</AsyncLogger>
<AsyncLogger name="org.mule.service.http" level="WARN" />
<AsyncLogger name="org.mule.extension.http" level="WARN" />
<AsyncLogger
name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor"
level="INFO" />
<AsyncRoot level="INFO">
<AppenderRef ref="file" />
<AppenderRef ref="logzio" />
</AsyncRoot>
</Loggers>
POM dependencies added.
xxxxxxxxxx
<dependency> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>io.logz.log4j2</groupId>
<artifactId>logzio-log4j2-appender</artifactId>
<version>1.0.12</version>
</dependency>
<dependency>
<groupId>io.logz.sender</groupId>
<artifactId>logzio-sender</artifactId>
<version>1.1.1</version>
</dependency>
Logz.io Initial configuration.
Create a user in Logz.io.
Go to Setting and then to General section. We can see below screen.
Logz.io Initial configuration.
In general section we can find token which is required to configure appender in log4j file to communicate and authorized external system to transfer data
MuleSoft Configuration in MuleSoft application flow
MuleSoft Configuration in MuleSoft application flow
Logs can be verified in Logz.io
Opinions expressed by DZone contributors are their own.
Comments