added logging
This commit is contained in:
@@ -10,11 +10,11 @@ Amounts and worked/vacation/sick statuses selected for dates are stored persiste
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
waitress-serve --host=0.0.0.0 --port=9009 fatima:app
|
||||
waitress-serve --host=0.0.0.0 --port=9009 flask_fatima:app
|
||||
```
|
||||
|
||||
To use a different port, substitute it in the command (for example,
|
||||
`--port=8080`). The application exposes its WSGI callable as `fatima:app`, so it
|
||||
`--port=8080`). The application exposes its WSGI callable as `flask_fatima:app`, so it
|
||||
can also be used by platforms that ask for an application entry point.
|
||||
|
||||
Set the username, password, and Flask signing key in `config.yaml` before starting. This file is excluded from Git. Use `config.example.yaml` as the documented template when setting up another machine.
|
||||
@@ -38,6 +38,7 @@ The app is served below `/fatima` by default. Configure the external path in
|
||||
```yaml
|
||||
flask:
|
||||
url_prefix: "/fatima"
|
||||
log_file: "/tmp/fatima.log"
|
||||
```
|
||||
|
||||
Set `URL_PREFIX` in the environment to override this value at deployment time.
|
||||
@@ -77,4 +78,14 @@ On the iPhone, visit `http://<your-computer-on-the-local-network>:9009/fatima/`.
|
||||
Waitress listens on all network interfaces with the command above. For anything
|
||||
exposed beyond a trusted home network, put it behind an HTTPS reverse proxy.
|
||||
|
||||
For deployments, `APP_CONFIG` can point to a YAML file elsewhere. `SECRET_KEY`, `APP_USERNAME`, and `APP_PASSWORD` environment variables optionally override the corresponding YAML values.
|
||||
For deployments, `APP_CONFIG` can point to a YAML file elsewhere. `SECRET_KEY`,
|
||||
`APP_USERNAME`, `APP_PASSWORD`, `DATABASE`, and `LOG_FILE` environment variables optionally
|
||||
override the corresponding values. `DATABASE` should be an absolute path to the
|
||||
SQLite file used in production.
|
||||
|
||||
At startup, the app prints a database summary to the Waitress log containing the
|
||||
resolved path, amount and status totals, distinct recorded-date total, and date
|
||||
range. Compare that path and those totals with the importer's output to confirm
|
||||
that both processes use the same database. The timestamped summary is also
|
||||
appended to the configured `flask.log_file` each time the app starts. It defaults
|
||||
to `/tmp/fatima.log` and can be overridden at deployment time with `LOG_FILE`.
|
||||
|
||||
Reference in New Issue
Block a user