2

I am using wildfly22 with log4j.properties file

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

any help is appreciated.
thanks.


 
Pradeep Kumar
  • 63
  • 1
  • 4
  • 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

1

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

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/

jlliagre
  • 29,783
  • 6
  • 61
  • 72
john k
  • 6,268
  • 4
  • 55
  • 59