stop logs file
stop logs file
hi,
how i can remove and stop all logs file like e.g. for each domain who make really big files and kill my hdd ?
Thanks.
how i can remove and stop all logs file like e.g. for each domain who make really big files and kill my hdd ?
Thanks.
Re: stop logs file
It's not good idea, but if you like it, do it ;-)
Most size of logs - apache2 and nginx - you can disable those.
There is not one option, but simple way - config file.
/etc/apache2/apache2.conf
and you must comment out any ErrorLog and CustomLog directives in your Apache configuration files
Same way for nginx, replace access_log/error_log in your nginx configuration files
Once the changes are made, run /etc/init.d/apache2 restart and /etc/init.d/nginx restart for the changes to take effect.
Most size of logs - apache2 and nginx - you can disable those.
There is not one option, but simple way - config file.
/etc/apache2/apache2.conf
Code: Select all
LogLevel crit
Same way for nginx, replace access_log/error_log in your nginx configuration files
Code: Select all
access_log off;
error_log off;
Re: stop logs file
Much better way is to use logrotate and limit size of your logs.. look at your /etc/logrotate.d/ folder and edit files to add limits
1 megabyte:
and rotate faster ;-)
1 megabyte:
Code: Select all
size 1M
Code: Select all
rotate 14
Re: stop logs file
skurudo wrote:Much better way is to use logrotate and limit size of your logs.. look at your /etc/logrotate.d/ folder and edit files to add limits
1 megabyte:and rotate faster ;-)Code: Select all
size 1M
Code: Select all
rotate 14
etc/logrotate.conf this ?
my logrotate.conf file content is:
Code: Select all
# see "man logrotate" for details
# rotate log files weekly
weekly
# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
Code: Select all
/var/log/apache2/domains/domain.com.error.log {
missingok
daily
create 0660 root root
rotate 1
size 2M
}
Thanks.
Re: stop logs file
CentOS?vestacp89 wrote: etc/logrotate.conf this ?
my logrotate.conf file content is:
this is it ? i need run cron ?
See this topic, it's pretty full with examples and explanation:
http://stackoverflow.com/questions/2016 ... r-all-logs
Re: stop logs file
ubuntu 14.04skurudo wrote:CentOS?vestacp89 wrote: etc/logrotate.conf this ?
my logrotate.conf file content is:
this is it ? i need run cron ?
See this topic, it's pretty full with examples and explanation:
http://stackoverflow.com/questions/2016 ... r-all-logs
Re: stop logs file
/etc/logrotate.dvestacp89 wrote:skurudo wrote:vestacp89 wrote: ubuntu 14.04