You can find lot of people asking how to disable eclipselink unique key constraint violation logs in glassfish server, and there are lot of replies where none of them really works. The real solution lies in glassfish server configuration and not in eclipselink configuration. You can find lot of posts referring to eclipselink configuration where we have to add some property tags in persistence.xml file to switch off logs, but that wont stop the logs in glassfish.
<property name="eclipselink.logging.level" value="OFF" />
<property name="eclipselink.logging.parameters" value="false"/>
<property name="eclipselink.target-server" value="SunAS9"/>
<property name="eclipselink.logging.exceptions" value="false"/>
By the time you catch exception, database constraint voilation would have already written to glassfish server log. So you have to switch off glassfish JTA server logs. But where and how to do it??? This blog entry has the answer for that.
Please follow the below steps :
3. select javax.enterprise.resource.jta option and select SEVERE from log level combobox.
4. Save and restart the server
<property name="eclipselink.logging.level" value="OFF" />
<property name="eclipselink.logging.parameters" value="false"/>
<property name="eclipselink.target-server" value="SunAS9"/>
<property name="eclipselink.logging.exceptions" value="false"/>
By the time you catch exception, database constraint voilation would have already written to glassfish server log. So you have to switch off glassfish JTA server logs. But where and how to do it??? This blog entry has the answer for that.
Please follow the below steps :
- Log in to glassfish admin console
- Go to Configurations->server-config->Logger Settings
3. select javax.enterprise.resource.jta option and select SEVERE from log level combobox.
4. Save and restart the server
No comments:
Post a Comment