Skip to content

Commit

Permalink
Add CHARTED_JAVA_OPTS environment variable to launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Apr 8, 2023
1 parent fe4c4b5 commit 4c5f199
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cli/distribution/bin/charted
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ RESOLVED_JAVA_OPTS=(
"-Djdk.attach.allowAttachSelf=true"
)

if [ -n "${CHARTED_JAVA_OPTS:-}" ]; then
debug "Received extra options: ${CHARTED_JAVA_OPTS}"
RESOLVED_JAVA_OPTS+=("$CHARTED_JAVA_OPTS")
fi

export JAVA_OPTS=$(join ' ' "${RESOLVED_JAVA_OPTS[@]}")
debug "Resolved Java Options ~> $JAVA_OPTS"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public ExecutionStatus configure(LoggerContext context) {
// Set the current context we received as the current one
setContext(context);

// PRIORITY: env > system props > ./config/logback.properties > ./logback.properties > classpath > default
// PRIORITY: env > system props > ./config/logback.properties > ./config/logback.properties > classpath >
// default
if (resolveFileFromPath(context, System.getenv(ENVIRONMENT_VARIABLE_NAME))) return process0(context);
if (resolveFileFromPath(context, System.getProperty(SYSTEM_PROPERTY_NAME))) return process0(context);

Expand Down

0 comments on commit 4c5f199

Please sign in to comment.