ispCP - Board - Support
Add proftp xferlog to MySQL - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: Add proftp xferlog to MySQL (/thread-3193.html)



Add proftp xferlog to MySQL - Lordek - 05-03-2008 07:08 PM

Hi!

I am triying to write the proftpd log in a table.

I have created the following table with this sql expression:

Code:
CREATE TABLE `ftpxferlog` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `username` VARCHAR(30) NOT NULL DEFAULT '',
  `filename` text,
  `size` bigint(20) DEFAULT NULL,
  `host` tinytext,
  `ip` tinytext,
  `action` tinytext,
  `duration` tinytext,
  `localtime` timestamp NULL DEFAULT NULL,
  `success` BOOL NOT NULL DEFAULT '0',
  PRIMARY KEY  (`id`),
  KEY `idx_usersucc` (`username`, `success`)
)

and i have added in /etc/proftpd/proftpd.conf the following lines at bottom
Code:
# xfer log in mysql
SQLLog RETR,STOR transfer1
SQLNamedQuery transfer1 INSERT "NULL, '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), '1'" ftpxferlog

SQLLOG ERR_RETR,ERR_STOR transfer2
SQLNamedQuery transfer2 INSERT "NULL, '%u', '%f', '%b', '%h', '%a', '%m', '%T', now(), '0'" ftpxferlog

But I check with pma and nothing is added. The connection trought mysql is well configured (i've keep it by default).

Why proftpd doesn't add rows to the table?

PD: sorry for my poor english ._.U