diff --git a/CHANGELOG.md b/CHANGELOG.md index 947d02c..2d96a4b 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.12.0] - 2022-01-14 ### Added diff --git a/src/main/java/io/supertokens/storage/mysql/ConnectionPool.java b/src/main/java/io/supertokens/storage/mysql/ConnectionPool.java index 55d0248..75bdf23 100644 --- a/src/main/java/io/supertokens/storage/mysql/ConnectionPool.java +++ b/src/main/java/io/supertokens/storage/mysql/ConnectionPool.java @@ -132,7 +132,7 @@ public 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/mysql/HikariLoggingAppender.java b/src/main/java/io/supertokens/storage/mysql/HikariLoggingAppender.java index 06c113a..3012bd6 100644 --- a/src/main/java/io/supertokens/storage/mysql/HikariLoggingAppender.java +++ b/src/main/java/io/supertokens/storage/mysql/HikariLoggingAppender.java @@ -129,7 +129,7 @@ public void setName(String name) { @Override public void doAppend(ILoggingEvent event) throws LogbackException { if (event.getLevel() == Level.ERROR) { - Logging.error(start, event.getFormattedMessage(), false); + Logging.error(start, event.getFormattedMessage(), true); } else if (event.getLevel() == Level.WARN) { Logging.warn(start, event.getFormattedMessage()); } else { diff --git a/src/main/java/io/supertokens/storage/mysql/output/Logging.java b/src/main/java/io/supertokens/storage/mysql/output/Logging.java index f31cd51..4265e0c 100644 --- a/src/main/java/io/supertokens/storage/mysql/output/Logging.java +++ b/src/main/java/io/supertokens/storage/mysql/output/Logging.java @@ -164,6 +164,9 @@ private Logger createLoggerForConsole(Start start, String name) { logConsoleAppender.setEncoder(ple); logConsoleAppender.setContext(lc); logConsoleAppender.start(); + if (name.startsWith("io.supertokens.storage.mysql.Error")) { + logConsoleAppender.setTarget("System.err"); + } Logger logger = (Logger) LoggerFactory.getLogger(name); logger.addAppender(logConsoleAppender);