Joe,
    I would recommend you use my JDBCAppender
(contribs/KevinSteppe/JDBCAppender) as it does not have the issues you relate.
In addition it would be great to have someone varify for me that it will work in
a JMS environment, which is something I haven't been able to test out.
Additionally in my code the original LoggingEvent is available in case you want
to customize some code to do extra work.

Kevin Steppe


Joe Sackett wrote:

> Ceki,
> As the documentation states, "The category field
> is not serialized for performance reasons."
> As expected, the category and fqnOfCategoryClass
> fields are null when the LoggingEvent is retrieved in
> JMSSink.  This makes perfect sense.  However,
> the JDBCAppender.java line ~828 passes these
> two instance variables to the first two parameters
> of the LoggingEvent constructor, causing an Exception.
> I am sorry for beating this to death, but I am trying
> to help synchronize this specific composition of
> Appenders.  It is quite slick now that it is going.
> Thank you for all of your hard work.
> - Joe
>
> -----Original Message-----
> From: Ceki Gulcu <[EMAIL PROTECTED]>
> To: Log4J Users List <[EMAIL PROTECTED]>
> Date: Tuesday, November 20, 2001 9:19 AM
> Subject: Re: JDBCAppender from JMSAppender
>
> >
> >Hmm, all this sounds very suspicious to me. There
> >should be no problems with composing JMSAppender and
> >JDBCAppender. All the work is done during
> >serialization of logging event. Have you looked at
> >JMSSink? Regards, Ceki
> >
> >--- Joe Sackett <[EMAIL PROTECTED]> wrote:
> >> I have log4j logging inside of Orion 1.5.2 under JDK
> >> 1.3.1_01.
> >> I have the JDBCAppender working for logging events
> >> initiated
> >> inside of the web and ejb containers.  However, I
> >> also have
> >> external applications running outside of the app
> >> server that
> >> I need to have logged via the same JDBCAppender.  I
> >> use a
> >> JMSAppender to log from those external apps.  This
> >> is where
> >> things got a little sticky.  Since the JMSAppender
> >> must serialize
> >> the LoggingEvent object, its reference to the
> >> Category is lost
> >> for obvious reasons.  However, after this Logging
> >> event arrives
> >> into the JMS Topic, the JDBCAppender does not  like
> >> the
> >> null instance variables LoggingEvent.category and
> >> LoggingEvent.fqnOfCategoryClass.  I have attached a
> >> workaround for this problem (lines 828 - 837) in the
> >> file
> >> JDBCAppender.java.
> >> A related issue I experienced with the interaction
> >> between
> >> these two appenders  is that the deserialized event
> >> is
> >> (of course) unable to lookup its location
> >> information context
> >> (e.g. file, line, etc.) but CAN use the cached
> >> LocationInfo object
> >> that was deserialized along with the LoggingEvent.
> >> A problem
> >> occurs when the JDBCAppender internally creates a
> >> new event
> >> from the state of the deserialized event.  This new
> >> event does
> >> not have the cached LocationInfo object and can not
> >> look it up.
> >> I attached another workaround (lines 457 - 475) in
> >> the file
> >> JDBCLogger.java.
> >> I now have it working for my purposes.  Hopefully my
> >> attached
> >> changes will further illuminate the issues.  I am
> >> sure there are
> >> solutions that consider more than my specific
> >> workarounds.
> >> Thank you for these useful appenders.  Please let me
> >> know if I
> >> need to further explain these issues and
> >> workarounds.
> >>
> >> - Joe
> >>
> >>
> >
> >> ATTACHMENT part 2 application/octet-stream
> >name=JDBCAppender.java
> >
> >
> >> ATTACHMENT part 3 application/octet-stream
> >name=JDBCLogger.java
> >> --
> >> To unsubscribe, e-mail:
> >> <mailto:[EMAIL PROTECTED]>
> >> For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> >http://geocities.yahoo.com/ps/info1
> >
> >--
> >To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to