Can we have handle to EMA logger to log the Channel UP related event to a specific file as part of l
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
Best Answer
-
Hello @gaurav.mahajan
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
- slf4j-api-1.7.12.jar
- slf4j-jdk14-1.7.12.jar
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.- Replace this slf4j-jdk14-1.7.12.jar file with SLF4J-Log4j binding file
- Add Log4j required core library files to the Java classpath
- Configure configurations file to Java classpath or JVM option
The Log4j 2 framework requires the following libraries files in Java classpath to intergrate with EMA Java SLF4J framework:
- log4j-api-<version>.jar
- log4j-core-<version>.jar
- log4j-slf4j-impl-<version>.jar
- slf4j-api-<version>.jar
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.
0
Answers
-
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
"-Djava.util.logging.config.file=logging.properties"
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 = FINE4. 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
loggerMsgEndNot 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.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 368 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛