diff --git a/README.md b/README.md index 297be2c..43107e4 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,16 @@ ansible-playbook playbook.yml --ask-become-pass ```bash cd $(docker volume inspect [NAME] | jq -r '.[0].Mountpoint') +``` + +# LOGGING + +```yml +logging: + driver: loki + options: + loki-url: "https://[username]:[password]@[url]/loki/api/v1/push" + +logging: + driver: none ``` \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 31bd2f7..d56ab0d 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -19,6 +19,13 @@ enabled: true state: started +- name: Install loki-docker-driver plugin + community.docker.docker_plugin: + plugin_name: loki-docker-driver + alias: loki + state: present + become: true + - name: Create proxy network community.docker.docker_network: name: proxy diff --git a/roles/traefik/templates/docker-compose.yml b/roles/traefik/templates/docker-compose.yml index 2dd698e..44897f1 100644 --- a/roles/traefik/templates/docker-compose.yml +++ b/roles/traefik/templates/docker-compose.yml @@ -47,6 +47,10 @@ services: - traefik.http.routers.traefik-secure.tls=true - traefik.http.routers.traefik-secure.tls.certresolver=sslResolver - traefik.http.routers.traefik-secure.service=api@internal + logging: + driver: loki + options: + loki-url: "http://loki:3100/loki/api/v1/push" networks: metrics: