Skip to content

Commit 6655e3e

Browse files
Merge pull request #337 from mapswipe/docs
Docs
2 parents 8fad8d7 + 5189aad commit 6655e3e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

docs/source/debugging.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
## Logs - MapSwipe Workers
44

55
Where can I find logs?
6+
- `docker logs mapswipe_workers`
7+
- or
8+
- `cat mapswipe-data/mapswipe_workers.log`
69

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.
811

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`
1113

1214

1315
## Common Errors

docs/source/dev_setup.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ mapswipe_workers --help
8989

9090
## Logging
9191

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:
9393

9494
```python
9595
from mapswipe_workers.definitions import logger
96-
logger.info('information')
97-
logger.waring('warning')
96+
logger.info('information messages')
97+
logger.waring('warning messages')
9898

9999
# Include stack trace in the log
100100
try:
@@ -103,7 +103,7 @@ except Exception:
103103
logger.exception('Additional information.')
104104
```
105105

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`.
107107

108108
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`.
109109

0 commit comments

Comments
 (0)