You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Scherer Pierre <sc...@ibelgique.com> on 2003/02/14 12:10:17 UTC

Log into a DB

Hi,

How can I put the informations catch by logger defines in the assembly file
into a DB (I use MySQL with windows)?

Have a nice day,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Log into a DB

Posted by "Noel J. Bergman" <no...@devtech.com>.
Pierre,

As I told you before, I haven't tried using database logging.  If the
information below isn't sufficient, you'll have to ask on the Avalon mailing
list.

One problem may be that you said that you are looking for TargetFactory.
The correct class is JDBCTargetFactory.

	--- Noel

-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Sunday, February 23, 2003 19:12
To: James Users List
Subject: RE: Log into a DB



Is it possible to change this code in the source version of james?
Because I have find the .class but not the java file of TargetFactory.
Must I re-compile Phoenix after (perhaps, will it be more easy to use Log4J
directly in the maillets?) and before compile back james?
When you write :" You would need to define an appropriate datasource in
config.xml, ..."
Is it the same operation that you do for use DB with repertory or are you
talking about anything else?

Thanks Noel

-Pierre


-----Message d'origine-----
De : Noel J. Bergman [mailto:noel@devtech.com]
Envoyé : vendredi 14 février 2003 19:18
À : James Users List
Objet : RE: Log into a DB


> Yes, but I'm not sure what the change is off-hand.

Found it.  See:
http://avalon.apache.org/api/org/apache/avalon/excalibur/logger/factory/JDBC
TargetFactory.html

It appears that you add:

  <jdbc id="database">
    <datasource>java:/LogTargetDataSource</datasource>
    <normalized>true</normalized>
    <table name="LOG">
      <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>

and then point logs at the database target instead of one of the file
targets.

You would need to define an appropriate datasource in config.xml, and
probably pre-define the table.  Unfortunately, you'll probably need to read
the source code to figure it all out.

	--- Noel

-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Friday, February 14, 2003 6:10
To: James
Subject: Log into a DB

Hi,

How can I put the informations catch by logger defines in the assembly file
into a DB (I use MySQL with windows)?

Have a nice day,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Log into a DB

Posted by Scherer Pierre <sc...@ibelgique.com>.
Is it possible to change this code in the source version of james?
Because I have find the .class but not the java file of TargetFactory.
Must I re-compile Phoenix after (perhaps, will it be more easy to use Log4J
directly in the maillets?) and before compile back james?
When you write :" You would need to define an appropriate datasource in
config.xml, ..."
Is it the same operation that you do for use DB with repertory or are you
talking about anything else?

Thanks Noel

-Pierre


-----Message d'origine-----
De : Noel J. Bergman [mailto:noel@devtech.com]
Envoyé : vendredi 14 février 2003 19:18
À : James Users List
Objet : RE: Log into a DB


> Yes, but I'm not sure what the change is off-hand.

Found it.  See:
http://avalon.apache.org/api/org/apache/avalon/excalibur/logger/factory/JDBC
TargetFactory.html

It appears that you add:

  <jdbc id="database">
    <datasource>java:/LogTargetDataSource</datasource>
    <normalized>true</normalized>
    <table name="LOG">
      <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>

and then point logs at the database target instead of one of the file
targets.

You would need to define an appropriate datasource in config.xml, and
probably pre-define the table.  Unfortunately, you'll probably need to read
the source code to figure it all out.

	--- Noel

-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Friday, February 14, 2003 6:10
To: James
Subject: Log into a DB

Hi,

How can I put the informations catch by logger defines in the assembly file
into a DB (I use MySQL with windows)?

Have a nice day,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org

_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Log into a DB

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Yes, but I'm not sure what the change is off-hand.

Found it.  See:
http://avalon.apache.org/api/org/apache/avalon/excalibur/logger/factory/JDBC
TargetFactory.html

It appears that you add:

  <jdbc id="database">
    <datasource>java:/LogTargetDataSource</datasource>
    <normalized>true</normalized>
    <table name="LOG">
      <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>

and then point logs at the database target instead of one of the file
targets.

You would need to define an appropriate datasource in config.xml, and
probably pre-define the table.  Unfortunately, you'll probably need to read
the source code to figure it all out.

	--- Noel

-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Friday, February 14, 2003 6:10
To: James
Subject: Log into a DB

Hi,

How can I put the informations catch by logger defines in the assembly file
into a DB (I use MySQL with windows)?

Have a nice day,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: Log into a DB

Posted by "Noel J. Bergman" <no...@devtech.com>.
Yes, but I'm not sure what the change is off-hand.  The docs for
NormalizedJDBCTarget are sparse at best.  Best to ask on the Avalon mailing
list: users@avalon.apache.org.

	--- Noel

-----Original Message-----
From: Scherer Pierre [mailto:scherer_pierre@ibelgique.com]
Sent: Friday, February 14, 2003 6:10
To: James
Subject: Log into a DB

Hi,

How can I put the informations catch by logger defines in the assembly file
into a DB (I use MySQL with windows)?

Have a nice day,

-Pierre


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org