1. Introduction
The purpose of the document is to describe how to work with all parts of the Logging Module from the developers’ point of view. The document also contains descriptions of error states and description of communication with the component. To run the module you'll need a valid license (Demo, Start-up or Production). In case the license is lacking, the application with the given module will not start, and there will be a log message with corresponding information (how to install a license?).
All modules extend functionality of Anypoint Studio, Mule runtime engine and add many new features. Find out more about all modules, licensing and pricing. In case you're still missing an information please visit our FAQ page or contact us directly.
2. XML namespace
xmlns:ilm="http://www.integsoft.cz/schema/mule/logging"
xsi:schemaLocation=http://www.integsoft.cz/schema/mule/logging http://www.integsoft.cz/schema/mule/logging/current/mule‐ilm.xsd
3. Components
Component name | Description |
---|---|
rabbitmq‐logging‐config | Logging configuration. Inside, there is the connector to which the log message will be sent. |
rabbitmq‐connection | RabbitMQ connector. |
http‐logging‐config | HTTP logging configuration. Inside, there is the connector to which the log message will be sent. |
http‐connection | HTTP connector. |
file‐logging‐config | File logging configuration. |
file‐connection | File connector. |
mark‐start | Indicates the start of processing (creates execution context). It is processed synchronously and has minimal imprint. |
mark‐end | Marks the end of processing (uses the execution context from mark‐start). It is processed synchronously and has minimal imprint. |
log | Logs own messages. It is processed asynchronously and uses the execution context from previous mark‐start and mark‐stop calls. It internally transforms the template from the configuration and adds values to it and then sends it to the appropriate connector. |
4.1. Prerequisites
The classpath must contain libraries for the connector used (for example RabbitMQ) and must contain a text file with a template to which the appropriate values are added using placeholders.
4.2. Global disabling of logging
Apart from disabled switch on the connection object, it is possible to turn off logging globally in JVM via the ilm.logging.disabled system property, for example, the setting ‐Dilm.logging.disabled when starting JVM. If global logging is enabled, it is not possible to change anything locally using the disabled switch.
4.3. Use of mark‐start
<ilm:mark‐start config‐ref="testLoggingCfg" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
config‐ref | yes | no | String | Logging configuration reference. | |
execution‐id | no | yes | #[correlationId] | String | Execution ID. A subsequent mark‐end operation is bound to this ID. Default value is the correlation ID of the Mule message. |
4.4. Use of mark‐end
<ilm:mark‐end config‐ref="testLoggingCfg" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
config‐ref | yes | no | String | Logging configuration reference. | |
execution‐id | no | yes | #[correlationId] | String | Execution ID. This ID should be the same as in mark‐start. Default value is the correlation ID of the Mule message. |
4.5. Use of log
<ilm:log config‐ref="testLoggingCfg" level="Info" log‐message="#['Logged message ' ++ payload]" logger‐point="End of flow" custom‐correlation‐id="#[correlationId]" />
The method is not in a block, but it is advantageous to close it in <async /> block.
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
config‐ref | yes | no | String | Logging configuration reference. | |
execution‐id | no | yes | #[correlationId] | String | Execution ID. This ID should be the same as in mark‐start and mark‐end. Default value is the correlation ID of the Mule message |
level | yes | no | String | Logging level. | |
logger‐point | yes | yes | String | Logging position. | |
user | no | yes | String | User references. | |
log‐message | yes | yes | String | Log message. | |
custom‐correlation‐id | no | yes | String | Specific correlation ID. |
4.6. Type expiration-policy
<expiration-policy maxIdleTime="10" timeUnit="SECONDS" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
maxIdleTime | no | no | Number | A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration. | |
timeUnit | no | no | Enumeration | A time unit that qualifies the maxIdleTime attribute. One of: NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS. |
4.7. Type reconnect
<reconnect count="3" frequency="1000" blocking="false" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
count | no | no | Number | How many reconnection attempts to make. | |
frequency | no | no | Number | How often (in ms) to reconnect. | |
blocking | no | no | Boolean | If false, the reconnection strategy will run in a separate, non-blocking thread. |
4.8. Type reconnect-forever
<reconnect-forever frequency="1000" blocking="false" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
frequency | no | no | Number | How often (in ms) to reconnect. | |
blocking | no | no | Boolean | If false, the reconnection strategy will run in a separate, non-blocking thread. |
5.1. Logging configuration
<ilm:rabbitmq‐logging‐config name="testLoggingCfg" template‐file="logging‐message.template" fail‐on‐missing‐properties="false" ignore‐exceptions="false">
<ilm:rabbitmq‐connection hostname="localhost" port="5672" username="admin" password="adminadmin" virtual‐host="app‐logs" queue="log‐queue" exchange="log‐input" exchange‐type="fanout" />
<expiration-policy maxIdleTime="10" timeUnit="SECONDS" />
</ilm:rabbitmq‐logging‐config>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
template‐file | yes | no | String | The name of the file in classpath that contains the template for the log. | |
application‐key | no | no | String | Application key. | |
application‐name | no | yes | #[app.name] | String | Application name. Default is the name of the application obtained from the Mule runtime. |
fail‐on‐missing‐properties | no | yes | true | Boolean | It is used to configure whether it has to throw exceptions in case placeholder evaluation fails. |
replace‐if‐missing‐with | no | yes | null | String | If fail‐on‐missing‐properties is set to false, this value will be stored instead of the placeholder whose evaluation failed. |
ignore‐exceptions | no | yes | true | Boolean | If set to true, then exceptions during logging will be ignored (only logged to the log). |
escape‐values | no | no | true | Boolean | Enables or disables character escaping in the log message. |
escaper‐class | no | no | cz.integsoft.mule.ilm.internal.component.JsonValueEscaper | String | Name of Java class for escaping. |
rabbitmq‐connection | yes | – | rabbitmq‐connection | The connection types that can be provided to this configuration. | |
expiration-policy | no | – | expiration-policy | Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform will expire the instance at the exact moment that it becomes eligible. The runtime will actually purge the instances when it sees it fit. |
5.2. Connector configuration
<ilm:rabbitmq‐connection hostname="localhost" port="5672" username="admin" password="adminadmin" virtual‐host="app‐logs" queue="log‐queue" exchange="log‐input" exchange‐type="fanout">
<reconnection>
<reconnect count="3" frequency="1000" blocking="true" />
</reconnection>
</ilm:rabbitmq-connection>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
hostname | no | no | localhost | String | Name or IP address of the server with RabbitMQ. |
port | no | no | 5672 | Number | The port number of the server with RabbitMQ. |
username | no | no | String | Username. | |
password | no | no | String | User password. | |
use‐ssl | no | no | false | Boolean | SSL use switch. |
virtual‐host | no | no | / | String | Virtual host in RabbitMQ. |
queue | no | no | String | Queue name. | |
exchange | yes | no | String | Exchange name. | |
exchange‐type | no | no | fanout | String | Exchange type. |
routing‐key | no | yes | ilm-routing-key | String | Routing key. |
auto‐recovery‐enabled | no | no | true | Boolean | Enabling auto‐reconnect. |
nio‐threads‐count | no | no | Number | Number of I/O threads to RabbitMQ. Default depends on the RabbitMQ driver. | |
ignore‐connection‐errors | no | no | false | Boolean | If true, then it ignores exceptions in connection with RabbitMQ. If it is turned on and there is no connection to the remote system, then the log method will not send anything and there will be a message in the log that the log has not been sent. |
disabled | no | yes | false | Boolean | Enables or disables logging. Even a connection to the target system is not required (from Logging Module version 1.3.2). |
reconnection | no | – | One of: reconnect, reconnect-forever |
The reconnection strategy to use. Find more about connectivity and strategies. |
6.1. Logging configuration
<ilm:http‐logging‐config name="testLoggingCfg" template‐file="logging‐message.template" fail‐on‐missing‐properties="false" ignore‐exceptions="false" method="POST" path="/path" success‐http‐status‐codes="200..209,210">
<ilm:http‐connection host="${https.host}" port="${https.port}" protocol="HTTPS" max‐connections="4" max‐connections‐per‐route="4" connection‐idle‐timeout="30000" ignore‐connection‐errors="true"
socket‐properties="globalTcpSocketProps" enable‐cookies="false" tlsContext="sslSecurityContext" proxy‐config="globalHttpProxy">
<ilm:authentication>
<ilm:basic‐authentication username="${http.username}" password="${http.password}" preemptive="true" />
</ilm:authentication>
</ilm:http‐connection>
<ilm:http‐headers>
<ilm:http‐header key="Content‐Type" value="#['application/json']" />
<ilm:http‐header key="X‐ID" value="#[message.id]" />
</ilm:http‐headers>
<ilm:query‐params>
<ilm:query‐param key="param1" value="#['param1 value']"/>
</ilm:query‐params>
</ilm:http‐logging‐config>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
template‐file | yes | no | String | The name of the file in classpath that contains the template for the log. | |
application‐key | no | no | String | Application key. | |
application‐name | no | yes | #[app.name] | String | Application name. Default is the name of the application obtained from the Mule runtime. |
fail‐on‐missing‐properties | no | yes | true | Boolean | It is used to configure whether it has to throw exceptions in case placeholder evaluation fails. |
replace‐if‐missing‐with | no | yes | null | String | If fail‐on‐missing‐properties is set to false, this value will be stored instead of the placeholder whose evaluation failed. |
ignore‐exceptions | no | yes | true | Boolean | If set to true, then exceptions during logging will be ignored (only logged to the log). |
escape‐values | no | no | false | Boolean | Enables or disables character escaping in the log message. |
escaper‐class | no | no | String | Name of Java class for escaping. | |
path | no | yes | / | String | HTTP URI path. |
method | no | no | POST | Enumeration | Allowed HTTP method. One of: POST, PUT, PATCH. |
success‐http‐status‐codes | no | no | 200..226 | String | The range of HTTP status codes that the connector will consider successful. Others result in an exception being thrown, for example, "200..202,205,400". |
http-headers | no | – | Array of http-header | List of HTTP headers. | |
query-params | no | – | Array of query-param | Query parameters the request should include. |
6.2. Connector configuration
<ilm:socket‐properties name="globalTcpSocketProps" keep‐alive="true" connection‐timeout="30000" />
<tls:context name="sslSecurityContext">
<tls:trust‐store path="trustStore‐localhost.jks" password="changeit" />
</tls:context>
<ilm:proxy name="globalHttpProxy" host="localhost" port="8888" username="test" password="password" non‐proxy‐hosts="example.com,localhost" />
<ilm:http‐connection host="${https.host}" port="${https.port}" protocol="HTTPS" max‐connections="4" max‐connections‐per‐route="4" connection‐idle‐timeout="30000"
ignore‐connection‐errors="true" socket‐properties="globalTcpSocketProps" enable‐cookies="false" tlsContext="sslSecurityContext" proxy‐config="globalHttpProxy">
<ilm:authentication>
<ilm:basic‐authentication username="${http.username}" password="${http.password}" preemptive="true" />
</ilm:authentication>
</ilm:http‐connection>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
host | no | no | localhost | String | Name or IP address of the server where the requests will be sent. |
port | no | no | 80 | Number | Server port number. |
max‐connections | no | no | 100 | Number | The maximum number of outbound connections that will be kept open at the same time. |
max‐connections‐per‐route | no | no | 10 | Number | The maximum number of outbound connections that will be kept open at the same time per host. |
connection‐idle‐timeout | no | no | 30000 | Number | The number of milliseconds that a connection can remain idle before it is closed. |
trust-all | no | no | false | Boolean | Set to true to disable trust check on the SSL endpoint. |
protocol | no | no | HTTP | Enumeration | Protocol to use for communication. One of: HTTP, HTTPS. When using HTTPS the HTTP communication is going to be secured using TLS/SSL. If HTTPS was configured as protocol then the user can customize the tls/ssl configuration by defining the tls:context child element. If no tls:context is defined then the default JVM certificates are going to be used to establish communication. |
connection‐ttl | no | no | Number | The number of milliseconds to close the connection in the pool. | |
socket‐properties | no | – | socket-properties | Socket configuration and properties. | |
enable‐cookies | no | no | true | Boolean | Enables cookie management. If true, cookies received in HTTP responses will be stored, and sent in subsequent HTTP requests. |
follow‐redirects | no | no | true | Boolean | Enables redirects. |
ignore‐connection‐errors | no | no | false | Boolean | If true, then it ignores exceptions in connections. If it is turned on and there is no connection to the remote system, then the log method will not send anything and there will only be message in the log that the record has not been sent. |
disabled | no | yes | false | Boolean | Disables logging. Connection to the target system is not required (from Logging Module version 1.3.2). |
proxy | no | – | proxy | Web proxy settings. | |
ntlm-proxy | no | – | ntlm-proxy | NTLM web proxy settings. | |
authentication | no | – | One of: basic-authentication, digest-authentication, ntlm-authentication |
Authentication configuration of the HTTP request. | |
reconnection | no | – | One of: reconnect, reconnect-forever |
The reconnection strategy to use. Find more about connectivity and strategies. |
6.3. Type socket-properties
<ilm:socket‐properties name="globalTcpSocketProps" keep‐alive="true" connection‐timeout="30000" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
send‐buffer‐size | no | no | Number | Buffer size (in bytes) when sending data. | |
receive‐buffer‐size | no | no | Number | Buffer size (in bytes) when receiving data. | |
client‐timeout | no | no | 0 | Number | It is used to configure SO_TIMEOUT. It is the time in milliseconds that the socket will wait for data before it fails. A value of 0 (the default) means waiting indefinitely. |
reuse‐address | no | no | true | Boolean | It is used to configure SO_REUSEADDRESS. |
connection‐timeout | no | yes | 30000 | Number | Time in milliseconds of waiting for a successful connection to the target before it fails. |
send‐tcp‐no‐delay | no | yes | true | Boolean | Indicates whether the transmitted data should not be collected together for greater efficiency and sent immediately. |
linger | no | yes | Number | It is used to set SO_LINGER in milliseconds. Time in milliseconds to wait for the socket to close. | |
keep‐alive | no | yes | false | Boolean | It is used to set SO_KEEPALIVE. |
6.4. SSL context
The connector uses a standard Mule TLS configuration. It can be defined as a top level element or as an element inside a connection element.
<tls:context name="sslSecurityContext">
<tls:trust‐store path="trustStore‐localhost.jks" password="changeit" />
</tls:context>
6.5. Type http-header
<ilm:http‐header key="Content‐Type" value="#[attributes.headers['Content‐Type']]" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
key | yes | no | String | Key of HTTP header. | |
value | no | yes | String | Value of HTTP header. |
6.6. Type query-param
<ilm:query‐param key="param1" value="#['param1 value']"/>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
key | yes | yes | String | Parameter name (unescaped). | |
value | yes | yes | String | Parameter value (unescaped). |
6.7. Type proxy
<ilm:proxy name="globalHttpProxy" host="localhost" port="8888" username="test" password="password" non‐proxy‐hosts="example.com,localhost" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
host | yes | yes | String | Host where the proxy requests will be sent. | |
port | no | yes | -1 | Number | Port where the proxy requests will be sent. |
username | no | yes | String | The username to authenticate against the proxy. | |
password | no | yes | String | The password to authenticate against the proxy. | |
non‐proxy‐hosts | no | yes | String | A list of comma separated hosts against which the proxy should not be used. |
6.8. Type ntlm-proxy
<ilm:ntlm‐proxy name="viaNtlmProxy" host="localhost" port="8888" ntlm-domain="domain.example.com" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
host | yes | yes | String | Host where the proxy requests will be sent. | |
port | no | yes | -1 | Number | Port where the proxy requests will be sent. |
username | no | yes | String | The username to authenticate against the proxy. | |
password | no | yes | String | The password to authenticate against the proxy. | |
non‐proxy‐hosts | no | yes | String | A list of comma separated hosts against which the proxy should not be used. | |
ntlm-domain | yes | yes | String | The domain to authenticate against the proxy. |
7.1. Logging configuration
<ilm:file‐logging‐config name="testLoggingCfg" template‐file="logging‐message.template" fail‐on‐missing‐properties="false" ignore‐exceptions="false">
<ilm:file‐connection path="/tmp" filename="test‐file‐logging.log" ignore‐connection‐errors="false">
<ilm:file‐writer>
<ilm:char‐writer append‐eol="true" charset="UTF‐8" />
</ilm:file‐writer>
<ilm:rolling‐policy>
<ilm:size‐based filename‐pattern="test‐file‐logging‐%i.log"/>
</ilm:rolling‐policy>
</ilm:file‐connection>
</ilm:file‐logging‐config>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
name | yes | no | String | Configuration name used for configuration reference. | |
template‐file | yes | no | String | The name of the file in the classpath with the template for the log. | |
application‐key | no | no | String | Application key. | |
application‐name | no | yes | #[app.name] | String | Application name. Default is the name of the application obtained from the Mule runtime. |
fail‐on‐missing‐properties | no | yes | true | Boolean | It is used to configure whether it has to throw exceptions in case placeholder evaluation fails. |
replace‐if‐missing‐with | no | yes | null | String | If fail‐on‐missing‐properties is set to false, this value will be stored instead of the placeholder whose evaluation failed. |
ignore‐exceptions | no | yes | true | Boolean | If set to true, then exceptions during logging will be ignored (only logged to the log). |
escape‐values | no | no | true | Boolean | Enables or disables character escaping in the log message. |
escaper‐class | no | no | String | Name of Java class for escaping. |
As a useful escaper-class can be used build-in CVS escaper based on cz.integsoft.mule.ilm.internal.component.CSVValueEscaper class.
7.2. Connector configuration
<ilm:file‐connection path="/tmp" filename="test‐file‐logging.log" ignore‐connection‐errors="false">
<ilm:file‐writer>
<ilm:char‐writer append‐eol="true" charset="UTF‐8" />
</ilm:file‐writer>
<ilm:rolling‐policy>
<ilm:size‐based filename‐pattern="test‐file‐logging‐%i.log"/>
</ilm:rolling‐policy>
</ilm:file‐connection>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
path | no | yes | . | String | The directory for logging. Default value is ., i.e., the current directory. Supports expressions e.g. #[server.tmpDir] |
filename | yes | no | String | File name for logging. | |
ignore‐connection‐errors | no | no | false | Boolean | It is used to configure whether to ignore errors when opening the file. This may result in not connected resource. |
disabled | no | yes | false | Boolean | Enables or disables logging. Even a connection to the target system is not required (from Logging Module version 1.3.2). |
file-writer | no | – | One of: char‐writer |
Optional file writer factory. Default is char‐writer for writing text files. | |
rolling-policy | no | – | One of: size-based |
Optional rolling policy. | |
reconnection | no | – | One of: reconnect, reconnect-forever |
The reconnection strategy to use. Find more about connectivity and strategies. |
7.3. Type char‐writer
<ilm:char‐writer append‐eol="true" charset="UTF‐8" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
append‐eol | no | no | true | Boolean | If the log record should be separated by EOL (line terminator). |
charset | no | no | UTF-8 | String | Defines the character set for file writing. |
7.4. Rolling policy size-based
<ilm:size‐based filename‐pattern="test‐file‐logging‐%i.log" max‐backup‐count=“10“ max‐file‐size=“10000“/>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
filename‐pattern | yes | no | String | Backup filename pattern. %i will be replaced with the index count and it is mandatory to be in the pattern (only one is allowed). | |
max‐backup‐count | no | no | Number | Maximum count of rotated backup files. Default is not set, which means infinite count. | |
max‐file‐size | no | no | 10485760 | Number | Maximum file size in bytes. Important is that the log will not split the log message, in other words the log message will remain complete in one file. Default is 10485760 (10MB). |
7.5. CSV escaper
File connector allows CSV creation. To do this, it is needed to add a special class cz.integsoft.mule.ilm.internal.component.CSVValueEscaper to the escaper‐class configuration of file‐logging‐config and turn on escaping values with the escape‐values switch to true.
8. Authentication
Allows sending authentication data in an HTTP request.
<ilm:http‐connection host="${https.host}" port="${https.port}" protocol="HTTPS" max‐connections="4" max‐connections‐per‐route="4" connection‐idle‐timeout="30000"
ignore‐connection‐errors="true" socket‐properties="globalTcpSocketProps" enable‐cookies="false" tlsContext="sslSecurityContext" proxy‐config="globalHttpProxy">
<ilm:authentication>
<ilm:basic‐authentication username="${http.username}" password="${http.password}" preemptive="true" />
</ilm:authentication>
</ilm:http‐connection>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
authentication | yes | – | One of: basic-authentication, digest-authentication, ntlm-authentication |
Authentication configuration of the http request. |
8.1. Type basic-authentication
<ilm:basic‐authentication username="username" password="password" preemptive="true" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
username | yes | yes | String | The username to authenticate. | |
password | yes | yes | String | The password to authenticate. | |
preemptive | no | yes | true | Boolean | Configures if authentication should be preemptive or not. Preemptive authentication will send the authentication header in the first request, instead of waiting for a 401 response code to send it. |
8.2. Type digest-authentication
<ilm:digest‐authentication username="username" password="password" preemptive="true" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
username | yes | yes | String | The username to authenticate. | |
password | yes | yes | String | The password to authenticate. | |
preemptive | no | yes | true | Boolean | Configures if authentication should be preemptive or not. Preemptive authentication will send the authentication header in the first request, instead of waiting for a 401 response code to send it. |
8.3. Type ntlm-authentication
<ilm:ntlm‐authentication username="username" password="password" preemptive="true" workstation="workstation" domain="example.com" />
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
username | yes | yes | String | The username to authenticate. | |
password | yes | yes | String | The password to authenticate. | |
preemptive | no | yes | true | Boolean | Configures if authentication should be preemptive or not. Preemptive authentication will send the authentication header in the first request, instead of waiting for a 401 response code to send it. |
workstation | no | yes | String | The workstation to authenticate. | |
domain | no | yes | String | The domain to authenticate. |
9. Template
The template can be any text file. All placeholders must be evaluated as a string. There are two types of placeholders:
Mule expressions: ${#[XXX]}, where XXX is Mule expression, e.g., ${#[payload]} will replace payload in the template in the form of a string.
Keywords: ${XXX}, where XXX is the key word, e.g., ${duration} the processing time between mark‐start and mark‐end in the template.
The following Mule expressions will be replaced during the log method call:
Mule expression | Description |
---|---|
attributes | Access to Mule message attributes. |
payload | Access to payload Mule messages. |
dataType | Access to the payload data type. |
authentication | Access to the authentication object (if the user is authenticated). |
vars | Access to Mule message flow variables. |
message | Access to Mule message. |
error | Access to error (if any). |
The following keywords will be replaced during the log method call:
Mule expression | Description |
---|---|
duration | Duration in milliseconds. |
machineName | The name of the machine on which the application is running. |
correlationId | Correlation ID (Mule message ID). |
applicationKey | Application key. |
applicationName | Application name. |
muleVersion | Mule runtime version. |
muleNodeId | ID of Mule runtime. |
javaVersion | The version of Java on which the runtime runs. |
javaVendor | The vendor of Java on which the runtime runs. |
created | Date and time the log message was created. The default formatting is ISO. After the | (pipe) sign, it is possible to specify the format to which it is to be converted. |
threadName | The name of the thread that processes the flow. |
level | Logging level. |
loggerPoint | Log location. |
user | Username. |
logMessage | Log message. |
errorDescription | Description of the error, if any. |
rootErrorDescription | Description of the root exception error. |
errorType | Error type. |
id | ID of execution. |
customCorrelationId | Specific correlation ID. |
flowName | The name of the flow whether there is log operation. |
{
"Duration":"${duration}",
"MachineName":"${machineName}",
"CorrelationId":"${correlationId}",
"ApplicationKey":"${applicationKey}",
"ApplicationName":"${applicationName}",
"JavaVendor":"${javaVendor}",
"JavaVersion":"${javaVersion}",
"MuleVersion":"${muleVersion}",
"MuleNodeId":"${muleNodeId}",
"ThreadName":"${threadName}",
"Id":"${id}",
"Created":"${created|yyyy‐MM‐dd HH:mm:ss,SSS}",
"Authorization":"${#[attributes.headers['Authorization']]}",
"Payload":"${#[payload]}",
"DataType":"${#[dataType]}",
"Authentication":"${#[authentication]}",
"VarsTest":"${#[vars.test]}",
"Test":"Last message fixed in the template",
"ErrorType":"${errorType}",
"ErrorDescription":"${errorDescription}",
"RootErrorDescription":"${rootErrorDescription}",
"Level":"${level}",
"LoggerPoint":"${loggerPoint}",
"CustomCorrelationId":"${customCorrelationId}",
"LogMessage":"${logMessage}",
"FlowName":"${flowName}"
}
10. Connectivity
If there is a problem in connectivity to the remote system, it is possible to configure a retry strategy for reconnection or use the ignore‐connection‐errors flag on the connector. It is enough to add the following code to the body of the connector in XML, and the connection will be re-established in case of failure (it is advantageous for occasional outages of the remote system).
<reconnection failsDeployment="false">
<reconnect count="3" frequency="1000" />
</reconnection>
Attribute name | Required | Expressions | Default value | Type | Description |
---|---|---|---|---|---|
failsDeployment | no | yes | Boolean | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy. | |
reconnection | yes | – | One of: reconnect, reconnect-forever |
The reconnection strategy to use. |
11. Errors thrown by the module
Errors are caught using on‐error‐propagate in error‐handler element. For the list of module specific exceptions, see the table below.
<error‐handler name="globalErrorHandler">
<on‐error‐propagate type="ILM:TEMPLATE_PROCESSING">
<set‐variable value="#[error.errorMessage.attributes.statusCode]" variableName="httpStatus" />
<set‐payload value="#[error.errorMessage.payload]" mimeType="text/plain" />
</on‐error‐propagate>
<on‐error‐propagate type="ANY">
<set‐variable value="#[error.errorMessage.attributes.statusCode default 500]" variableName="httpStatus" />
<set‐payload value="#[error.errorMessage.attributes.reason]" mimeType="text/plain" />
</on‐error‐propagate>
</error‐handler>
Exception name | Description |
---|---|
NO_LICENSE | License error. |
MAX_CALLS_REACHED | Maximum number of calls allowed within the demo license has been exceeded. |
GENERIC_ERROR | Generic error. |
INITIALIZATION | Error during component initialization. |
PROCESSING | Error during processing. |
TEMPLATE_PROCESSING | Error during processing log message template. |
CONNECTIVITY | Error during connecting to message store. |
RETRY_EXHAUSTED | Error during reconnecting. |
12. Download
There are several download options available. Please use our official download page to get all Integration Eye™ modules.
13. License
To run the module you'll need a valid license (Demo, Start-up or Production). In case the license is lacking, the application with the given module will not start, and there will be a log message with corresponding information. Register to get a free Start-up license now!
Already have a license? Please visit our FAQ: how to install a license?