From b3314a6fd64116292d01a6d10da50b6b020b0467 Mon Sep 17 00:00:00 2001 From: Esa Varemo Date: Mon, 21 Jul 2025 13:15:17 +0300 Subject: [PATCH] Add JVM arguments required by Log4j 2.x from Jira 9.5 Log4J has been updated to version 2.x on Jira 9.5.x and new JVM arguments have been included by default in the setenv.sh and setenv.bat files coming from fresh Jira installations. Missing these parameters breaks the runtime log level modification using the Logging and Profiling page. - https://support.atlassian.com/jira/kb/temporarily-changing-the-logging-level-doesnt-work-and-no-error-is-shown/ - https://jira.atlassian.com/browse/JRASERVER-62838 Fixes #459 --- templates/setenv.sh.epp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/setenv.sh.epp b/templates/setenv.sh.epp index c212c01a..01cca2d0 100755 --- a/templates/setenv.sh.epp +++ b/templates/setenv.sh.epp @@ -38,9 +38,11 @@ JVM_CODE_CACHE_ARGS='<%= pick_default($jira::jvm_code_cache_args, $jira::config: # # The following are the required arguments for Jira. # -<%- if ($jira::product != "servicedesk" and versioncmp($jira::version, '8.11.0') > 0) or ($jira::product == "servicedesk" and (versioncmp($jira::version, '4.11.0') > 0)){ -%> +<%- if $jira::product != "servicedesk" and versioncmp($jira::version, '9.5.0') >= 0 { -%> +JVM_REQUIRED_ARGS='-Dlog4j2.contextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -Dlog4j2.disableJmx=true -Dlog4j2.garbagefree.threadContextMap=true -Dlog4j2.isWebapp=false -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory' +<%- } elsif ($jira::product != "servicedesk" and versioncmp($jira::version, '8.11.0') > 0) or ($jira::product == "servicedesk" and (versioncmp($jira::version, '4.11.0') > 0)){ -%> JVM_REQUIRED_ARGS='-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory' -<% } else { -%> +<%- } else { -%> JVM_REQUIRED_ARGS='-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true' <%- } -%>