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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
36 7 10 23

Specifying EmaConfig.xml when running EMA Consumer application using start-stop-deamon

There are two issues that I am facing :

1 . Though the EmaConfig.xml in the directory specifies log type as stdout , the application prompts that file could not be opened .

Exception Type='OmmInaccessibleLogFileException', Text='Failed to open emaLog_13892.log file for writing log messages.'

2 . In case the log type is file , what is the location in which the file will be created , or can we specify the file log path

elektronrefinitiv-realtimeelektron-sdkconfigurationlogging
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

Upvotes
Accepted
7.6k 15 6 9

@yajnasteju

#1 what you mean is your application print the Logger message to console and it also try to open a new file to write a logger messages at the same time? If there are some typo in LoggerType such as using LoggerType::Stout instead of LoggerType::Stdout, it looks like EMA will write logger messages to the file by default. And if the application does not have permission to write file in running directory it will throw the exception. Not sure if this is the case or not.

#2 if your application installed as daemon for example, using windows services. It will run from a different context than normal user-mode applications, it's best if you don't make any assumptions about working directories or relative paths and the permission. As far as I understand default running directory for the service should be system folder such as c:\windows\system32. Using an absolute path to the file that your service needs should avoid this problem entirely.

For EMA, I can't find configuration to specify log location/folder but you can set absolute path to Log file name as below

<LoggerType value="LoggerType::File"/> 
<FileName value="c:\myapp\Logs\emaLog"/> 

Don't forget to create folder "c:\myapp\Logs" before start the service or daemon.

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.