For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 2 5 5

if do not use the config file, how to stop the log file, emalog, by coding?

elektronrefinitiv-realtimeelektron-sdk
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.

I haven't used any config in my app, but I still have log files as emaLog_*. How can I put into my source codes to stop the log files?

Hi @kage.wu,

Please see my answer below. I'm recommending to use a config file only to to disable these log files. The answer also states that you can't put it into your source code.

Hello @kage.wu

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,


AHS


Upvotes
Accepted
78.8k 250 52 74

@kage.wu

You can programmatically create configurations. For example, please refer to the 421__MarketPrice__ProgrammaticConfig example.

To disable EMA log file, you need to set LoggerType to 1 (LoggerType::StdoutEnum) and LoggerSeverity to 4 (Severity::NoLogMsgEnum).

    innerMap.addKeyAscii( "Logger_1", MapEntry::AddEnum,
        ElementList()
        .addEnum( "LoggerType", 1 )
        .addAscii( "FileName", "logFile" )
        .addEnum( "LoggerSeverity", 4 ).complete() ).complete();

However, the configurations can't be changed after they are used to create an OMMConsumer.

OmmConsumer consumer( OmmConsumerConfig().config( configMap ) );    
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.

Upvotes
17.2k 82 39 63

Hi @kage.wu,

The recommended way to do this is by using an EMA Configuration file. Please see this question for more details.

I don't believe there is a way to do this entirely within code. Please refer to a similar question you asked on another thread. .

thanks.

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.

that's ridiculous. so how to use the config file in the coding? can you provide to me? it will save me time

Hi @kage.wu,

EMA doesn't provide the ability to override all configuration with source code unfortunately which is why you will need to define an EMAConfig.xml file for your application. You don't have to code this in, but instead define the file, configure it and EMA will recognize it. Refer to the documentation for details.

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.