mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
logging: log to file
New env var CTOP_DEBUG_FILE to specify a path to log file
This commit is contained in:
@@ -54,3 +54,18 @@ CTOP_DEBUG=1 CTOP_DEBUG_TCP=1 ./ctop
|
||||
```
|
||||
|
||||
A TCP listener for streaming log messages will be started on the default listen address(`0.0.0.0:9000`)
|
||||
|
||||
## Log to file
|
||||
|
||||
You can also log to a file by specifying `CTOP_DEBUG_FILE=/path/to/ctop.log` environment variable:
|
||||
```sh
|
||||
CTOP_DEBUG=1 CTOP_DEBUG_FILE=ctop.log ./ctop
|
||||
```
|
||||
|
||||
This is useful for GoLand to see logs right in debug panel:
|
||||
* Edit Run configuration
|
||||
* Go to Logs tab
|
||||
* Specify this log file in "Log file to be shown in console".
|
||||
Then during debugging you'll see the log tab in debug panel:
|
||||
|
||||

|
||||
|
||||
BIN
_docs/img/goland_debug.png
Normal file
BIN
_docs/img/goland_debug.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 KiB |
Reference in New Issue
Block a user