//dblog interface version 1 // //The log modules connecting to mod_mylog MUST include a structure of type //LogModule, this structure tells the central loging module where it can find //the functions required for loging. // //If you have ever hacked apache modules you know this style of API. #ifdef __cplusplus extern "C"{ #endif #include "httpd.h" //the keywords used for connectong to a database. #define DBLOG_USER_PARAM "user" #define DBLOG_PWD_PARAM "pwd" #define DBLOG_DBHOST_PARAM "host" #define DBLOG_PORT_PARAM "port" #define DBLOG_DBNAME_PARAM "db" #define DBLOG_USOCKET_PARAM "socket" //for mysql #define DBLOG_CONN_TYPE_PARAM "connect" //for ecpg typedef struct Log_Module{ //init is called on apache startup, in fact it does nothing ordinary //seting initial values, maybe loading extra files, etc... int (*init) (pool*); //destroy should be called at apache shutdown just to have a nice //shutdown. Currently, noone calls it, this would be trouble with a //RDBMS different than MySQL (I mean an RDMBS that does transactions) //if the log module send sommit command to the backend only after N //requests (in this case the last, max. N-1 request loging is canceled). int (*destroy) (void); //This is for future use. Central module will have a ConnectOnStart //directive, that tells the module to connect to the database //immediately. If the flag is set On, the central module will //instruct log modules to connect at startup time with this interface //function. int (*connect) (table*); //Should log the request passed to it to the connection described with //the second parameter. int (*log) (request_rec*, table*); }LogModule; #ifdef __cplusplus }; #endif