You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/debugging.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,13 @@
3
3
## Logs - MapSwipe Workers
4
4
5
5
Where can I find logs?
6
+
-`docker logs mapswipe_workers`
7
+
- or
8
+
-`cat mapswipe-data/mapswipe_workers.log`
6
9
7
-
Logs are written to directly to console and also to `/var/log/mapswipe_workers.log`:
10
+
Logs are written to directly to the terminal (stdout). The easiest way is therefore is to run `docker logs mapswipe_workers` to see the logs.
8
11
9
-
-`docker exec -t mapswipe_workers cat /var/log/mapswipe_workers/mapswipe_workers.log` (if container is running)
10
-
-`docker logs container_name` (also if container is not running)
12
+
Logs are also writing to file inside the Docker container (`~/.local/share/mapswipe_workers/mapswipe_workers.log`). The parent directory of the file is the data directory of MapSwipe Workers. This directory is mounted (as a Docker volume) locally to disk (`mapswipe-data/`). Logs can therefore be accessed as text file as well: `cat mapswipe-data/mapswipe_workers.log`
Copy file name to clipboardExpand all lines: docs/source/dev_setup.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,12 +89,12 @@ mapswipe_workers --help
89
89
90
90
## Logging
91
91
92
-
Mapswipe workers logs are generated using the Python logging module of the standard library (See [Official docs](https://docs.python.org/3/library/logging.html) or this [Tutorial](https://realpython.com/python-logging/#the-logging-module). The logging configuration is defined in the `logging.cfg` file (`mapswipe_workers/logging.cfg`). To use the logger object import the it from the `definitions` module:
92
+
Mapswipe workers logs are generated using the Python logging module of the standard library (See [Official docs](https://docs.python.org/3/library/logging.html) or this [Tutorial](https://realpython.com/python-logging/#the-logging-module). To use the logger object import the it from the `definitions` module:
93
93
94
94
```python
95
95
from mapswipe_workers.definitions import logger
96
-
logger.info('information')
97
-
logger.waring('warning')
96
+
logger.info('information messages')
97
+
logger.waring('warning messages')
98
98
99
99
# Include stack trace in the log
100
100
try:
@@ -103,7 +103,7 @@ except Exception:
103
103
logger.exception('Additional information.')
104
104
```
105
105
106
-
Default logging level is Info. To change the logging level edit the configuration. Logs are written to STDOUT and `~/.local/share/mapswipe_workers/mapswipe_workers.log`.
106
+
Default logging level is Info. To change the logging level edit the logging configuration which is found in the module `definitions.py`. Logs are written to STDOUT and `~/.local/share/mapswipe_workers/mapswipe_workers.log`.
107
107
108
108
Per default logging of third-party packages is disabled. To change this edit the definition module (`mapswipe_workers/defintions.py`). Set the `disable_existing_loggers` parameter of the `logging.config.fileConfig()` function to `False`.
0 commit comments