On Tue, 2005-10-04 at 13:55 +0100, Colm MacCarthaigh wrote:
> On Tue, Oct 04, 2005 at 08:37:08AM -0400, Brian Akins wrote:
> > In this case, from my patches:
> >
> > LogFormat "INSERT INTO foo VALUES ('%h', '%l');" foo-sql
> >
> > CustomLog mysql://user:[EMAIL PROTECTED]/database foo-sql
> >
> > and the mysql module would get the arrays of strings and lengths. at
> > init time, it would have prepared the format sql. At log time, it would
> > bind and execute.
>
> No, I don't think it's so simple at all. Although it would have to parse
> the SQL at init time (how does LogFormat know to ask the MySQL provider
> to do this?) that can't be simply untied from the actions at log-time;
> in the case of SQL for example you have to be very pedantic about the
> escaping, so that a request for "/foo\'; nasty sql;" doesn't kill us. Well, I think you can do something like this: LogFormat "%h %l" foo MySQLFormat "INSERT INTO bar SET hostname = '$1', logname = '$2'" bar MySQLHost mysql0 localhost CustomLog mysql://mysql0/bar foo Then ap_mysql_log_writer would do it's own processing of strs/strl combo. > And we still need additional per-provider directives to provide the > database, hostname, username and so on information. That's true. > If such directives are required anyway, what effort are we saving? > Why not just replace mod_log_config rather than plug into it. Because there is a lot more stuff which needs to be reimplemented in mod_log_config and which can be reused in other modules. Ondrej. -- Ondrej Sury <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part
