Skip to content

Commit

Permalink
Move mvnd logback config file into [MVND_HOME]/conf and use the stand…
Browse files Browse the repository at this point in the history
…ard name for the mvn specific config file, fixes apache#226
  • Loading branch information
gnodet committed Nov 16, 2020
1 parent 7879a05 commit b6cc70e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public Path multiModuleProjectDirectory() {

public Path logbackConfigurationPath() {
return property(Environment.LOGBACK_CONFIGURATION_FILE)
.orDefault(() -> mvndHome().resolve("mvn/conf/logging/logback.xml").toString())
.orDefault(() -> mvndHome().resolve("conf/logback.xml").toString())
.orFail()
.asPath();
}
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/distro/bin/mvnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "${DAEMON_JAR}" \
"-Dlogback.configurationFile=${MVND_HOME}/mvn/conf/logging/logback.xml" \
"-Dlogback.configurationFile=${MVND_HOME}/conf/logback.xml" \
"-Dmvnd.home=${MVND_HOME}" \
"-Dmaven.home=${MVND_HOME}/mvn" \
"-Dlibrary.jansi.path=${MVND_HOME}/mvn/lib/jansi-native" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2020 the original author or authors.
Copyright 2019 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,20 @@
<!--
| write project-specific build log messages to ${project.build.directory}/build.log files
-->
<appender name="CONSOLE" class="org.mvndaemon.mvnd.logging.internal.SimpleAppender" />
<appender name="MEM" class="org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender">
<pattern>[%level] %msg%n</pattern>
</appender>

<appender name="DAEMON" class="ch.qos.logback.core.FileAppender">
<file>${mvnd.daemon.storage}/daemon-${daemon.uid}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %.-1level %msg%n</pattern>
</encoder>
</appender>

<logger name="org.mvndaemon.mvnd.daemon" level="DEBUG" additivity="false">
<appender-ref ref="DAEMON" />
</logger>

<logger name="Sisu" level="INFO" />

Expand All @@ -37,6 +50,6 @@
<logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" />

<root level="${consoleLevel:-info}">
<appender-ref ref="CONSOLE" />
<appender-ref ref="MEM" />
</root>
</configuration>
2 changes: 1 addition & 1 deletion dist/src/main/distro/mvn/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "${CLASSWORLDS_JAR}" \
"-Dlogback.configurationFile=${MAVEN_HOME}/conf/logging/logback-mvn.xml" \
"-Dlogback.configurationFile=${MAVEN_HOME}/conf/logging/logback.xml" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
"-Dmvnd.home=${MAVEN_HOME}" \
"-Dmaven.home=${MAVEN_HOME}" \
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/distro/mvn/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %CLASSWORLDS_JAR% ^
"-Dlogback.configurationFile=%MAVEN_HOME%\conf\logging\logback-mvn.xml" ^
"-Dlogback.configurationFile=%MAVEN_HOME%\conf\logging\logback.xml" ^
"-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
"-Dmvnd.home=%MAVEN_HOME%" ^
"-Dmaven.home=%MAVEN_HOME%" ^
Expand Down
19 changes: 3 additions & 16 deletions dist/src/main/distro/mvn/conf/logging/logback.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright 2019 the original author or authors.
Copyright 2020 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,20 +28,7 @@
<!--
| write project-specific build log messages to ${project.build.directory}/build.log files
-->
<appender name="MEM" class="org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender">
<pattern>[%level] %msg%n</pattern>
</appender>

<appender name="DAEMON" class="ch.qos.logback.core.FileAppender">
<file>${mvnd.daemon.storage}/daemon-${daemon.uid}.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %.-1level %msg%n</pattern>
</encoder>
</appender>

<logger name="org.mvndaemon.mvnd.daemon" level="DEBUG" additivity="false">
<appender-ref ref="DAEMON" />
</logger>
<appender name="CONSOLE" class="org.mvndaemon.mvnd.logging.internal.SimpleAppender" />

<logger name="Sisu" level="INFO" />

Expand All @@ -50,6 +37,6 @@
<logger name="org.eclipse.aether.internal.impl.WarnChecksumPolicy" level="ERROR" />

<root level="${consoleLevel:-info}">
<appender-ref ref="MEM" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ limitations under the License.</inlineHeader>
<exclude>**/README.*</exclude>
<exclude>**/.cache/**</exclude>
<exclude>**/.gitkeep</exclude>
<exclude>**/conf/logging/logback.xml</exclude>
<exclude>**/mvnd.properties.template</exclude>
<exclude>**/m2.conf</exclude>
<exclude>**/mvnd</exclude>
Expand Down

0 comments on commit b6cc70e

Please sign in to comment.