question

Upvotes
Accepted
1 0 0 1

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 5.0 MiB each and 10.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.

Upvotes
Accepted
38.1k 71 35 53

@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 5.0 MiB each and 10.0 MiB total.

Upvotes
9.7k 49 38 60

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 5.0 MiB each and 10.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.

Click below to post an Idea Post Idea