mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-10-15 14:50:54 +00:00
Fix JUL logging (#792)
This commit is contained in:
@@ -49,6 +49,10 @@
|
|||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jul-to-slf4j</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.graalvm.nativeimage</groupId>
|
<groupId>org.graalvm.nativeimage</groupId>
|
||||||
<artifactId>svm</artifactId>
|
<artifactId>svm</artifactId>
|
||||||
|
@@ -59,6 +59,7 @@ import org.mvndaemon.mvnd.common.logging.ClientOutput;
|
|||||||
import org.mvndaemon.mvnd.common.logging.TerminalOutput;
|
import org.mvndaemon.mvnd.common.logging.TerminalOutput;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.slf4j.bridge.SLF4JBridgeHandler;
|
||||||
|
|
||||||
import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION;
|
import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION;
|
||||||
|
|
||||||
@@ -146,6 +147,9 @@ public class DefaultClient implements Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Install JUL -> SLF4j bridge
|
||||||
|
SLF4JBridgeHandler.install();
|
||||||
|
|
||||||
int exitCode = 0;
|
int exitCode = 0;
|
||||||
boolean noBuffering = batchMode || parameters.noBuffering();
|
boolean noBuffering = batchMode || parameters.noBuffering();
|
||||||
try (TerminalOutput output = new TerminalOutput(noBuffering, parameters.rollingWindowSize(), logFile)) {
|
try (TerminalOutput output = new TerminalOutput(noBuffering, parameters.rollingWindowSize(), logFile)) {
|
||||||
|
@@ -431,7 +431,7 @@ public class DaemonConnector {
|
|||||||
Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString());
|
Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString());
|
||||||
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
|
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
|
||||||
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn").resolve("conf"));
|
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn").resolve("conf"));
|
||||||
args.add("-Dclassworlds.conf=" + mvndHome.resolve("bin").resolve("mvnd-server.conf"));
|
args.add("-Dclassworlds.conf=" + mvndHome.resolve("bin").resolve("mvnd-daemon.conf"));
|
||||||
|
|
||||||
Environment.MVND_JAVA_HOME.addSystemProperty(
|
Environment.MVND_JAVA_HOME.addSystemProperty(
|
||||||
args, parameters.javaHome().toString());
|
args, parameters.javaHome().toString());
|
||||||
|
@@ -243,7 +243,7 @@ public class DaemonParameters {
|
|||||||
public Path logbackConfigurationPath() {
|
public Path logbackConfigurationPath() {
|
||||||
return property(Environment.MVND_LOGBACK)
|
return property(Environment.MVND_LOGBACK)
|
||||||
.orDefault(() -> mvndHome()
|
.orDefault(() -> mvndHome()
|
||||||
.resolve("mvn/conf/logging/logback-server.xml")
|
.resolve("mvn/conf/logging/logback-daemon.xml")
|
||||||
.toString())
|
.toString())
|
||||||
.orFail()
|
.orFail()
|
||||||
.asPath();
|
.asPath();
|
||||||
|
@@ -31,6 +31,9 @@
|
|||||||
<artifact id="ch.qos.logback:logback-core">
|
<artifact id="ch.qos.logback:logback-core">
|
||||||
<exclusion id="*:*"/>
|
<exclusion id="*:*"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
|
<artifact id="org.slf4j:jul-to-slf4j">
|
||||||
|
<exclusion id="*:*"/>
|
||||||
|
</artifact>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
|
|
||||||
<artifactSet to="/mvn/lib/ext">
|
<artifactSet to="/mvn/lib/ext">
|
||||||
|
@@ -31,6 +31,9 @@
|
|||||||
<artifact id="ch.qos.logback:logback-core">
|
<artifact id="ch.qos.logback:logback-core">
|
||||||
<exclusion id="*:*"/>
|
<exclusion id="*:*"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
|
<artifact id="org.slf4j:jul-to-slf4j">
|
||||||
|
<exclusion id="*:*"/>
|
||||||
|
</artifact>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
|
|
||||||
<artifactSet to="/mvn/lib/ext">
|
<artifactSet to="/mvn/lib/ext">
|
||||||
|
1
dist/src/main/distro/bin/mvnd-client.conf
vendored
1
dist/src/main/distro/bin/mvnd-client.conf
vendored
@@ -19,6 +19,7 @@ main is org.mvndaemon.mvnd.client.DefaultClient from plexus.core
|
|||||||
set maven.home default ${mvnd.home}/mvn
|
set maven.home default ${mvnd.home}/mvn
|
||||||
set maven.conf default ${maven.home}/conf
|
set maven.conf default ${maven.home}/conf
|
||||||
|
|
||||||
|
set java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties
|
||||||
set logback.configurationFile default ${maven.conf}/logging/logback-client.xml
|
set logback.configurationFile default ${maven.conf}/logging/logback-client.xml
|
||||||
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
||||||
|
|
||||||
|
@@ -19,7 +19,8 @@ main is org.mvndaemon.mvnd.daemon.Server from plexus.core
|
|||||||
set maven.home default ${mvnd.home}/mvn
|
set maven.home default ${mvnd.home}/mvn
|
||||||
set maven.conf default ${maven.home}/conf
|
set maven.conf default ${maven.home}/conf
|
||||||
|
|
||||||
set logback.configurationFile default ${maven.conf}/logging/logback-server.xml
|
set java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties
|
||||||
|
set logback.configurationFile default ${maven.conf}/logging/logback-daemon.xml
|
||||||
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
||||||
|
|
||||||
[plexus.core]
|
[plexus.core]
|
1
dist/src/main/distro/mvn/bin/mvn.conf
vendored
1
dist/src/main/distro/mvn/bin/mvn.conf
vendored
@@ -18,6 +18,7 @@ main is org.apache.maven.cli.MavenCli from plexus.core
|
|||||||
|
|
||||||
set maven.conf default ${maven.home}/conf
|
set maven.conf default ${maven.home}/conf
|
||||||
|
|
||||||
|
set java.util.logging.config.file default ${maven.conf}/logging/java.util.logging.properties
|
||||||
set logback.configurationFile default ${maven.conf}/logging/logback-mvn.xml
|
set logback.configurationFile default ${maven.conf}/logging/logback-mvn.xml
|
||||||
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
|
||||||
|
|
||||||
|
16
dist/src/main/distro/mvn/conf/logging/java.util.logging.properties
vendored
Normal file
16
dist/src/main/distro/mvn/conf/logging/java.util.logging.properties
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
@@ -20,6 +20,7 @@
|
|||||||
| mvnd client log configuration
|
| mvnd client log configuration
|
||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
|
||||||
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
|
Reference in New Issue
Block a user