add docs for viewing logs (#63)

peterrauscher/oap-66
Celina Peralta 2023-04-18 11:04:21 -04:00 committed by GitHub
parent 415e50510c
commit f284809a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -4,6 +4,7 @@
The OAPEN Suggestion Service uses natural-language processing to suggest books based on their content similarities. To protect user privacy, we utilize text analysis rather than usage data to provide recommendations. This service is built on the proof-of-concept and paper by Ronald Snijder from the OAPEN Foundation, and you can [read the paper here](https://liberquarterly.eu/article/view/10938).
## Table of Contents
* [Installation (Server)](#installation-server)
+ [DigitalOcean Droplet](#digitalocean-droplet)
+ [DigitalOcean Managed Database](#digitalocean-managed-database)
@ -12,6 +13,7 @@ The OAPEN Suggestion Service uses natural-language processing to suggest books b
+ [SSL Certificate](#ssl-certificate)
* [Running](#running)
* [Endpoints](#endpoints)
* [Logging](#logging)
* [Service Components](#service-components)
+ [Suggestion Engine](#suggestion-engine)
+ [API](#api)
@ -144,6 +146,7 @@ The OAPEN Suggestion Service uses natural-language processing to suggest books b
## Running
You can start the services by running the following command in the directory where you cloned the repo:
```bash
docker compose up -d
```
@ -178,6 +181,18 @@ The API provides access to the following endpoints:
- `http://localhost:3001/api/{handle}/ngrams`
- e.g. http://localhost:3001/api/20.400.12657/47581/ngrams
## Logging
Log files are automatically generated by Docker for each container. The log files can be found in `/var/lib/docker/containers/<container-id>/*-json.log`.
To find a container's id, run `docker ps -a`.
To view log files, run `tail -f /var/lib/docker/containers/<container-id>/*-json.log`.
After some time, log files may take up too much disk space. To clear all logs on the host machine, run `truncate -s 0 /var/lib/docker/containers/*/*-json.log`
To clear logs for a specific container, run `truncate -s 0 /var/lib/docker/containers/<container-id>/*-json.log`
## Service Components
This project is a monorepo, with multiple services that work in tandem to provide suggestions: