How to configure server logging level. I wan...">

JPA Logging Level on Glassfish v3 Server

<property name="eclipselink.logging.level" value="FINE" /> 

How to configure server logging level. I want to see Level.FINE on my development server. But, of course, only Level.WARNING on a production server.

If I put the line above in the persistence.xml file, it will automatically configure on both machines. I must remember to turn it off manually. And this, of course, is dangerous.

Thank you very much.

+4
source share
3 answers

You can link EclipseLink / Examples / JPA / Logging

Note. Installing eclipselink.logging.level in FINE is not enough (since EclipseLink 2.4.0 - Juno), you must install eclipselink.logging.level.sql in FINE.

 <property name="eclipselink.logging.level" value="FINE"/> <property name="eclipselink.logging.level.sql" value="FINE"/> <property name="eclipselink.logging.parameters" value="true"/> 
+4
source

I myself struggled with this. I found that on GlassFish (in section 3.1.2) you are editing the logging.properties file from the Glassfish domains / domain / config directory.

Locate the org.eclipse.persistence.session.level entry and modify it as follows:

 org.eclipse.persistence.session.level=FINE 

In addition to this, I found that I need to add these two entries:

 org.eclipse.persistence.level = FINE org.eclipse.persistence.sql.level = FINE 

When editing a logging.properties file like this, there is no need to add anything to the persistence.xml file regarding logging, and it will meet your requirements above.

NOTE I have not yet succeeded in getting eclipselink.logging.parameter = true to work in the persistence.xml file (it cannot be assigned in logging.properties). So, the SQL log works, just not with a complete reset of the bindings.

+3
source

I added these lines to the logging.properties file and it works without adding it to the persistence.xml file. Now it depends on the server.

 eclipselink.logging.level=FINE eclipselink.logging.level.sql=FINE eclipselink.logging.parameters=true 
0
source

Source: https://habr.com/ru/post/1440530/


All Articles