From fd13607d893add96f2fb094f018407455eba9880 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 18 Jun 2022 11:34:28 -0500 Subject: [PATCH] Update:Logs to use server local timezone instead of UTC #656 --- client/pages/config/log.vue | 4 ++-- package-lock.json | 6 +++--- package.json | 10 +++++----- server/Logger.js | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/pages/config/log.vue b/client/pages/config/log.vue index 40146f2e..eb5200c9 100644 --- a/client/pages/config/log.vue +++ b/client/pages/config/log.vue @@ -17,8 +17,8 @@
diff --git a/package-lock.json b/package-lock.json index 461403de..961ce52b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,14 +5,14 @@ "requires": true, "packages": { "": { - "version": "2.0.20", + "version": "2.0.21", "license": "GPL-3.0", "dependencies": { "archiver": "^5.3.0", "axios": "^0.26.1", "bcryptjs": "^2.4.3", "command-line-args": "^5.2.0", - "date-and-time": "^2.0.1", + "date-and-time": "^2.3.1", "express": "^4.17.1", "express-fileupload": "^1.2.1", "express-rate-limit": "^5.3.0", @@ -3381,4 +3381,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 9b91fc03..9e46c2b4 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "build-win": "npm run client && pkg -t node16-win-x64 -o ./dist/win/audiobookshelf -C GZip .", "build-linux": "build/linuxpackager", "docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push . -t advplyr/audiobookshelf", - "docker-amd64-local":"docker buildx build --platform linux/amd64 --load . -t advplyr/audiobookshelf-amd64-local", - "docker-arm64-local":"docker buildx build --platform linux/arm64 --load . -t advplyr/audiobookshelf-arm64-local", - "docker-armv7-local":"docker buildx build --platform linux/arm/v7 --load . -t advplyr/audiobookshelf-armv7-local", + "docker-amd64-local": "docker buildx build --platform linux/amd64 --load . -t advplyr/audiobookshelf-amd64-local", + "docker-arm64-local": "docker buildx build --platform linux/arm64 --load . -t advplyr/audiobookshelf-arm64-local", + "docker-armv7-local": "docker buildx build --platform linux/arm/v7 --load . -t advplyr/audiobookshelf-armv7-local", "deploy": "node dist/autodeploy" }, "bin": "prod.js", @@ -34,7 +34,7 @@ "axios": "^0.26.1", "bcryptjs": "^2.4.3", "command-line-args": "^5.2.0", - "date-and-time": "^2.0.1", + "date-and-time": "^2.3.1", "express": "^4.17.1", "express-fileupload": "^1.2.1", "express-rate-limit": "^5.3.0", @@ -49,4 +49,4 @@ "socket.io": "^4.4.1", "xml2js": "^0.4.23" } -} \ No newline at end of file +} diff --git a/server/Logger.js b/server/Logger.js index f8c83da0..376e08c8 100644 --- a/server/Logger.js +++ b/server/Logger.js @@ -1,16 +1,16 @@ +const date = require('date-and-time') const { LogLevel } = require('./utils/constants') class Logger { constructor() { this.logLevel = process.env.NODE_ENV === 'production' ? LogLevel.INFO : LogLevel.TRACE - // this.logFileLevel = LogLevel.INFO this.socketListeners = [] this.logManager = null } get timestamp() { - return (new Date()).toISOString() + return date.format(new Date(), 'YYYY-MM-DD HH:mm:ss') } get levelString() {