From e873bc797670e14869b864087b76c8c7f4a8f203 Mon Sep 17 00:00:00 2001 From: Taywon Date: Sat, 31 May 2025 17:44:54 +0200 Subject: [PATCH] ajout du systeme de log --- docker-compose.yml | 8 +++++++- index.js | 18 +++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2568c0c..6aca635 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,4 +12,10 @@ services: - /media/hddmain/security:/snapshot ports: - 7256:80 - command: "npm start" \ No newline at end of file + command: "npm start" + logging: + driver: syslog + options: + syslog-address: "udp://127.0.0.1:514" + syslog-format: "rfc3164" + tag: "main-relay" diff --git a/index.js b/index.js index a155dc2..3577e30 100644 --- a/index.js +++ b/index.js @@ -12,13 +12,17 @@ function snapshotPath(){ return "/snapshot/snapshot-" + date.getFullYear() - + date.getMonth() - + date.getDay() - + "-" - + date.getHours() - + date.getMinutes() - + date.getSeconds() - + "-" + + "-" + + String(date.getMonth() + 1).padStart(2, '0') + + "-" + + String(date.getDate()).padStart(2, '0') + + "_" + + String(date.getHours()).padStart(2, '0') + + "-" + + String(date.getMinutes()).padStart(2, '0') + + "-" + + String(date.getSeconds()).padStart(2, '0') + + "_" + date.getMilliseconds() +".jpg"; }