Currently we see that these logging events are not logged to the designated file. Is there a way we can get handle in EMA for these events to log where we want to as part of our log4j configuration.?
Also can we override this functionality to rephrase this message ?
7:56:49.643 [INFO] main - OmmConsumerImpl - loggerMsg ClientName: ChannelCallbackClient Severity: Info Text: Received ChannelUp event on channel Channel_1
Please be informed that the EMA Java API uses the Simple Logging Facade for Java (SLF4J) API as a facade for logging utility, so you can integrate the EMA Java application with Log4j. Even though the EMA Java API binds the logging mechanism with Java Logging API by default, developers can change the binding library and logging configuration files to bind the EMA Java application with Log4j or others framework that supported SLF4J without modify the application source code.
The EMA Java package contains two SLF4J library files
The slf4j-api-1.7.12.jar file is the core SLF4J library file. The slf4j-jdk14-1.7.12.jar is a binding library file for Java Logging API. Developers can perform the following steps to integrate the EMA Java application log with Log4j framework.
The Log4j 2 framework requires the following libraries files in Java classpath to intergrate with EMA Java SLF4J framework:
Then you can configure Log4j 2 configurations file to Java classpath or JVM option "-Dlog4j.configurationFile" at runtime to let the EMA Java application uses Log4j 2 configurations file.
Yes, from the developer guide:
"The EMA uses the SLF4J logging API, in which you can have the underlying logging backend be the Java standard logger utility package (java.util.logging), log4j, or other logger adapters which implement the SLF4J logging interface. "
The steps are:
1. As command line arguments we pass
2. Create a file "logging.properties" and put it into the same folder with the app
3. The sample contents of logging.properties to log into EMAExample.log file are:
# Specify the handlers to create in the root logger # (all loggers are children of the root logger) # The following creates two handlers handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler # Set the default logging level for the root logger .level = FINE # Set the default logging level for new ConsoleHandler instances java.util.logging.ConsoleHandler.level = FINE # Set the default logging level for new FileHandler instances java.util.logging.FileHandler.level = FINE java.util.logging.FileHandler.count = 7 java.util.logging.FileHandler.pattern = ./EMAExample.log.%g java.util.logging.FileHandler.formatter= java.util.logging.SimpleFormatter # Set the default formatter for new ConsoleHandler instances java.util.logging.ConsoleHandler.level = ALL java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Set the default logging level for the logger named com.mycompany # works if lower then ConsoleHandler.level, if higher- is ignored com.tr.match.Configurator.level = FINE
4. In the log we should see (we created Consumer_1 on Channel_1):
INFO: loggerMsg ClientName: ChannelCallbackClient Severity: Info Text: Received ChannelUp event on channel Channel_1 Instance Name Consumer_1_1 Component Version ads3.2.0.L1.linux.tis.rrg 64-bit loggerMsgEnd
Not to my knowledge, I think we would prefer the library info reported consistently across different applications, to know what to look for. One can add, from the application code, any required custom logging.
Can we have a batch request with EMA JAVA API (Version 220.127.116.11)? Also, Would be good to know how EMA handles batch internally and return response? Will it be a callback per RIC or single callback for whole batch.