Koozali.org: home of the SME Server

Disable or remove certain logging

Offline rmoria

  • ****
  • 78
  • +0/-0
    • http://www.osvorca.nl
Disable or remove certain logging
« on: January 25, 2018, 01:05:16 PM »
Hi,

I am using FTP from a webcam to transfer snapshots to my server. The problem is that it doesnt keep the connection open en opens a new one every time I upload a file (every 5 seconds). All ftp connections are logged in messages, so it is filled with those.
Is there any way to stop ftp from logging or a way to remove them from messages ?
...
Yes, I can ask more questions then you can answer  8-)
...

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Disable or remove certain logging
« Reply #1 on: January 25, 2018, 07:04:11 PM »
proftpd send this to syslog. Depending on the line, one can configure syslog to send this to a different file.

Can you post here an example of the line in your message log ?

Offline rmoria

  • ****
  • 78
  • +0/-0
    • http://www.osvorca.nl
Re: Disable or remove certain logging
« Reply #2 on: January 26, 2018, 08:46:52 AM »
Sure, here is a small snip

Code: [Select]
Jan 25 20:15:56 nathan proftpd[3794]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - FTP session opened.
Jan 25 20:15:56 nathan proftpd[3794]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - Preparing to chroot to directory '/home/e-smith/files/users/XXXXXX/home'
Jan 25 20:15:56 nathan proftpd[3794]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - FTP session closed.
Jan 25 20:16:06 nathan proftpd[3865]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - FTP session opened.
Jan 25 20:16:06 nathan proftpd[3865]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - Preparing to chroot to directory '/home/e-smith/files/users/XXXXXX/home'
Jan 25 20:16:06 nathan proftpd[3865]: 10.0.0.1 (10.0.0.229[10.0.0.229]) - FTP session closed.

(I changed the upload time to 10 seconds)
« Last Edit: January 26, 2018, 08:50:15 AM by rmoria »
...
Yes, I can ask more questions then you can answer  8-)
...

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Disable or remove certain logging
« Reply #3 on: January 26, 2018, 04:12:01 PM »
Then you can create a custom template for /etc/rsyslog.conf in order to redirect proftpd logs to another file.

It hasto be prior to the line for messages log. Should be something like this:

proftpd               /var/log/proftpd/proftpd.conf



Then you need to create the folder and file with correct permissions.

Then you need to create a logrotate rule in /etc/logrotate.d/. You can check files there to create your own on the same way, or refer to the man page.