0

Proftpd 1.3.5e Server on Ubuntu 18.04 LTS.

How do I set up verbose logging for ProFTPd such that the ftp USER and filename and IP address and timestamp all show up on one line? For each file name uploaded and/or downloaded? One line per file?

Thanks!

user3055756
  • 145
  • 2
  • 10

1 Answers1

2

There are two ways you might achieve this. The easiest is to configure a TransferLog directive in your proftpd.conf:

TransferLog /var/log/proftpd/xfer.log

The format of this log file is fixed; see xferlog(5) for details. But the format does include the fields you requested.

Alternatively, you can use ProFTPD's more sophisticated LogFormat directive to specify your own log format, and then the ExtendedLog directive to use that LogFormat for writing to a specific file, e.g.

LogFormat custom "%{iso8601} %u %f %a"
ExtendedLog /var/log/proftpd/custom.log READ,WRITE custom

Hope this helps!

Castaglia
  • 2,972
  • 5
  • 28
  • 49
  • weet! Perfect! Works like a charm! I used your second suggestion and it works right out of the box. I realize this was not part of the original ask, but the first upload I tested with this failed with permission denied because I was uploading onto a file owned by root. Is there a % letter that describes the status of the request in the logfile? Failed or success? – user3055756 Apr 20 '20 at 22:33
  • There is the `%{transfer-status}` LogFormat variable for the transfer status; see the [`LogFormat`](http://www.proftpd.org/docs/modules/mod_log.html#LogFormat) docs for the full list of supported variables. – Castaglia Apr 21 '20 at 01:17