question

Upvotes
Accepted
7 3 2 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-sdkema-apirrtelektron-message-apilogging
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.

Monitored by @Warat B.

1 Answer

· Write an 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 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.