Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Support java.util.logging #56156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Enhancement] Support java.util.logging
Signed-off-by: Binglin Chang <decstery@gmail.com>
  • Loading branch information
decster committed Feb 25, 2025
commit 721160476737f41c8f1ac0a285ea559430c37c7d
6 changes: 6 additions & 0 deletions fe/fe-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ under the License.
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.slf4j/jul-to-slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/com.github.oshi/oshi-core -->
<dependency>
<groupId>com.github.oshi</groupId>
Expand Down
3 changes: 3 additions & 0 deletions fe/fe-core/src/main/java/com/starrocks/StarRocksFE.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public static void start(String starRocksDir, String pidDir, String[] args) {

Log4jConfig.initLogging();

// test jul logging
java.util.logging.Logger.getLogger(java.util.logging.Logger.class.getName()).info("java.util.logging init");

// set dns cache ttl
java.security.Security.setProperty("networkaddress.cache.ttl", "60");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ static String generateActiveLog4jXmlConfig() throws IOException {
}

private static void reconfig() throws IOException {
// config java util logging
java.util.logging.LogManager.getLogManager().reset();
org.slf4j.bridge.SLF4JBridgeHandler.install();

String xmlConfTemplate = generateActiveLog4jXmlConfig();
if (!FeConstants.runningUnitTest && !FeConstants.isReplayFromQueryDump) {
System.out.println("=====");
Expand Down
7 changes: 7 additions & 0 deletions fe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,13 @@ under the License.
<version>1.7.30</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.slf4j/jul-to-slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>2.0.16</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.github.oshi/oshi-core -->
<dependency>
<groupId>com.github.oshi</groupId>
Expand Down
Loading