Page 1 of 1

The applog file is not save in the correct directory

Posted: 12 Dec 2014, 18:07
by Jianjunmeng
Hello,
I modified the CursorTask and add some new lines in the source code and rebuild it. After that I found my applog file is not saved in the same directory as the data file. And it's in the parent directory above the data directory and is named as session001.applog. It's weird. How can I solve this problem? Thank you very much.
Best,
Steve

Re: The applog file is not save in the correct directory

Posted: 14 Dec 2014, 13:16
by Jianjunmeng
Are the applog file supposed to be in the same directory as the data file? I'm a little bit confused. Thanks.

Re: The applog file is not save in the correct directory

Posted: 08 Jan 2015, 12:14
by mellinger
Hi,

typically the application log file is supposed to be in the same directory as the data file.
However, there is a conceptual problem inherent in the definition of the application log file's location, because
1) data files are written by the source module,
2) the application module might run on a different machine, and connect to the remaining modules via a network.
The proper way to deal with this would be to have the application log file being written by the source module, and use the BCI2000 protocol to transfer log data from the application module to the source module.

However, application log files are not formally a part of the BCI2000 specification, so the application log is written directly to disk by the application module. In order for this to work in an acceptable way when source and application modules are located on different machines, the application module uses a location relative to its working directory at configuration time, chosen such that it coincides with the source module's data directory if both happen to execute on the same machine.

To avoid problems related to this fragile mechanism, make sure to start both the source module and the application module from the same working directory (e.g., from a common script without any 'cd' commands in between), and avoid to permanently change a module's working directory (i.e., change it back to original in case you must change it).

HTH,
Juergen