From e6f21ae1b11f02f720ce21a29e6d1c97c6ae7b76 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 25 Nov 2021 10:17:17 +0100 Subject: [PATCH 1/2] added logging documentation Signed-off-by: Christian --- Logging.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Logging.md diff --git a/Logging.md b/Logging.md new file mode 100644 index 0000000000..9c3162ac84 --- /dev/null +++ b/Logging.md @@ -0,0 +1,52 @@ +# Logging docs + +Acapy supports multiple configurations of logging. + +## Log level + +Acapy's logging is based on python's [logging lib](https://docs.python.org/3/howto/logging.html). +Log levels `DEBUG`, `INFO` and `WARNING` are available. +Other log levels fall back to `WARNING`. + +## Command Line Arguments + +* `--log-level` - The log level to log on std out. +* `--log-file` - Path to a file to log to. + +Example: + +```sh +./bin/aca-py start --log-level debug --log-file acapy.log +``` + +## Environment Variables + +The log level can be configured using the environment variable `ACAPY_LOG_LEVEL`. +The log file can be set by `ACAPY_LOG_FILE`. +The log config can be set by `ACAPY_LOG_CONFIG`. + +Example: + +```sh +ACAPY_LOG_LEVEL=info ACAPY_LOG_FILE=./acapy.log ACAPY_LOG_CONFIG=./acapy_log.ini ./bin/aca-py start +``` + +## Acapy Config File + +Following parameters can be used in a configuration file like [this](demo/demo-args.yaml). + +```yaml +log-level: WARNING +debug-connections: false +debug-presentations: false +``` + +Warning: debug-connections and debug-presentations must not be used in a production environment as they log also credential claims values. +Both parameters are independent of the log level, which means: +Also if log-level is set to WARNING, connections and presentations will be logged like in debug log level. + +## Log config file + +Find an example in [default_logging_config.ini](aries_cloudagent/config/default_logging_config.ini). + +You can find more detail description in the [logging documentation](https://docs.python.org/3/howto/logging.html#configuring-logging). From b35e3644899b42769bc243e85f152e1c6065c151 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 29 Nov 2021 09:58:39 +0100 Subject: [PATCH 2/2] linked logging in dev readme Signed-off-by: Christian --- DevReadMe.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DevReadMe.md b/DevReadMe.md index 7f46c6421b..b3515c71a7 100644 --- a/DevReadMe.md +++ b/DevReadMe.md @@ -151,6 +151,10 @@ PORTS="5000:5000 8000:8000 1000:1000" ./scripts/run_docker start --inbound-trans Refer to [the previous section](#Running) for instructions on how to run the software. +### Logging + +You can find more details about logging and log levels [here](Logging.md). + ### Running Tests To run the ACA-Py test suite, use the following script: