question

Upvotes
Accepted
7 1 1 3

Can we create a log file only when the error occurred?

In the file of EmaConfig.xml,I set the LoggerSeverity.
<LoggerSeverity value="LoggerSeverity::Error"/>

↓↓
<LoggerGroup>
<LoggerList>
<Logger>
<Name value="Logger_2"/>
<LoggerType value="LoggerType::File"/>
<!-- FileName is optional: defaulted to "emaLog_<process id>.log" -->
<FileName value="C:\MRM\RTR\aplsys\bin\testLog"/>
<LoggerSeverity value="LoggerSeverity::Error"/>
</Logger>
</LoggerList>
</LoggerGroup>

Now,empty file is created if the error does not occur.
Can we create a log file only when the error occurred?
(In other words,If no error occurs, the log file is not created.)

*****************************************************************************
EmaConfig.xmlにて、emaログの設定をしています。
LoggerSeverityをErrorにした場合、エラーが発生していないときには、空のログファイルが作成されます。
これを、エラーが発生したときにだけログファイルを作成するようにして、
それ以外の場合はログファイルを作成しないように設定できますでしょうか。

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apilogging
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.

1 Answer

Upvotes
Accepted
7.6k 15 6 9

@hiroyuki.endo

Based on the EMA codes on GitHub, I think the logger configuration does not support your requirement. It looks like EMA internal just check if loggerType is FileEnum or stdout and if it's FileEnum it will open Log file and does not check for log serverity. So empty file is created if the error does not occur.

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.

Click below to post an Idea Post Idea