diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5c3a959..f1790c0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,7 +20,20 @@ If applicable, add screenshots to help explain your problem. If related to missing devices or SMART data, please run the `collector` in DEBUG mode, and attach the log file. ``` -docker exec scrutiny scrutiny-collector-metrics run --debug --log-file /tmp/test.log -# then use docker cp to copy the log file out of the container. -docker cp scrutiny:/tmp/test.log test.log +docker run -it --rm -p 8080:8080 \ +-v /run/udev:/run/udev:ro \ +-v /dev/disk:/dev/disk \ +-e DEBUG=true \ +-e COLLECTOR_LOG_FILE=/tmp/collector.log \ +-e SCRUTINY_LOG_FILE=/tmp/web.log \ +--name scrutiny \ +--privileged analogj/scrutiny + +# in another terminal trigger the collector +docker exec scrutiny scrutiny-collector-metrics run + +# then use docker cp to copy the log files out of the container. +docker cp scrutiny:/tmp/collector.log collector.log +docker cp scrutiny:/tmp/web.log web.log + ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a326880..5c25a16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,3 +40,24 @@ Now visit http://localhost:8080 brew install smartmontools go run collector/cmd/collector-metrics/collector-metrics.go run --debug ``` + + +## Debugging + +If you need more verbose logs for debugging, you can use the following environmental variables: + +- `DEBUG=true` - enables debug level logging on both the `collector` and `webapp` +- `COLLECTOR_DEBUG=true` - enables debug level logging on the `collector` +- `SCRUTINY_DEBUG=true` - enables debug level logging on the `webapp` + +In addition, you can instruct scrutiny to write its logs to a file using the following environmental variables: + +- `COLLECTOR_LOG_FILE=/tmp/collector.log` - write the `collector` logs to a file +- `SCRUTINY_LOG_FILE=/tmp/web.log` - write the `webapp` logs to a file + +Finally, you can copy the files from the scrutiny container to your host using the following command(s) + +``` +docker cp scrutiny:/tmp/collector.log collector.log +docker cp scrutiny:/tmp/web.log web.log +```