facebook / duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Other
4.06k stars 723 forks source link

Default log files are created even if different paths are provided via options #720

Open slabstone opened 1 year ago

slabstone commented 1 year ago

Default log dir and files log/access.log and log/error.log are created even if different paths are provided via --access-log and --error-log options, leading to permission concerns.

duckling: log/error.log: openFile: permission denied (Permission denied)

This relates to https://github.com/facebook/duckling/pull/377, where logfile creation was disabled in case of --no-access-log and --no-error-log.

Reproducable on 7520daaeba28691cda8e1b5c3d946028a28fb64b:

$ ls
duckling-example-exe

$ ./duckling-example-exe --access-log=./a.log --error-log=./e.log
no port specified, defaulting to port 8000
Listening on http://0.0.0.0:8000
^C
Shutting down..

$ ls -R
.:
a.log  duckling-example-exe  e.log  log

./log:
access.log  error.log

Here both default and user-provided files are created.