-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: EclipseLink support #3
Comments
Hi @C-Otto, here's what I did recently:
See example below - guess we should make it part of our Wiki... Best Michael Example:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="jersey-client" transaction-type="RESOURCE_LOCAL">
<class>com.sap.hcp.perfx.samples.CheckResult</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby:MyDB;create=true"/>
<property name="javax.persistence.jdbc.user" value="test"/>
<property name="javax.persistence.jdbc.user" value="test" />
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.logger" value="com.sap.hcp.perfx.samples.ELSlf4jLogger"/>
<property name="eclipselink.logging.level" value="FINE"/>
</properties>
</persistence-unit>
</persistence> Dedicated Logger: public class ELSlf4jLogger extends AbstractSessionLog implements SessionLog {
private static Logger LOGGER = LoggerFactory.getLogger(ELSlf4jLogger.class);
@Override
public void log(SessionLogEntry sessionLogEntry) {
switch (sessionLogEntry.getLevel()) {
case SessionLog.SEVERE:
LOGGER.error(sessionLogEntry.getMessage());
break;
case SessionLog.WARNING:
LOGGER.warn(sessionLogEntry.getMessage());
break;
default:
if (sessionLogEntry.getException() != null) {
LOGGER.error(sessionLogEntry.getMessage(), sessionLogEntry.getException());
}
else {
LOGGER.info(sessionLogEntry.getMessage());
}
}
}
} |
Thank you! |
KarstenSchnitter
added a commit
that referenced
this issue
Jul 12, 2018
Fix late getRequest and getResponse calls in Tomcat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the library does not format log messages emitted by EclipseLink. It would be great if (debug) log messages like the one shown below would be printed in the JSON format. I'd appreciate native support, but some guidelines on how to modify the code so that the log messages are routed to SLF4J are also appreciated.
The text was updated successfully, but these errors were encountered: