From 30fa50f48df1a1845e882df813434895f725efd9 Mon Sep 17 00:00:00 2001 From: aynsix Date: Fri, 24 Apr 2020 20:27:11 +0300 Subject: [PATCH 1/3] put worker log to ELK --- .gitignore | 2 ++ config/filebeat.yml | 9 +++++++++ config/logstash.conf | 36 ++++++++++++++++++++++++++++++++++++ docker-compose.override.yml | 24 ++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 config/filebeat.yml create mode 100644 config/logstash.conf diff --git a/.gitignore b/.gitignore index ead2712de2..3f96bc4dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ # Exclude configuration folder exception the configuration sample file /config !/config/configuration.sample.yml +!/config/filebeat.yml +!/config/logstash.conf # Exclude generated proxies from doctrine2 #/resources/proxies diff --git a/config/filebeat.yml b/config/filebeat.yml new file mode 100644 index 0000000000..13f1adb53d --- /dev/null +++ b/config/filebeat.yml @@ -0,0 +1,9 @@ +filebeat: + inputs: + - type: log + enabled: true + paths: + - /var/alchemy/Phraseanet/logs/task_*.log + - /var/alchemy/Phraseanet/logs/worker_service*.log +output.logstash: + hosts: ["logstash:5044"] \ No newline at end of file diff --git a/config/logstash.conf b/config/logstash.conf new file mode 100644 index 0000000000..48eece44aa --- /dev/null +++ b/config/logstash.conf @@ -0,0 +1,36 @@ +input { + beats { + port => 5044 + } +} +filter { + clone { + clones => ["to_stdout"] + } + + if [type] == "to_stdout" { + #display only message field in the logstash stdout + prune { + whitelist_names => ["message"] + } + mutate { + add_field => { "[@metadata][type]" => "to_stdout" } + } + } + else { + mutate { + add_field => { "[@metadata][type]" => "to_elasticsearch" } + } + } + +} +output { + if [@metadata][type][1] == "to_stdout" { + stdout { + codec => rubydebug + } + } + else { + elasticsearch { hosts => ["elasticsearch:9200"] } + } +} diff --git a/docker-compose.override.yml b/docker-compose.override.yml index e058d2886a..ef5b56c55f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -91,6 +91,30 @@ services: image: kibana:4.6.6 ports: - 5601:5601 + links: + - elasticsearch + depends_on: + - elasticsearch + + logstash: + image: logstash:7.6.2 + links: + - elasticsearch + volumes: + - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw + command: logstash -f /var/alchemy/Phraseanet/config/logstash.conf + depends_on: + - elasticsearch + restart: on-failure + + filebeat: + hostname: filebeat + image: "docker.elastic.co/beats/filebeat:7.6.2" + volumes: + - ${PHRASEANET_CONFIG_DIR}/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro + - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:ro + command: filebeat run -e --strict.perms=false + restart: on-failure networks: default: From a262c57d8b5c0b125fcb438c53601ed63de22ed1 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Mon, 27 Apr 2020 09:44:43 +0200 Subject: [PATCH 2/3] add app error in filebeat conf --- config/filebeat.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/filebeat.yml b/config/filebeat.yml index 13f1adb53d..ec38eecafc 100644 --- a/config/filebeat.yml +++ b/config/filebeat.yml @@ -5,5 +5,6 @@ filebeat: paths: - /var/alchemy/Phraseanet/logs/task_*.log - /var/alchemy/Phraseanet/logs/worker_service*.log + - /var/alchemy/Phraseanet/logs/app_error*.log output.logstash: - hosts: ["logstash:5044"] \ No newline at end of file + hosts: ["logstash:5044"] From 2a55ef6880bade0355d73e3f07657c25befbeaad Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Fri, 8 May 2020 17:01:48 +0400 Subject: [PATCH 3/3] PHRAS-3051 #comment Fix : Prod video tools define thumbnail size #time 4h --- package.json | 2 +- templates/web/prod/actions/Tools/videoEditor.html.twig | 8 +++++++- yarn.lock | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9a38d2b75f..03aec147bb 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "normalize-css": "^2.1.0", "npm": "^6.0.0", "npm-modernizr": "^2.8.3", - "phraseanet-production-client": "0.34.195-d", + "phraseanet-production-client": "0.34.196-d", "requirejs": "^2.3.5", "tinymce": "^4.0.28", "underscore": "^1.8.3", diff --git a/templates/web/prod/actions/Tools/videoEditor.html.twig b/templates/web/prod/actions/Tools/videoEditor.html.twig index d31302ebd0..a788b2707a 100644 --- a/templates/web/prod/actions/Tools/videoEditor.html.twig +++ b/templates/web/prod/actions/Tools/videoEditor.html.twig @@ -68,7 +68,13 @@ {% endif %} {% endfor %} -