I\'m interested in logging SQL statements. I\'ve tried two approaches, with log4j2 and writing to file, both in vain.
I\'ve added following lines to persistence.xm
Anton , chances are the log4j configuration is overridden in one of a previously loaded component in the application server.
Your best bet to figure out what is happening could be to change the trace levels on the server side specifically for open JPA with the right trace level strings.
You can navigate to change logging detail (follow the crumb on the image) and use a trace string for open JPA (*=info: openjpa.Query=all: openjpa.jdbc_JDBC=all: openjpa.jdbc_SQL=all). Changes in configuration will need a reboot of the server.