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
3
votes
3 answers

logrotate: can you run postrotate even if log isn't rotated?

I have a backup script (backup.sh) that ssh's into another machine, compresses a file, and then scp's this file (backup_data.tar.gz) back to my local machine. I also have a logrotate file on my local machine: /opt/backups/backup_data.tar.gz { …
drewyupdrew
  • 1,549
  • 1
  • 11
  • 16
3
votes
0 answers

Best way to rotate Rails log files daily in 2015

What is the best way to rotate Ruby on Rails log files daily? I saw posts in the past. They recommended using logrotate and enable copytruncate option to avoid restarting Rails. However, logs are lost at small time slice between copying the file and…
ma2gedev
  • 151
  • 6
3
votes
1 answer

I'm stuck on logrotate mystery

I have two logrotate files: /etc/logrotate.d/nginx-size /var/log/nginx/*.log /var/log/www/nginx/50x.log { missingok rotate 3 size 2G dateext compress compresscmd /usr/bin/bzip2 compressoptions -6 compressext .bz2 …
d.ansimov
  • 2,131
  • 2
  • 31
  • 54
3
votes
2 answers

Gunicorn holding onto old logs after logrotate

I am using logrotated to rotate gunicorn access logs. This is my logrotated configuration /opt/api/log/access.log { daily rotate 10 missingok notifempty compress sharedscripts postrotate killall -s USR1 gunicorn …
bwbrowning
  • 6,200
  • 7
  • 31
  • 36
3
votes
1 answer

Logrotate in CentOS, maxsize option

I'm working with logrotate in Centos 6.4 and wanted to rotate the logs daily or when they reach 50MB. The only problem i'm facing is that the version of logrotate for CentOS is 3.7.8, which does not have the maxsize option i need to use. Is there…
noidraug
  • 219
  • 1
  • 9
3
votes
2 answers

Rotate other logs to Amazon S3

I'm using Amazon Beanstalk for my Symfony2.1 app (using Linux AMI with Apache) and I activated Log file rotation to Amazon S3. All is working properly, but I ant to know if there are any way to add other logs (that are in other locations) to the…
2
votes
1 answer

Apache httpd rotatelogs: is it possible to create a new file every day?

I want to make a new logs for my website every 00:00:01 (= each new day). The problem with rotatelogs is that you can either precise the max size of the logs before creating a new one, or precise the rotation time in seconds. It's not possible to…
user292916
2
votes
0 answers

linux log rotate for PostgreSQL not rotate the log when log reached threshold

I am trying to the setup and control PostgreSQL logs by Linux log rotate as the following logrotate_PostgreSQL.conf file looks like this /var/log/PG/*.log { size 10K rotate 10 copytruncate missingok delaycompress nomail …
Judy
  • 1,595
  • 6
  • 19
  • 41
2
votes
1 answer

Logrotate of /var/log/messages files

How can I set log rotate to, /var/log/messages files, all the files with the name "messages", rotate every 4 days (to keep last 4 files), not to generate any error messages?? /var/log/messsages-* { dateext maxage 3 rotate 4 missingok nocompress } Is…
2
votes
1 answer

Rotate custom logs on AMI Linux 2

I need to rotate my Resque logs on AWS Elastic Beanstalk on AMI Linux 2 with Ruby. My Puma and Nginx logs rotate properly. I've added the following config below, but the logs are not getting rotated. .ebextensions/03_publish-logs.config files: …
fnllc
  • 3,047
  • 4
  • 25
  • 42
2
votes
1 answer

Async Log4J2 and logrotate not working correctly (truncate is broken)

I am using Log4J2 async logger to log my Java application and I'm using logrotate to store the old logs everyday. Previously, I was using Log4J2 synchronously and everything worked fine; since I switched to async logging logrotate stopped working…
gscaparrotti
  • 663
  • 5
  • 21
2
votes
3 answers

How to setup MongoDB log rotation on Windows?

I have a conf file for mongod where I am trying to set log rotation, the log file size, and the number of old instances to be kept. I have added logRotate: rename to the conf file as follows: systemLog: timeStampFormat: ctime destination: file …
Brian
  • 4,958
  • 8
  • 40
  • 56
2
votes
1 answer

Why is MongoDB not rotating the logs using logrotate?

MongoDB/logrotate seems to be failing to rotate the logs and I'm not sure why. Here is my configuration: In the /etc/mongod.conf: systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log logRotate:…
vinayman
  • 572
  • 1
  • 5
  • 10
2
votes
1 answer

Null value in the beginning of log after logrotate

I am using logrotate to manage my logs. As I have to manage a bunch of log files. My logrotate config looks like /log/typeA*.log /log/typeB*.log /log/typeC*.log{ daily rotate 7 copytruncate size 1M compress …
Pranjal Doshi
  • 862
  • 11
  • 29
2
votes
0 answers

How to configure log rotate for Gunicorn running as a systemd service within a venv behind an Nginx reverse proxy?

I can't figure out how to cleanly configure log rotation for my python app (served by Gunicorn 20.0.4 behind an Nginx reverse proxy). Official Gunicorn documentation states: Send the USR1 signal to rotate logs if you are using the…
donmelchior
  • 893
  • 3
  • 13
  • 31