- 6 minutes to read

Configuring the Nodinite Mule ESB Log Agent

This guide will teach you how to configure the Nodinite Mule ESB Logging Agent to transfer content from log4j files to Nodinite.

You can change the run-time behaviour of the Log Agent by editing the Settings.json. This file is in the installation folder. First, open the file using an elevated Notepad instance. Even better, use Notepad++.

General

The general section stores global information that affects some internal behaviour.

Property Description Value Example Comment
Environment The name for the type of environment this agent is running in Test, Prod, QA
Debug A flag that determines the amount of diagnostics information to write true or false (default) In a production environment, this value is normally set to false
Version The internal version number for the configuration file 1.2.3.4 READ ONLY, this is internal information, do NOT change this value manually!!!
CultureInfo format the output of date and so on SV-SE, EN-us Currently not implemented/honoured.

Folders

The Folders section is where you manage file folders. These can either be local folders or SMB enabled file shares.

Folders is an array of a Folder object. Each Folder points to one root (file folder or SMB share) where the Log Agent should look for log files with JSON Log Events.

Property Description Value Example Comment
Folder The Folder where to look for log files for a network share, this means \\server\share will be \\\\server\\share in the JSON configuration file Use \\ to escape \ in the JSON notation.
Filter A file filter to only look for file matching pattern. *.log or *.json, ... Can contain a combination of valid literal path and wildcard (* and ?)
IncludeChildFolders A flag used to search for JSON Log Event in subfolders true or false
ExcludeChildFolders An array of child folders to exclude if IncludeChildFolders is set to true Note: The full path must be provided, not only the name of the subfolder
Log Review the shared Log section for additional information

Environments

Environments, is a collection of one or more Cloudhub environments.

Property Description Value Example Comment
EnvironmentName The name of the Cloudhub environment Prod/Test/QA
EnvironmentId The Id of the Cloudhub 1A395ED7-5CC5-4B4A-9A09-87A19803567A A Guid
Username The user name to used connecting with the Cloudhub environment user
Password The password for the user password
Log Review the shared Log section for additional information

Log

Property Description Value Example Comment
Enabled A flag used to disable or enable logging true or false You don't have to remove the whole folder object to temporarily disable the Log Agent
LogAPI The address to the Nodinite Log API https://localhost/Nodinite/LogAPI/ Change the URI according to your Nodinite installation
LogAgentId Your user-defined identity of the Log Agent 42 Know where your events stem from
PollingInterval Polling interval in seconds 30 How often the agent should check the folder for new logs
ReplaceRules Review the shared ReplaceRules section for additional information

Replace Rules

This is a shared section for many of the configuration options above ReplaceRules is an array, of Rules to update provided Endpoints with a new Name or Uri if they are dynamic with for example id:s

Property Description Value Example Comment
Name The name of the rule to know what they are for
ReplaceName A flag to indicate whether to fix the End Point Name true (default) or false
ReplaceUri A flag to indicate whether to fix the End Point Uri true (default) or false
Pattern A RegEx pattern to match the value to replace note! only value in the first group will be replaced /([0-9]{4,})$ Find numbers
Group1Value The new value to write instead of the match {customerId} Replace matching values with {customerId}

Example The original URI was logged as: (actual id differs on most unique calls)

https://www.nodinite.com/int042/getCustomer/12345

With the provided example configuration, the logged URI get the following result:

https://www.nodinite.com/int042/getCustomer/{CustomerId}

If you did not configure ReplaceRules before deploying your solution, you may end up with an awful lot of Endpoints, contact our support to get help tidying up.


{
  "Environment": "Test",
  "Debug": true,
  "Version": "1.2",
  "CultureInfo": "sv-SE",
  "Folders": [
    {
      "Folder": "C:\\Mule\\logs\\IMLog",
      "IncludeChildFolders": false,
      "Filter": "*.log",
      "ExcludeChildFolders": [
        {
          "Name": "C:\\Temp\\MuleLogs\\IMLog\\NotMe"
        }
      ],
      "Log": {
        "Enabled": true,
        "PollingInterval": 60,
        "LogAPI": "http://localhost/Nodinite/LogAPI/",        
        "LogAgentId": 42,
        "ReplaceRules": [
          {
            "Name": "Fix End Point real customer id to {customerId}",
            "ReplaceName": true,
            "ReplaceUri": true,
            "Pattern": "/([0-9]{4,})$",
            "Group1Value": "{customerId}"
          }
        ]
      }
    }
  ],
  "Environments": [
    {
      "EnvironmentName": "Test",
      "EnvironmentId": "1A395ED7-5CC5-4B4A-9A09-87A19803567A",
      "UserName": "user",
      "Password": "password",
      "Log": {
        "Enabled": true,
        "PollingInterval": 60,
        "LogAPI": "http://localhost/Nodinite/LogAPI/",
        "LogAgentId": 43,
        "ReplaceRules": [
          {
            "Name": "Fix End Point real id to {id}",
            "ReplaceName": true,
            "ReplaceUri": true,
            "Pattern": "/([R0-9]{4,})$",
            "Group1Value": "{id}"
          }
        ]
      }
    }
  ]
}

** Example for versions before 4.3.0.5

{
  "Environment": "Test",
  "Debug": true,
  "Version": "1.1",
  "CultureInfo": "sv-SE",
  "Folders": [
    {
      "Folder": "C:\\Mule\\logs\\IMLog",
      "IncludeChildFolders": false,
      "Filter": "*.log",
      "ExcludeChildFolders": [
        {
          "Name": "C:\\Temp\\MuleLogs\\IMLog\\NotMe"
        }
      ],
      "Log": {
        "Enabled": true,
        "PollingInterval": 60,
        "LogAgentId": 42
      }
    }
  ],
  "Environments": [
    {
      "EnvironmentName": "Test",
      "EnvironmentId": "1A395ED7-5CC5-4B4A-9A09-87A19803567A",
      "UserName": "user",
      "Password": "password",
      "Log": {
        "Enabled": true,
        "PollingInterval": 60,
        "LogAgentId": 43
      }
    }
  ]
}

Next Step

Install Mule Log Agent
Logging Service