From 67e5dd9a6fb470f7c6110f36820033ded33737fb Mon Sep 17 00:00:00 2001 From: Yoway Buorn Date: Sun, 23 Jan 2022 16:31:40 +0300 Subject: [PATCH 1/2] writes errors to stderr --- .../java/io/supertokens/storage/postgresql/ConnectionPool.java | 2 +- .../java/io/supertokens/storage/postgresql/output/Logging.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java b/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java index 8fbf33a9..4acf16cb 100644 --- a/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java +++ b/src/main/java/io/supertokens/storage/postgresql/ConnectionPool.java @@ -135,7 +135,7 @@ static void initPool(Start start) { } if (!longMessagePrinted) { longMessagePrinted = true; - Logging.info(start, errorMessage); + Logging.error(start, errorMessage, true); } double minsRemaining = (maxTryTime - System.currentTimeMillis()) / (1000.0 * 60); NumberFormat formatter = new DecimalFormat("#0.0"); diff --git a/src/main/java/io/supertokens/storage/postgresql/output/Logging.java b/src/main/java/io/supertokens/storage/postgresql/output/Logging.java index f53f1e7a..078e97a0 100644 --- a/src/main/java/io/supertokens/storage/postgresql/output/Logging.java +++ b/src/main/java/io/supertokens/storage/postgresql/output/Logging.java @@ -165,6 +165,9 @@ private Logger createLoggerForConsole(Start start, String name) { logConsoleAppender.setEncoder(ple); logConsoleAppender.setContext(lc); logConsoleAppender.start(); + if (name.startsWith("io.supertokens.storage.postgresql.Error")) { + logConsoleAppender.setTarget("System.err"); + } Logger logger = (Logger) LoggerFactory.getLogger(name); logger.addAppender(logConsoleAppender); From 562d08f93512dae763d708c9bc6217a4f47b9a97 Mon Sep 17 00:00:00 2001 From: Yoway Buorn Date: Sun, 23 Jan 2022 16:31:40 +0300 Subject: [PATCH 2/2] writes errors to stderr --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a32a284..40f0d4cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixes + +- Run as container, errors are merged into stdout (instead of going to stderr) + ## [1.13.0] - 2021-12-24 - added passwordless support