Payara icon indicating copy to clipboard operation
Payara copied to clipboard

Bug Report: Log4j2 doesn't work with Payara-5.2022.4 and Payara-6.2022.1/FISH-6843

Open lexpersona-dev opened this issue 1 year ago • 1 comments

Brief Summary

Hello, In the payara-5.2022.3 version in payara5.2022.3\glassfish\domains\domain1\config\domain.xml I was using the variable: <jvm-options>-Dlog4j.configurationFile=file:///${com.sun.aas.instanceRoot}/config/log4j2.xml</jvm-options> in the section : <config name="server-config"> then the log4j2.xml file in the following directory: payara-5.2022.3\glassfish\domains\domain1\config and it works But when I wanted to reproduce this procedure for version 5.2022.4 and 6.2022.1 of Payara without success Thanks for your help.

Expected Outcome

I expected MyApp.log in payara5.2022.4\glassfish\domains\domain1\logs

Current Outcome

Nothing is created

Reproducer

To reproduce the problem add the three log4j libs (present in the zip)

  • log4j-api-2.18.0.jar
  • log4j-core-2.18.0.jar
  • log4j-slf4j-impl-2.18.0.jar

in payara5.2022.4\glassfish\lib add variable <jvm-options>-Dlog4j.configurationFile=file:///${com.sun.aas.instanceRoot}/config/log4j2.xml</jvm-options> in the section: <config name="server-config"> from payara5.2022.4\glassfish\domains\domain1\config\domain.xml add log4j2.xml file (present in the zip) in folder payara5.2022.4\glassfish\domains\domain1\config start the domain and check that the MyApp.log file in the folder payara5.2022.4\glassfish\domains\domain1\logs is not created

payara5.2022.3.zip

Operating System

Windows 11 Business 21H2 and Windows 11 Business 22H2

JDK Version

17.0.3 and 11.0.16.1

Payara Distribution

Payara Server Full Profile

lexpersona-dev avatar Nov 30 '22 09:11 lexpersona-dev

Hi @lexpersona-dev,

I have raised an Internal JIRA with FISH-6843 for it. Thanks.

shub8968 avatar Dec 08 '22 17:12 shub8968