How to restrict the Elektron EMA API level logging in my Java class

Best Answer
-
As explained in the EMA Developers guide (6.1 - EMA Logger
Usage), EMA uses the SLF4J logging API. Thanks to SLF4J, you can have the
underlying logging back-end that you want. For example: The Java standard logger utility package
(java.util.logging), log4j, or other logger adapters which implement the SLF4J
logging interface.In your case, as you probably did not set any adapter, SLF4J
prints messages on the console. A quick and easy solution for you would be to use the JDK build-in logging utility by setting it on the
java command line. As an example: If you use the example100__MarketPrice__Streaming.bat file to run your application, you could add “-Djava.util.logging.config.file=.\logging.properties”
as a new parameter of the java command (last line of the .bat file) and provide “logging.properties” configuration file (see below) along with your application.Here is an example of the java command with all parameters:
%JAVA_BIN% -Djava.util.logging.config.file=.\logging.properties
-cp %CLASSPATH% com.thomsonreuters.ema.examples.training.consumer.series100.example100__MarketPrice__Streaming.ConsumerHere is an example of logging.properties file with console and file logs deactivated:
#This file contains log configuration for java logging API.
# Level mapping between jdk and slf4j logging
# jdk.util.logging SLF4J
# FINEST -> ALL
# FINEST -> DEBUG
# FINEST -> TRACE
# INFO -> INFO
# WARNING -> WARN
# SEVERE -> ERROR
.level=ALL
#handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
#handlers=java.util.logging.FileHandler
java.util.logging.ConsoleHandler.level=WARNING
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level=WARNING
java.util.logging.FileHandler.pattern=./emaj.log
java.util.logging.FileHandler.limit=50000000
java.util.logging.FileHandler.count=20
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
# Format timestamp as date/time with millisecond
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s %2$s %n%5$s0
Answers
-
Can you please expand on your requirement - so that we can provide the most relevant answer? It is not currently entirely clear what exactly you want to achieve.
0 -
Hi @umer.nalla,
We are developing our own application based on the example given in program
com.thomsonreuters.ema.examples.training.consumer.series100.example102__MarketPrice__Snapshot
consumer = EmaFactory.createOmmConsumer(config.host(host+":"+port).username(userId));
We are doing our custom logging, but when the above statement in italics and bold is encountered, EMA API level logging is being logged over the console as below
May 02, 2017 3:08:06 PM com.thomsonreuters.ema.access.ConfigErrorTracker log
INFO: loggerMsg
ClientName: EmaConfig
Severity: Info
Text: reading configuration file [EmaConfig.xml] from [C:\Users\cvishnu\workspace\prreu]
loggerMsgEnd
May 02, 2017 3:08:06 PM com.thomsonreuters.ema.access.ChannelCallbackClient reactorChannelEventCallback
INFO: loggerMsg
ClientName: ChannelCallbackClient
Severity: Info
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_1
Component Version ads3.0.6.L1.linux.tis.rrg 64-bit
loggerMsgEnd
We want to restrict this EMA API level logging, that is we don't want to get this logging appear.
Request you to please help us here
0 -
As mentioned in the EMA Java Dev Guide, it uses SLF4J logging API and therefore you could change the Logger level via a logging.properties file to WARNING or ERROR to avoid seeing INFO level outputs - or redirect the output a file instead.
There is a sample logging.properties file in the Ema\Src\main\resource folder which you could copy, amend and use for your application.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛