You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Artur Filipiak <ar...@gate.pl> on 2002/11/20 16:19:13 UTC

[Logger] sequence in JDBCTargetFactory?

hi,
i'm trying to setup JDBC target for logkit using
JDBCTargetFactory. according to excalibur logger
doc api sample config could look like this:

  <jdbc id="database">
      <datasource>java:/LogTargetDataSource</datasource>
      <normalized>true</normalized>
      <table name="LOG">
         <sequence>ID</sequence>
          <category>CATEGORY</category>
          <priority>PRIORITY</priority>
          <message>MESSAGE</message>
          <time>TIME</time>
          <rtime>RTIME</rtime>
          <throwable>THROWABLE</throwable>
          <hostname>HOSTNAME</hostname>
          <static aux="-">STATIC</static>
          <context aux="principal">PRINCIPAL</context>
          <context aux="ipaddress">IPADDRESS</context>
          <context aux="username">USERNAME</context>
      </table>
  </jdbc>


this factory uses avalon's logkit DefaultJDBCTarget/NormalizedJDBCTarget,
but there's no option for column of type "sequence"! moreover, i still
cannot
determine how DefaultJDBCTarget calculates id for database row.

any ideas?

salut,
fish


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Logger] sequence in JDBCTargetFactory?

Posted by Peter Donald <pe...@apache.org>.
On Thu, 21 Nov 2002 02:19, Artur Filipiak wrote:
> hi,
> i'm trying to setup JDBC target for logkit using
> JDBCTargetFactory. according to excalibur logger
> doc api sample config could look like this:
>
>   <jdbc id="database">
>       <datasource>java:/LogTargetDataSource</datasource>
>       <normalized>true</normalized>
>       <table name="LOG">
>          <sequence>ID</sequence>
>           <category>CATEGORY</category>
>           <priority>PRIORITY</priority>
>           <message>MESSAGE</message>
>           <time>TIME</time>
>           <rtime>RTIME</rtime>
>           <throwable>THROWABLE</throwable>
>           <hostname>HOSTNAME</hostname>
>           <static aux="-">STATIC</static>
>           <context aux="principal">PRINCIPAL</context>
>           <context aux="ipaddress">IPADDRESS</context>
>           <context aux="username">USERNAME</context>
>       </table>
>   </jdbc>
>
>
> this factory uses avalon's logkit DefaultJDBCTarget/NormalizedJDBCTarget,
> but there's no option for column of type "sequence"! moreover, i still
> cannot
> determine how DefaultJDBCTarget calculates id for database row.
>
> any ideas?

It looks like the documentation is wrong. <sequence/> was unused in the code.

As to id. When people are setting up logging to a database they usually 
precreate the table that has the ID column of type sequence / autonumber / 
autoincrement (or whatever your database supports). So it usually doesn't 
appear in the configuration for the target.

-- 
Cheers,

Peter Donald
*-----------------------------------------------------*
* "Faced with the choice between changing one's mind, *
* and proving that there is no need to do so - almost *
* everyone gets busy on the proof."                   *
*              - John Kenneth Galbraith               *
*-----------------------------------------------------* 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>