Gabriel Menini [EasyLabs] | 10 May 2007 20:21

Adding new items to log

Hello, list.

I wonder if is possible to add more fields to the log generated by 
mod_log_sql.

I want to add thr %X Apache default log facility field.

T.I.A.
--

-- 
Gabriel Menini		<gabriel.menini@...>
EasyLabs
_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe@...

Thomas Goirand | 24 May 2007 17:49
Picon

I need to know if using MySQL or pgsql for my score board patch and pgsql

Hi!

I need to resolve the bug that somebody submited against my Debian
package that is currently in SID. Have a look here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425027

My problem is that I need to know in mod_log_sql.c what type of SQL
backend is used. How to test?

Note that it's possible to get the current version of my
libapache-mod-log-sql Debian package in SID using "apt-get source
libapache-mod-log-sql", and that the package also works in Lenny or
Etch. It can also be downloaded using this link:

http://packages.debian.org/unstable/source/libapache-mod-log-sql

Any help would be appreciated.

Best regards,

Thomas Goirand
_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe@...

Edward Rudd | 24 May 2007 22:25
Favicon
Gravatar

Re: I need to know if using MySQL or pgsql for my score board patch and pgsql

The ideal solution for this is to move the SQL query into the backend,  
by adding a new function to backend driver.

Quoting Thomas Goirand <thomas@...>:

> Hi!
>
> I need to resolve the bug that somebody submited against my Debian
> package that is currently in SID. Have a look here:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425027
>
> My problem is that I need to know in mod_log_sql.c what type of SQL
> backend is used. How to test?
>
> Note that it's possible to get the current version of my
> libapache-mod-log-sql Debian package in SID using "apt-get source
> libapache-mod-log-sql", and that the package also works in Lenny or
> Etch. It can also be downloaded using this link:
>
> http://packages.debian.org/unstable/source/libapache-mod-log-sql
>
> Any help would be appreciated.
>
> Best regards,
>
> Thomas Goirand
> _______________________________________________
> Download the latest version at   
> http://www.outoforder.cc/projects/apache/mod_log_sql/
(Continue reading)

James Cloos | 25 May 2007 16:37
Face
Favicon

Re: I need to know if using MySQL or pgsql for my score board patch and pgsql

>>>>> "Edward" == Edward Rudd <urkle@...> writes:

Edward> The ideal solution for this is to move the SQL query into the
Edward> backend, by adding a new function to backend driver.

I don't beleive that is an option in this case, since, AIUI, mysql only
added stored procedures in the latest version, yes?

The original, mysql-specific query he used is:

,----
| insert ignore into %s (domain,vhost,month,year,count_impressions)
|        values ('%s','%s','%s','%s','0')
`----

I discovered that this works on postgres, w/o having to change any of
the rest of his patch:

,----
| begin;insert into %s (domain,vhost,month,year,count_impressions)
|       values ('%s','%s',%s,%s,0);commit
`----

Ie, s/insert ignore/insert/ and wrap in a transaction.

I discovered this issue using mod_log_sql as packaged in debian with the
dbi backend and the libdbd-pgsql driver for libdbi.  Debian also
packages a libdbd-sqlite driver, so the final solution needs to work on
at least mysql, pgsql and sqlite.

(Continue reading)

Thomas Goirand | 25 May 2007 17:46
Picon

Re: Bug#425027: I need to know if using MySQL or pgsql for my score board patch and pgsql

James Cloos wrote:
> The original, mysql-specific query he used is:
> 
> ,----
> | insert ignore into %s (domain,vhost,month,year,count_impressions)
> |        values ('%s','%s','%s','%s','0')
> `----
> 
> I discovered that this works on postgres, w/o having to change any of
> the rest of his patch:
> 
> ,----
> | begin;insert into %s (domain,vhost,month,year,count_impressions)
> |       values ('%s','%s',%s,%s,0);commit
> `----
> 
> Ie, s/insert ignore/insert/ and wrap in a transaction.

Hi!

I tried to to this with the MySQL backend driver, and unfortunately,
mod_log_sql was returning an error in the apache error.log. I was
surprised about it as the MySQL documentation said that it should work.

> Also, you may want to use global_config.driver->insert() instead of
> using safe_sql_insert() to execute the insert.  I've not investigated
> the differences, so I cannot be sure, though.

The advantage of safe_sql_insert() is that when it fails, the query goes
in a preserve file. Later, when the insert works again, then this file
(Continue reading)

Raymond T. Sundland | 25 May 2007 21:30

Re: Bug#425027: I need to know if using MySQL or pgsql for my score board patch and pgsql

There simply needs to be an if... then... else that determines which SQL query to run based on the backend defined in httpd.conf.....  or a way to define a custom INSERT startment within httpd.conf that would be compatible with any SQL system.

Thomas Goirand wrote:
James Cloos wrote:
The original, mysql-specific query he used is: ,---- | insert ignore into %s (domain,vhost,month,year,count_impressions) | values ('%s','%s','%s','%s','0') `---- I discovered that this works on postgres, w/o having to change any of the rest of his patch: ,---- | begin;insert into %s (domain,vhost,month,year,count_impressions) | values ('%s','%s',%s,%s,0);commit `---- Ie, s/insert ignore/insert/ and wrap in a transaction.
Hi! I tried to to this with the MySQL backend driver, and unfortunately, mod_log_sql was returning an error in the apache error.log. I was surprised about it as the MySQL documentation said that it should work.
Also, you may want to use global_config.driver->insert() instead of using safe_sql_insert() to execute the insert. I've not investigated the differences, so I cannot be sure, though.
The advantage of safe_sql_insert() is that when it fails, the query goes in a preserve file. Later, when the insert works again, then this file is read and the insert statements are commited. I have found this very nice, the only "problem" that I found is that this file is writen in /etc while I think it should have been write somewhere in /var, possibly in /var/lib/mod_log_sql. I think I should patch mod_log_sql to act like this, and create the /var/lib/mod_log_sql folder in my debian packaging. Currently, the package doesn't create the folder in /etc/apache2 so it just writes in the error.log that writing in the preserve file didn't work. Somebody could even have written a bug report about this issue, I just didn't had the time to patch mod_log_sql to correct this yet. Edward: do you think it would be possible that future versions of mod_log_sql writes in /var rather than in /etc to be compliant with the filesystem standards? Also for Edward: I would have love to take the advantage of the new thing you did in mod_log_sql 1.101 so my score_board patch could calculate bytes out AND bytes in. Would you have time to help me to write this, and support that new 1.101 (if not write it)? I'm currently working on some other things (virtual private server statistics for I/O, network and CPU inside our control panel) that we are in a hurry to finish... Thomas _______________________________________________ Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/ To unsubscribe send an e-mail to mod_log_sql-unsubscribe-7qY7E20V6GW73k+5HYS8LQqVMODqnSLI@public.gmane.org
_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe@...

Gmane