1

I am using wildfly22 with log4j.properties file

where we need to add  system property value -
log4j1.compatibility=true.

any help is appreciated.
thanks.


 
  • The documentation says a system property https://logging.apache.org/log4j/2.x/manual/migration.html#Log4j1.2Bridge. – James R. Perkins Jan 13 '22 at 19:18
  • Does this answer your question? [Setting system properties for Log4j in Tomcat](https://stackoverflow.com/questions/70843538/setting-system-properties-for-log4j-in-tomcat) – Piotr P. Karwasz Mar 10 '22 at 22:12
  • Basically since Log4j 2.10 _"system property"_ refers to any property source (cf. [documentation](https://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties)). – Piotr P. Karwasz Mar 10 '22 at 22:14

1 Answers1

0

You can set it via the command line when you run your program. E.g. java myapp -Dlog4j1.compatibility="true".

See https://www.ibm.com/docs/en/i/7.4?topic=java-system-properties

If you use gradle you can include it in gradle.properties.
https://javabydeveloper.com/gradle-system-properties-via-command-line-step-by-step-example/

john ktejik
  • 5,576
  • 4
  • 45
  • 52