add information about how to generate debug logs
This commit is contained in:
@@ -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.
|
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
|
docker run -it --rm -p 8080:8080 \
|
||||||
# then use docker cp to copy the log file out of the container.
|
-v /run/udev:/run/udev:ro \
|
||||||
docker cp scrutiny:/tmp/test.log test.log
|
-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
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -40,3 +40,24 @@ Now visit http://localhost:8080
|
|||||||
brew install smartmontools
|
brew install smartmontools
|
||||||
go run collector/cmd/collector-metrics/collector-metrics.go run --debug
|
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
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user