import org.eclipse.persistence.logging.AbstractSessionLog; import org.eclipse.persistence.logging.SessionLog; import org.eclipse.persistence.logging.SessionLogEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Slf4JEclipseLinkSessionLogger extends AbstractSessionLog implements SessionLog { public static final Logger LOG = LoggerFactory.getLogger(Slf4JEclipseLinkSessionLogger.class); @Override public void log(SessionLogEntry sle) { switch (sle.getLevel()) { case SEVERE: LOG.error(buildLogMessage(sle)); break; case WARNING: LOG.warn(buildLogMessage(sle)); break; case INFO: LOG.info(buildLogMessage(sle)); break; default: LOG.debug(buildLogMessage(sle)); } if (sle.hasException()) { LOG.error("Exception in EclipseLink", sle.getException()); } } private String buildLogMessage(SessionLogEntry sle) { StringBuilder b = new StringBuilder(); b.append("message=").append(sle.getMessage()); if (sle.getSession() != null && sle.getSession().getName() != null) { b.append("\n sessionName=").append(sle.getSession().getName()); } if (sle.getThread() != null && sle.getThread().getName() != null) { b.append("\n threadName=").append(sle.getThread().getName()); } if (sle.hasException()) { b.append("\n Exception=").append(sle.getException().getMessage()); } return b.toString(); } }
In the past this blog should be for Oracle ADF. but since I changed my job and I don't work with ADF any more this blog is about anything for programming with JAVA
Go to archiveFreitag, 30. März 2012
EclipseLinkSessionLogger with SLF4J
Here is the source code for your own Slf4JEclipseLinkSessionLogger. I found this in one mailing list.
Grand Sierra Casino Resort - MapyRO
AntwortenLöschenGrand Sierra Casino Resort. 광양 출장샵 Stateline, NV 89169. Directions · 이천 출장마사지 (877) 741-1000. 의정부 출장샵 Call Now · More 여주 출장샵 Info. Hours, Accepts Credit Cards, 부산광역 출장샵 Wi-Fi, PokéStop