As mentioned in #92 PouchDB attempts to create a logfile on startup at /usr/src/app/log.txt, and if it is unable to do, the application crashes. This issue occurs when running the application containerised as a non-root user.
This PR adds an enviroment variable to set the location of the DB log file, so that it can be set to a location that allows the application to start when running non-root, which addresses the issue. By default this is set to /dev/null, as the log does not appear to collect any data in normal operation, and logging to file seems less aligned with the intent of using inMemoryConfig. However this can be easily overridden if needed (for debugging, or preference) using the environment variable. Other logs written to console are unaffected by this change.
As mentioned in #92 PouchDB attempts to create a logfile on startup at /usr/src/app/log.txt, and if it is unable to do, the application crashes. This issue occurs when running the application containerised as a non-root user.
This PR adds an enviroment variable to set the location of the DB log file, so that it can be set to a location that allows the application to start when running non-root, which addresses the issue. By default this is set to /dev/null, as the log does not appear to collect any data in normal operation, and logging to file seems less aligned with the intent of using inMemoryConfig. However this can be easily overridden if needed (for debugging, or preference) using the environment variable. Other logs written to console are unaffected by this change.