Contents

FioranoMQ Client Logger uses SLF4J which serves as a simple facade or abstraction for various logging frameworks, such as java.util.logging, logback and log4j. Any logging implementation can be plugged in as per customer preference. For this to work, slf4j-api-<version>.jar along with the jars used by the chosen underlying logging framework (log4j, Logback, JUL, etc.) need to be placed in the classpath of the application. By default, slf4j-api-1.7.5.jar is shipped and the corresponding classpath is mentioned in the run-client.conf file under %FIORANO_HOME%\fmq\bin. To switch logging frameworks, just replace slf4j bindings on the class path. For example, to switch from java.util.logging to log4j, just replace slf4j-jdk14-<version>.jar with log4j-slf4j-impl-<version>.jar.

In order to use log4j framework, slf4j-api-<version>.jar along with log4j-slf4j-impl-<version>.jar and log4j2 jars need to be placed in the java classpath. Loggers can be configured using log4j2.properties. By default, the log4j2.properties file can be located under %FIORANO_HOME%\fmq\bin. However, the log4j2.properties can be placed anywhere proving the path under <java.classpath>.

If the log4j2.properties is in D:\Logger_properties\, then D:\Logger_properties\ should be mentioned in the classpath. <java.classpath> can be mentioned using " -cp " command in javac/java (or) can be given in the run-client.conf file present at %FIORANO_HOME%\fmq\bin.

Example

Parent-child relationship in FioranoMQ Client Logger:

FioranoClientLogger follows a naming hierarchy. The logger named "Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices" is the parent of the logger named "Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices.Admin". The inherited level for a given logger, for example, logger_name, is equal to the first non-null level in the logger hierarchy, starting at logger_name and proceeding upwards in the hierarchy towards the root logger. If the logger named "Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices.Admin" is not assigned any log level, then it will inherit its level from "Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices" (provided this logger has been assigned a level. Otherwise it will inherit from its parent logger and so on).

A logging request is said to be enabled if its level is higher than or equal to the level of its logger. Otherwise, the request is said to be disabled. The levels are as follows:

ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF.

Adaptavist ThemeBuilder EngineAtlassian Confluence