I'm working on a JavaEE application deployed in weblogic with EclipseLink at the persistence layer. I need to send the flow of sql logging to a file and see what happens in the production environment. The property eclipselink.logging.file in persistence.xml can do that, but there seems no way to limit the size of this file. Is there any possibility to limit the maximum size of this file and overwrite it when this size is reached?
1 Answers
There does not appear to be a max log file size for eclipselink specifically, but if your eclipselink logs goes to the same log file as the normal WebLogic logs, you could configure the max log file size for WebLogic by setting the rotation file size in the admin console.
See: Weblogic - Rotate log files
Alternatively, you can configure EclipseLink to use java.util.logging (JUL) by specifying the following property in your persistence.xml:
<property name="eclipselink.logging.logger" value="JavaLogger"/>
Once you have EclipseLink logs being sent to JUL, you can configure the max file size in your logging.properties
file (see this question for details).
Also, here is a useful link to the EclipseLink logging page for additonal reference: EclipseLink - How To Configure Logging

- 1
- 1

- 41,446
- 8
- 38
- 61
-
Thank you very much for your reply but, unfortunately, I dont have access to the administration console of weblogic in the production environment. – H. Pirlo Jun 26 '16 at 17:55
-
Since you don't have access to the admin console for weblogic, I appended my answer with another option of having eclipselink logs sent to java.util.logging and then configuring the max log file size in logging.properties instead – Andy Guibert Jun 26 '16 at 18:05
-
I finally chosen to integrate eclipseLink with the logger log4j, adding the classes [CommonsLoggingSessionLog.java](https://bugs.eclipse.org/bugs/attachment.cgi?id=135503) and [FastLogFormatter.java](https://bugs.eclipse.org/bugs/attachment.cgi?id=135505) to the org.eclipse.persistence.logging package and adding at persistence.xml the line
as explained in http://wiki.eclipse.org/EclipseLink/Examples/Foundation/Logging. – H. Pirlo Jun 26 '16 at 18:17