Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
Allow log4j config file passing using LOGXML (snmpman.sh)
Browse files Browse the repository at this point in the history
Rewrite the maven project version in the caller script snmpman.sh
  • Loading branch information
sfuhrm committed Jan 4, 2024
1 parent 1560298 commit 76655c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions snmpman-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
</dependencies>

<build>
<resources>
<resource>
<directory>${basedir}/src/main/assembly</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion snmpman-cli/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</includes>
</fileSet>
<fileSet>
<directory>src/main/assembly</directory>
<directory>target/classes</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
<includes>
Expand Down
7 changes: 5 additions & 2 deletions snmpman-cli/src/main/assembly/snmpman.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#! /bin/bash

BASEDIR=$(cd $(dirname "$0")/..; pwd)
JAR=${BASEDIR}/lib/snmpman-cli-*.jar
JAR=${BASEDIR}/lib/snmpman-cli-${project.version}.jar
if [ "$LOGXML" = "" ]; then
export LOGXML=file:///${BASEDIR}/etc/log4j2.xml
fi

java -Dlog4j.configurationFile=file:///${BASEDIR}/etc/log4j2.xml -jar ${JAR} "$@"
java -Dlog4j.configurationFile=${LOGXML} -jar ${JAR} "$@"

0 comments on commit 76655c4

Please sign in to comment.