/var/log full

Topics about the Software of Revolution Pi
Post Reply
User avatar
hakaies
Posts: 13
Joined: 27 Apr 2021, 21:10
Location: Vancouver Island, Canada
Contact:

/var/log full

Post by hakaies »

I am developing some PHP web pages that run directly on my RevPi Connect 4 4GB/32GB. I noticed this morning that the apache logs had filled up the /var/log mount.
I realize this is more of a general linux sysadmin question. I am looking for suggestions on how best to resolve this. Expand /var/log volume? Is log rotate executing properly?

Code: Select all

pi@RevPi106266:/var/log $ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root       29719904 3529868  24931316  13% /
devtmpfs         1907836       0   1907836   0% /dev
tmpfs            1942588       0   1942588   0% /dev/shm
tmpfs             777036   77320    699716  10% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs              51200   51200         0 100% /var/log
/dev/mmcblk0p1    261108   31850    229258  13% /boot
tmpfs             388516      20    388496   1% /run/user/1000

pi@RevPi106266:/var/log $ sudo du -h
20K     ./cups
0       ./private
0       ./samba
0       ./ntpstats
0       ./lightdm
0       ./fsck
60K     ./apt
49M     ./apache2/revpi
49M     ./apache2
50M     .
tboehler
KUNBUS
Posts: 2
Joined: 02 May 2023, 16:22

Re: /var/log full

Post by tboehler »

Hello hakaies!

I generally view 50M of logs as quite a lot. We do ship configuration files for logrotate that rotate files for apache daily, keeping 14 days of logs compressed on disk.

How much is your application logging? If it's a lot, try tuning your logging parameters to log less information (i.e. decrease the logging level).
Do the logs indicate some form of error that might be written over and over that is accumulating in the logs?

If there are no errors and your application can't or shouldn't be logging less, you can, as a last resort, customize the apache configuration for logrotate in

Code: Select all

/etc/logrotate.d/apache2
to keep less than 14 days of logs, for example only 7 days might be fine for your use case, or tune another parameter at your will. For more information on the format of logrotate configuration files have a look at

Code: Select all

logrotate(8)
(

Code: Select all

man 8 logrotate
).

That would be my approach. I hope this helped!
Post Reply