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. So any logging implementation can be plugged in as per customer's preference. For this to work, slf4j-api-<version>.jar along with the jars used by the chosen underlying logging framework (log4j, Logback, JUL, etc) needs to be placed in the application's classpath. By default, slf4j-api-1.7.5.jar is shipped and its classpath is mentioned in run-client.conf under %FIORANO_HOME%\fmq\bin. To switch logging frameworks, just replace slf4j bindings on your class path. For example, to switch from java.util.logging to log4j, just replace slf4j-jdk14-1.7.5.jar with slf4j-log4j12-1.7.5.jar.

In order to use log4j framework, slf4j-api-<version>.jar along with slf4j-log4j12-<version>.jar and log4j.jar need to be placed in the java classpath. Loggers can be configured using log4j.properties. By default, the log4j.properties file can be located under %FIORANO_HOME%\fmq\bin.However, the log4j.properties can be placed anywhere and the path should be given under <java.classpath>. If the log4j.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 run-client.conf present under %FIORANO_HOME%\fmq\bin.

Examples:

  1. javac -cp D:\Logger_properties\ app_name.java
  2. java -cp D:\Logger_properties\ app_name

Parent-child relationship in FioranoMQ Client Logger:

FioranoClientLogger follows a naming hierarchy. The logger named "log4j.logger.Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices" is the parent of the logger named log4j.logger.Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices.Admin". The inherited level for a given logger say 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 logger named "log4j.logger.Fiorano.FMQ.Services.ClientRootLoggerServices.FMQClientLoggerServices.Admin" is not assigned any log level, then it will inherit its level from "log4j.logger.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.

Icon

For more information on Appender, MaxFileSize, MaxBackupIndex, Append, Levels and layout, please refer to the Logger Configuration section. 

Adaptavist ThemeBuilder EngineAtlassian Confluence