JMSLogAppender for the Delphi Logging Framework Log4D

For users of Log4D, Habarisoft offers a JMS log appender which can be used to send log messages to a Apache ActiveMQ, JBoss HornetQ or OpenMQ open source message broker.

Adding a JMS appender is easy and requires only some lines of configuration. To define a JMS log appender with the name Jms1, add these lines to a file:

# Create a JMS appender
log4d.appender.Jms1.layout.pattern= %p | %d %c - %m%n

And include the new appender on the root level:

# Set root level

Then in the Delphi application, configure the logging framework as usual.

// configure Log4D

In this example, the log messages will be sent to a JMS destination with the name ‘TOOL.DEFAULT’. This will make testing easier since this is the default destination name for the ConsumerTool demo application in the Habari JMS Client distribution. To receive the messages using ConsumerTool, start it with this command line:

>ConsumerTool --topic

The –topic parameter tells the tool that the destination is a JMS Topic (default is Queue).

A simple GUI demo application (included) listens for messages on this topic and displays incoming messages in a memo field, see screenshot below.

Note that the following units are required in the application:

  • BTCommAdapterIndy or BTCommAdapterSynapse to register the default communication adapter
  • Log4D

The log appender is free for users of Habari JMS Client libraries, including full source code.