question

Upvotes
Accepted
1.2k 23 31 44

ChannelDictionary warning on shutdown in EMAJ

Using the example shutdown sequence of just calling consumer.uninitialize(); the following warning messages are emitted. How do I disable them?

2016-05-09 16:53:29,464 WARN  [main] OmmConsumerImpl(DictionaryCallbackClient.java:1142): loggerMsg
    ClientName: ChannelDictionary
    Severity: Warning
    Text:    RDMDictionary stream was closed with status message
	streamId 3
	Reason State: Closed/Suspect/None - text: "channel down."
loggerMsgEnd

2016-05-09 16:53:29,465 WARN  [main] OmmConsumerImpl(DictionaryCallbackClient.java:1142): loggerMsg
    ClientName: ChannelDictionary
    Severity: Warning
    Text:    RDMDictionary stream was closed with status message
	streamId 4
	Reason State: Closed/Suspect/None - text: "channel down."
loggerMsgEnd
elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apijava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
76.7k 238 52 72

Refer to EMA Java Developers Guide, the EMA Java uses the SLF4J logging API, in which you can have the underlying logging backend be the Java standard logg utility package (java.util.logging), log4j, or other logger adapters which implement the SLF4J logging interface.

I found one method that can be used to configure the logging.

1. Create a logging.properties file in the working directory. Its content is:

#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.ConsoleHandler
java.util.logging.ConsoleHandler.level=SEVERE
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
#java.util.logging.FileHandler.level=ALL
#java.util.logging.FileHandler.pattern=emaj.log
# Write 100000 bytes before rotating this file
#java.util.logging.FileHandler.limit=50000000
# Number of rotating files to be used
#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$s

2. Set VM arguments to use this file: -Djava.util.logging.config.file=logging.properties

3. I have set ConsoleHandler.level to SEVERE so it will not log the WARNING logs

Otherwise, you can use FileHandler instead of ConsoleHandler to log messages to files instead.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.