[logback-user] LogBack JNDIConnectionSource

Taariq Levack taariql at gmail.com
Fri May 27 11:03:40 CEST 2011


Hi
Are you suggesting we don't get the pool from jndi at all, or don't use the
same one as the rest of the application?

Taariq

On Thu, May 26, 2011 at 11:37 AM, David Roussel <nabble at diroussel.xsmail.com
> wrote:

> Don't let your application server manage your logging db connection. This
> may be harder than it sounds. I've had trouble in the past trying to
> convince weblogic that I didn't want XA transactions between two different
> databases.
>
> On 26 May 2011, at 03:55, Alphy <binnyal at gmail.com> wrote:
>
> >
> > I am using JNDIConnectionSource for writing logs to my postgres DB .But I
> am
> > facing a problem in transaction handling .
> >
> > App Server : Glassfish.
> >
> > In EJB , I have Stateteless Session Bean and I have
> > private static final Logger auditlog = LoggerFactory.getLogger("audit");
> >
> > Inside I have method for transactions.
> >
> > Bean{
> > Method(){
> > Method1();
> > Method2();
> > auditlog.info("method");
> > }
> > Method1()
> > {
> > em.persist();
> > auditlog.info("method1");
> >
> > }
> > Method2()
> > {
> > em.persist();
> > auditlog.info("method2");
> >
> > }
> > }
> >
> > <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
> > <connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource">
> >
> >   </connectionSource>
> > </appender>
> >
> > I wanted Method1 and Method 2 in one transaction and if any failure need
> to
> > rollback both. Earlier when I was writing logs to file it was working
> fine
> > and now when I changed to Db, I realised the call to write logs is
> closing
> > existing transaction and starting new transaction to write to DB. Please
> let
> > me know how I can use the same transaction for writing to logs. I am
> using
> > same connection pool for both logging and application.
> > --
> > View this message in context:
> http://old.nabble.com/LogBack--JNDIConnectionSource-tp31704423p31704423.html
> > Sent from the Logback User mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Logback-user mailing list
> > Logback-user at qos.ch
> > http://qos.ch/mailman/listinfo/logback-user
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110527/f8e62ae0/attachment.html>


More information about the Logback-user mailing list