elixir-europe / biovalidator

JSON validator derived from AJV supporting ontology and taxonomy validation.
Apache License 2.0
19 stars 6 forks source link

[Bug] logDir argument does not work as intended #42

Closed M-casado closed 1 year ago

M-casado commented 2 years ago

Summary

Argument logDir does not work, and in the documentation (README) it sometimes appears as LogPath.

Technical details

Expected behaviour

At deployment, given the directory in which I want my logs to be saved (--logDir=path/to/logs/), the tool would save the logs of the running instance in that directory.

Observed behaviour

At deployment, given the directory in which I want my logs to be saved, the tool does not save the logs in the given location, but instead saves them at the current directory in which the tool was deployed.

To reproduce

  1. Deploy the tool using logDir argument: node src/biovalidator.js --logDir="path/to/logs/". Tried it with different path formats: relative, absolute, with and without the final slash (/)...
  2. Check for the logs in the given filepath.
  3. Observe log created in the current location, instead of the given filepath.
theisuru commented 2 years ago

Thanks for pointing this problem @M-casado. I am having bit of a difficulty implementing this in an optimum way. I have added environment variable to change the log directory. Also updated the readme file to reflect this. Now, by default, logs will be stored in ./logs directory. You can change this behaviour by providing the environment variable BIOVALIDATOR_LOG_DIR. Eg. export BIOVALIDATOR_LOG_DIR=./new_log_dir Let me know if you have any problem with this configuration.

M-casado commented 2 years ago

I'm fine with the configuration, as long as the README is updated, since that's the source of information I'll follow in the end. I'm not particularly a fan of environmental variables being taken instead of given as arguments. But I think as long as it's clear how to do it, we can change the logDir, which is the final aim after all.

theisuru commented 1 year ago

now --logDir argument is also working eg. node src/biovalidator --logDir=/log/directory/path