23

Can someone tell me where is located the log file for vsftpd? I'm trying to learn how to install and configure a ftp server and I can't seem to find the log file. Can anybody tell me how to configure the service to make a log file or where is located?

andrew.46
  • 37,085
  • 25
  • 149
  • 228
Caranfil Alegzandru
  • 639
  • 3
  • 7
  • 14

3 Answers3

26

The log file for Ubuntu by default is /var/log/vsftpd.log. The setting is in /etc/vsftpd.conf

The default could be modified by specifying a different pathname (/etc/vsftp.conf entry):

# You may override where the log file goes if you like. The default is shown
# below.                     
#xferlog_file=/var/log/vsftpd.log 
andrew.46
  • 37,085
  • 25
  • 149
  • 228
L. D. James
  • 24,768
  • 10
  • 68
  • 116
  • 1
    If you'd like to view a live, realtime log of all events happening on the FTP server, do `tail -f vsftpd.log`. Tail is a program that displays the 'tail' of a file, `-f` tells it to follow any data appended to the file, in this case, any new log entries in the ftp log `vsftpd.log`. – skybldev Oct 15 '18 at 18:48
5

The logging of vsftpd is a bit more complex than other responses show. There are three logging mechanism, here is an example config of /etc/vsftpd.conf where I have added some comments for self-explanation:

# Below verbose log is for transfer/upload, formatted for common tools stats.
# Use command: tail -f /var/log/xferlog
xferlog_enable=YES
xferlog_file=/var/log/xferlog
xferlog_std_format=YES

# Below verbose log is for FTP commands and responses.
# By default, logs were written to syslog instead of file.
# Use command: tail -f /var/log/vsftpd.log
# Use command: logread -f
log_ftp_protocol=YES
vsftpd_log_file=/var/log/vsftpd.log
syslog_enable=NO

# Allow log 1 and 2 to be written simultaneously.
dual_log_enable=YES

Once modified at your discretion, you must do a: service vsftpd restart

Due to the amount of logging generated, you might want to disable it as soon as you are finished debugging. More specifically, reverting to syslog_enable=YES will move back to logging into RAM ringbuffer in OpenWrt and avoid wear out flash.

JCM
  • 151
  • 1
  • 2
2

Sometimes it happens that the log is not filling any data, because the file doesn't exist. Create a log file:

touch /var/log/vsftpd.log

Then

service vsftpd restart
Eskander Bejaoui
  • 2,405
  • 1
  • 22
  • 30
  • 1
    The touch /var/log/vsftpd.log shouldn't be necessary. If it is needed, it should be a sign that there is a problem with the vsftpd installation or configuration. The log file should automatically be created if it doesn't exist. I tested it to make sure this would indeed be the case, by renaming the /var/log/vsftpd.log. It was automatically recreated to log the vsftpd activity. The recreating is the same thing that happens when the log file is rotated... moved to /var/log/vsftpd.log.1. – L. D. James Sep 12 '18 at 23:40