Commit e9011a19 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Minor corrections and add a migration section.

parent 476cb9f9
# JoramMQ Logging configuration
# Joram Logging configuration
JoramMQ logging is based on Java Logging APIs, contained in the package java.util.logging. Basically, Java Logging includes
Joram logging is based on Java Logging APIs, contained in the package java.util.logging. Basically, Java Logging includes
support for delivering plain text or XML-formatted log records to memory, output streams, consoles, files, and sockets. In
addition, the logging APIs are capable of interacting with logging services that already exist on the host operating system.
This document describes the essential configuration functions when using JoramMQ. For advanced usage you are advised
This document describes the essential configuration functions when using Joram. For advanced usage you are advised
to refer to the Java documentation.
## Introduction
By default, configuration of JoramMQ logging is done using the "conf/log.properties" properties file. A standard version of
this file is provided with the JoramMQ shipping.
By default, configuration of Joram logging is done using the "conf/log.properties" properties file. A standard version of
this file is provided with the Joram shipping.
The configuration is described by several properties. The main concepts defined are:
- Levels: Each message has a severity level. The level gives an indication of the importance and urgency of the message.
......@@ -29,7 +29,7 @@ Traditionally Java Logging defines seven standard log levels, ranging from FINES
to SEVERE (the highest priority, with the highest value). In order of priority: SEVERE, WARNING, INFO, CONFIG, FINE, FINER and
FINEST. Additionally, level OFF Turns off logging, and level ALL enables logging of all messages.
JoramMQ defines and uses 5 different levels:
Joram defines and uses 5 different levels:
- FATAL: It characterizes a very high error message.
These messages are rare and reflect a serious malfunction of the application, the outcome of which is normally a shutdown.
- ERROR: It characterizes an error message.
......@@ -114,7 +114,7 @@ Java also includes two standard Formatter classes:
- SimpleFormatter: Writes brief "human-readable" summaries of log records.
- XMLFormatter: Writes detailed XML-structured information.
JoramMQ offers an extended formatter with the class "org.objectweb.util.monolog.api.LogFormatter".
Joram offers an extended formatter with the class "org.objectweb.util.monolog.api.LogFormatter".
#### SimpleFormatter
......@@ -162,7 +162,7 @@ The parameters are:
- 13 - a string representing the throwable associated with the log record and its stacktrace beginning
with a newline character, if any; otherwise, an empty string.
For example, we detail below the 'short' and 'long' formats used in the default JoramMQ configuration.
For example, we detail below the 'short' and 'long' formats used in the default Joram configuration.
The short format (`%1$s %7$s %8$s: %10$s%n`) writes the time of event, the source logger, the level
and the message, for example:
......@@ -190,17 +190,17 @@ The logging configuration can be debugged by setting the "org.objectweb.util.mon
## Default configuration
In this section we explained the content of the JoramMQ default configuration.
In this section we explained the content of the Joram default configuration.
There are 2 parts in this configuration, the first is dedicated to handlers, the second to loggers.
### Handlers configuration
In the first part below, we declare two handlers, a ConsoleHandler and a FileHandler,and we configure them
- ConsoleHandler:
- It uses the specific JoramMQ formatter classes with a short message format.
- It uses the specific Joram formatter classes with a short message format.
- Only messages with a priority greater than or equal to WARN are printed.
- FileHandler:
- It uses the specific JoramMQ formatter classes with a long message format.
- It uses the specific Joram formatter classes with a long message format.
- All messages are printed.
- Messages are written to a rotating set of 10 files of 10Mb.
......@@ -211,16 +211,15 @@ This part is divided in 6 sections:
they do not define a specific level. If there is no other logger definition, only messages with a priority higher to
WARN would be written.
- The four next sections define loggers of different components:
- 'fr.dyade.aaa' subtree concerns the base runtime of JoramMQ.
- 'fr.dyade.aaa' subtree concerns the base runtime of Joram.
- 'fr.dyade.aaa.jndi2' subtree concerns the JNDI implementation.
- 'org.objectweb.joram' subtree concerns the JMS implementation.
- 'com.scalagent' subtree concerns the JoramMQ MQTT implementation.
- The last section defines loggers of third party software embedded with JoramMQ.
- The last section defines loggers of third party software embedded with Joram.
By default, all loggers are configured with the WARN level. Many other loggers are commented out to allow detailed logging
of some JoramMQ components.
of some Joram components.
### "conf/logging.properties" file
### Default configuration file
~~~~
# (C) 2021 - 2022 ScalAgent Distributed Technologies
......@@ -291,32 +290,6 @@ org.ow2.joram.level = WARN
# 'TcpConnectionListener.acceptConnection : -> bad clock synchronization between client and server'
org.objectweb.joram.mom.proxies.tcp.TcpConnectionListener.level = ERROR
#==================================================
# JORAMMQ
com.scalagent.level = WARN
#com.scalagent.txlog.level = DEBUG
#com.scalagent.batchengine.level = DEBUG
#com.scalagent.batchnetwork.level = DEBUG
#com.scalagent.jorammq.mqtt.adapter.level = DEBUG
# Allows to trace in and out MQTT frames.
#com.scalagent.jorammq.mqtt.adapter.MqttConnection.dump.level = INFO
#com.scalagent.jorammq.mqtt.accesscontrol.level = DEBUG
#com.scalagent.jorammq.mom.tcp.level = DEBUG
# Loggers allowing to control Jetty logging (WARN by default, or FINEST)
#org.eclipse.jetty.level = DEBUG
#org.eclipse.jetty.websocket.level = DEBUG
com.scalagent.tracker.level = ERROR
#com.scalagent.tracker.MqttAgent.level = WARN
#com.scalagent.tracker.MqttBridge.level = WARN
#com.scalagent.tracker.MqttTopic.level = WARN
#com.scalagent.tracker.JoramMqttSession.level = WARN
#com.scalagent.tracker.MqttConnection.level = WARN
#com.scalagent.tracker.exitOnBadOrder.level = DEBUG
#==================================================
# Third-party software
org.apache.sshd.level = WARN
......@@ -324,3 +297,23 @@ org.eclipse.jetty.level = WARN
org.glassfish.jersey.level = WARN
~~~~
# Joram Logging migration
Until version 5.18 Joram's logging was based on the OW2/Monolog wrapper. This wrapper offered a common interface
to the different logging APIs: Log4J, JUL (Java Util Logging), etc. It also allowed a universal configuration
regardless of the layout used.
The OW2/Monolog project being now poorly supported, it was decided to replace it in version 5.19 of Joram. The
choice fell on the logging component integrated into Java: JUL (Java Util Logging).
The choice of logging component normally has little impact on the Joram user, the main concern is its configuration.
In this document we will detail these changes. A logging configuration file can be divided in 2 parts:
- The first part dedicated to handlers is strongly impacted by the implementation change. We recommend that you
rebuild it following the instructions above (or go back to the default configuration).
- The second part dedicated to loggers has very few changes, there are essentially two:
- The "logger" prefix must be removed from logger names.
- You must add the symbol '=' between the name of the logger and the desired logging level.
- for example, "logger.fr.dyade.aaa.agent.Agent.level DEBUG" becomes "fr.dyade.aaa.agent.Agent.level = DEBUG"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment