Questions tagged [logrotate]

A Linux tool for log files management. Do not use this tag for general questions about usage of logrotate and troubleshooting, but for programming questions related to logrotate.

Quoting the man page:

logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

469 questions
5
votes
1 answer

logrotate error file or directory not found

I have a logrotate conf: /myapps/log.log { missingok notifempty rotate 9 copy } then when I run /usr/sbin/logrotate -d -f logrotate.conf it gives error: renaming /myapps/log.log.2 to /myapps/log.log.3 (rotatecount 2, logstart 1, i…
Jakim
  • 1,713
  • 7
  • 20
  • 44
5
votes
2 answers

How to configure Logrotate with dateext and extension

I tried to configure logrotate to keep the date and the extension of the log being rotated: With the current configuration, the file: /var/www/redmine/log/production.log Is logrotated in : /var/www/redmine/log/production.-20160710log I was…
Fdv
  • 385
  • 2
  • 5
  • 14
5
votes
3 answers

Logrotate not compressing

We have syslogd set up to send all logs from a few different servers into one, all into a folder called /var/log/centrallogs. We're using the following log rotate config for this directory: /etc/logrotate.d/centrallogs: /var/log/centrallogs/*log { …
Mike McCormick
  • 121
  • 1
  • 1
  • 9
5
votes
4 answers

logrotate: delete tomcat/jboss logs older than n days

I haven't found a solution to purge old tomcat or jboss logs or any other timestamped logs: catalog.log./server.log.. Basically these logs are rotated by jboss as: server.log, server.log.20131201, server.log.20131203 and so on. Is there a way I can…
dOps
  • 730
  • 2
  • 7
  • 16
5
votes
1 answer

Unlimited logs with logrotate

In a normal logrotate.d configuration file, is there any way to set an unlimited amount of potential logs? The only thing I can seem to come up with is setting it at some crazy number that will never be met. Something like: /var/log/app/* { …
stewbert
  • 51
  • 1
  • 5
4
votes
0 answers

Apache restart every midnight by itself causing apscheduler task to not complete

Hi I have a Pyramid wsgi webapp served using Apache. The webapp has an hourly job that must be run at the 0th min to fetch time-sensitive data and write to my mysql database. I note that sometimes (not all times) the data might not be written into…
minovsky
  • 857
  • 1
  • 15
  • 28
4
votes
1 answer

Why does rsyslog fail to start after logrotate?

At midnight, a cronjob initiates logrotate to rotate 4 key log files. These 4 log files are also being sent to a log aggregation server by rsyslog. Despite running the rsyslog logrotate command after each log is rotated, sometimes, the server…
turtlefranklin
  • 509
  • 6
  • 14
4
votes
4 answers

Detecting broken stream in python when file is deleted

My problem is that logging stops for a python program when the log is rotated. I have tracked it down to the stream itself. I don't see any way to tell if the stream is broken from python. After the file is deleted it still accepts writes without…
Bryan Austin
  • 487
  • 3
  • 13
4
votes
1 answer

How to rotate logs in laravel using logrotate?

Deployed my laravel application few months ago, and recently found out that my application was unable to write to log because my disk was full. When i checked i found out that the laravel.log file was almost huge. I want to know how to rotate the…
brieno
  • 43
  • 1
  • 6
4
votes
1 answer

logrotate: error opening .gz

I'm now setting up logrotate on ubuntu to rotate logs. This is my config: /etc/logrotate.d/test: /var/log/test/*.log{ weekly rotate 7 compress delaycompress notifempty create 640 testuser testgroup } In /var/log/test, it has following…
suanziliu
  • 137
  • 10
4
votes
0 answers

How to come out of error switching euid to 0 and egid to 108 operations not permitted?

I tried to run the command logrotate -f /etc/logrotate.conf and it showed me the error error switching euid to 0 and egid to 108: operations not permitted and i want to run the logrotate file
jenny
  • 500
  • 7
  • 22
4
votes
2 answers

syslog stops logging after log rotation

Every time after newsyslog rotates the log file, syslog stops logging into the file. Until a syslogd restart is done. (myserver:wheel)# logger -p local1.info -t myprocess "hello thiru"; ll myfile.log; cat myfile.log -rw-r--r-- 1 root wheel 0B…
Thirupathi Thangavel
  • 2,418
  • 3
  • 29
  • 49
4
votes
2 answers

Nginx logging to access.log.1 instead of access.log

I know this has been asked before, but I believe this is a different issue. Nginx runs under www-data: $ ps -eo "%U %G %a" | grep nginx root root nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data www-data nginx:…
user1950164
4
votes
1 answer

How to change settings for logrotate in AWS Elastic Beanstalk docker instances

I realized that the default logrotation for AWS EB's docker is 5 files of 10M each. That's not enough for me. I found the config at /etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.applogs.conf and it reads as follows: $ cat…
4
votes
1 answer

How does Nginx restart after being killed by log-rotate?

In /etc/logrotate.d/nginx I find: /var/log/nginx/*.log { daily missingok rotate 52 compress delaycompress notifempty create 640 nginx adm sharedscripts postrotate [ -f /var/run/nginx.pid ] && kill -USR1…
J. Doe
  • 43
  • 1
  • 4