2

Can I disable the logging features for any app running under Ubuntu?

I want to make my system totally logless is it possible?

Maythux
  • 84,289

2 Answers2

1

If you want to disable all logs:

Run this command to stop the log daemon.

sudo stop rsyslog 

To disable starting the daemon from boot create a file called /etc/init/rsyslog.override with a line containg the word "manual"

You can do this with the following command:

sudo -H gedit /etc/init/rsyslog.override

Now add the word

manual

Then save and exit.

Or do it in single command:

echo "manual" | sudo tee --append /etc/init/rsyslog.override
muru
  • 197,895
  • 55
  • 485
  • 740
Maythux
  • 84,289
0

tmpfs can be used for log/tmp/spool directories. Then after reboot, they are totally cleared. https://en.wikipedia.org/wiki/Tmpfs

$ sudo vim /etc/fstab      
tmpfs /tmp tmpfs defaults,noatime,size=2024M,mode=1777 0 0            
tmpfs /var/spool tmpfs defaults,noatime,size=512M,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,size=512M,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,size=512M,mode=0755 0 0
  • How tmpfs is related to log files?! – Maythux Jun 17 '15 at 08:22
  • If you mount /var/log as tmpfs, then after reboot, the logs restart from zero. So harddisk is logless. But isn't disabled totally then ofcourse. Totally logless means then disabling all logging in all configurations (rsyslog, apache, jboss, tomcat7, mysql, mongodb, ...) – aldwinaldwin Jun 17 '15 at 08:27