Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [log-rotation]

Log rotation is an automated process used in system administration in which dated log files are archived.

1
vote
1answer
15 views

What does the --force flag change about the behaviour of logrotate?

I am trying to find out why logrotate is only rotating a subset of logfiles in a folder when run without the --force flag. The man page for logrotate --force simply says: Tells logrotate to force ...
0
votes
1answer
17 views

Name rotated auditd logs with date

Can auditd use a date instead of an integer to name its rotated audit logs? Right now I have audit.log audit.log.1 audit.log.2 ... When audit.log fills up all of the files are rotated one number ...
0
votes
1answer
44 views

where is rotation policy of logs under /var/log/messages-*

I would like to know how messages log file /var/log/messages are rotated. I checked in /etc/logrotate.conf file and inside /etc/logrotate.d/ directory but nothing that could explain the rotation. ...
0
votes
1answer
81 views

Logrotate Separate Policies in Same Directory

I am running rsyslog on CentOS and logrotate to rotate my logs. All hosts write their logs to /var/log/syslog/ in their own separate directory in this manner: /var/log/syslog/host1 /var/log/syslog/...
0
votes
0answers
62 views

Does logrotate check diskspace before rotating a logfile?

I am trying to figure out how logrotate work regarding disk space but not able to figure it out? Scenario: Let say I have 2GB of the log file and free disk space is also 2 GB, does logrotate first ...
1
vote
1answer
352 views

How to rotate mySQL query logs on Windows

I'm seeing conflicting (or complementary) answers on how to rotate mySQL logs and want to know if each method is sufficient in itself, or if I need to use a combination of both. One method, suggested ...
1
vote
0answers
51 views

Glassfish - log System.err to second location or do something after logrotate

we have a GF4 server that produces a lot of logs. Currently it is setup like this: com.sun.enterprise.server.logging.GFFileHandler.excludeFields <> com.sun.enterprise.server.logging....
0
votes
0answers
24 views

Can newsyslog rotate user logs with wildcard paths?

I can setup newsyslog to rotate files matching a glob pattern using the G flag, but I want to rotate the user logs files from their http logs, and I can't figure out how to set the permissions for the ...
1
vote
1answer
680 views

logrotate status files extremely large

Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/...
0
votes
1answer
790 views

Logrotate with `copytruncate` “data loss” - is it serious?

Manpage of logrotate claims that using copytruncate option leads to "a very small time slice between copying the file and truncating it, so some logging data might be lost". Is it actually ...
0
votes
0answers
106 views

CentOS 6 - Logrotate Confusion

I'm trying to get logrotate to rotate some logs for me. I feel like this should be simple, but it doesn't seem to be behaving as I would expect. Here's my config: /path/to/log/files/specific_file /...
2
votes
0answers
751 views

Nginx log rotation according to size

I'm using below cfg for log rotation by size but it's not working. /var/log/nginx/access_log { rotate 7 size 5k dateext dateformat -%Y-%m-%d missingok compress ...
0
votes
3answers
1k views

Ideal log rotation configuration for overloaded site

I've been in charge of a server that has been stressed beyond its tipping point for some time. I've recommended changes that are currently in the process of being implemented by other members of the ...
1
vote
1answer
193 views

Apache log4j cloudstack log rotation archival policy

I am trying to limit the number of logs that are kept on my cloudstack management server. I am running log4j 1.2 and have recently added "<param name="MaxBackupIndex" value="31"/>" to my config (...
0
votes
1answer
1k views

logrotate when size reaches 10M

Please kindly advise/assist. I want to set up logrotate that does the following: when the log file size reaches 10M,the file is rotated and also there is no keeping of older compressed log files. I ...
0
votes
0answers
318 views

Use `tail` to rotate nginx logs in order have a single log file capped in size

Can use tail to rotate a nginx log file in orderer to have a single log file capped in size? tail -c 1000000 access.log > temp.log mv temp.log access.log kill -USR1 `cat /var/run/nginx.pid` The ...
4
votes
1answer
1k views

logrotate not writing logs to correct file

I have a production system on which there are multiple nginx apps hosted. those are nginx applications servers. Now for each of these nginx app servers a logrotate config file is configured in /etc/...
-1
votes
1answer
66 views

What is rotating my mail logs

In looking at my /var/log dir, I can see that my mail.log and mail.err files are being rotated. An increasing digit is appended to the the end of the logs every six days and after the second long, ...
0
votes
1answer
356 views

Logrotate failing with `No data available` error

I'm using logrotate for various log rotation tasks, including rotating log files for the postgresql pooling utility pgbouncer. pgbouncer logs expansively - I accumulate many GBs in a couple of days -...
1
vote
0answers
592 views

Logrotate not working with “daily”

Below is my logrotate configuration.I was not able to get the logrotate work using "sudo /usr/sbin/logrotate /etc/logrotate.conf".But if I execute "sudo logrotate -f /etc/logrotate.conf" it is ...
-1
votes
1answer
373 views

Logrotate is not working centos 6.6

I have the following configuration for logrotating the app logs. /opt/tomcat/logs/app-web.txt { copytruncate daily size 500M compress delaycompress rotate 0 missingok ...
0
votes
1answer
215 views

How to compress and remove olde compressed files using logrotate when the file has a date in its name?

I'm generating files daily named as my_file_YYYYMMDD.csv (for instance, my_file_20160406.csv, my_file_20160407.csv and so on). I want logrotate to compress them daily and that it keep just the last ...
0
votes
0answers
353 views

Logrotate does not work daily, but the status file says it does

This is my logrotate script: /var/log/pyApi.log /var/log/runGet*.log { daily missingok rotate 7 compress notifempty nocreate su } Already checked /var/lib/logrotate/...
-1
votes
1answer
3k views

(2)No such file or directory: AH00104: unable to start piped log program

Well sometimes apparently easy things turn into disaster. As soon as I add to the VirtualHost: CustomLog "|usr/sbin/rotatelogs -l ${APACHE_LOG_DIR}/01030/%Y%W_01030.access.log 604800" combined I ...
1
vote
0answers
83 views

Logrotation performance

One question about logrotation on a dedicated webserver (64gb RAM) with apache and mysql. In high load hours (2k users online every moment) we are experiencing a strange behaviour. As an example, at ...
1
vote
0answers
478 views

Rotation and continuous writing of large log files with rsyslogd

I have an extremely busy log file (let's call it /var/log/service.log) that is also frequently searched for troubleshooting reasons. Output to it is nearly continuous and 24/7. It probably puts out ...
1
vote
1answer
174 views

logrotation process stdout and stderr windows

I have a service on windows that's running another process that prints many lines to its STDERR and STDOUT. I'm capturing those lines and redirect them to some log file. I would like to logrotate on ...
2
votes
1answer
2k views

Syslog logging to syslog.1 not syslog

My syslog file is getting a bit unmanageable. I believed I had configured this previously to rotate daily but obviously something has gone amiss. At the moment, my /var/log looks like this: -rw-r----...
1
vote
1answer
518 views

NGINX and log rotation: is missing log entries possible?

In it's simplest realization, one can implement NGINX log rotation as following: mv access.log access.log.0 kill -USR1 `cat master.nginx.pid` My question. Do we have a concurrency issue here? I mean,...
0
votes
2answers
5k views

freebsd's newsyslog.conf daily logs rotate

I'm trying to utilize newsyslog.conf -- newsyslog(8) configuration file to rotate my apache/nginx/squid log files: # uname -a FreeBSD X 9.2-RELEASE-p17 FreeBSD 9.2-RELEASE-p17 #0 r282430: Mon May 4 ...
1
vote
2answers
461 views

/etc/init.d/apache2 file is being log rotated

I have monitored some strange behavior. Every week at logrotate process time, the apache2 daemon script /etc/init.d/apache2 is being rotated as if it was a log file. The first week it created another ...
4
votes
1answer
134 views

MongoDB Oplog Security

We are using a MongoDB replica set for sharing sessions and other (potentially sensitive) data in a web farm. All the data we store uses TTL indexes to expire documents after a relatively short ...
0
votes
1answer
396 views

Lighttpd stops writing to access.log

I have this issue with my lighttpd installation where logging to access.log will cease once the default log-rotating software erases my access.log after copying it to access.log-YYYYMMDD. I have to ...
0
votes
3answers
487 views

How can a script loop for 30 days?

I have a script, backup.sh, that creates a backup of a MySQL database and then SCPs it to a remote server. This works great, and I can run this once per day using crontab with no problems. However, ...
0
votes
1answer
278 views

Rotating logs with different names with logrotate

The logs name are appended with timestamp when generated like log-20140526-062503.txt Is there a way to manage this? I tried with a custom state file but log rotate does not delete old file. /var/...
0
votes
0answers
363 views

Apache logging: Are there any alternatives to piped logging that allow for automatic compression?

Are there any alternatives to Apache's rotatelog that will also compress logs? Logrotate is not an option due to requiring a restart. Ideally this would be a utility that can be used to pipe logs from ...
3
votes
2answers
3k views

How do I allow apache to rotate logs in user home directory with SELinux enabled?

Our development machine has multiple users, and their various sites are stored in /home/username/apache. In these folders are sub-folders like conf containing the virtual host config, logs containing ...
2
votes
2answers
3k views

Changing LogRotate's default way of rotating the log files

My observation of logrotation is that to rotate any log file, the logrotate process, in the following order copies the log file in question (lets call it file1.log) with a new name (adding time stamp ...
0
votes
1answer
55 views

Log not readable after rotation by daemontools

I have a log, which looks perfectly fine. However, after the log rotation by daemontools, it is no longer human readable. What could be the problem?
1
vote
2answers
743 views

Rolling log file without losing any log event

I have a 8GB file called php.log with a running php script logging into it. It is important for me that I log every event, and I want to compress it and empty the current file without stopping the web ...
2
votes
2answers
3k views

Logrotation is not working for nginx

I am trying to rotate nginx log using Logrotate.It's appending log to same file (error.log and access.log) but not rotating on daily basis. Below are the configuration file for the same. Please let me ...
4
votes
1answer
4k views

logrotate cron job not rotating certain logs

I added two scripts in "logrotate.d" directory for my application logs to be rotated. This is the config for one of them: <myLogFilePath> { compress copytruncate delaycompress dateext ...
8
votes
1answer
22k views

Logrotate not rotating file after file size exceeds the limit.

From logrotate manpage. It will not modify a log more than once in one day unless the criterion for that log is based on the log's size According to the man page, logrotate should rotate ...
1
vote
1answer
4k views

How do I rotate old log files to long-term backup?

I have logrotate set up to archive logs for 30 days; how do I set up my cron job to rotate them automatically from /var/log/net to the long-term storage I have mounted on /mnt/backup? I do not need ...
1
vote
1answer
1k views

logging with named pipes

I have a lot of code I need to daemonize that prints to standard out. I am thinking of using the following shell script to create a named pipe so I can nohup a process while redirecting its output to ...
7
votes
5answers
9k views

How to gzip logs created by rotatelogs

I'm using rotatelogs to create my daily apache logs in format host.<day>.<month>.<year>.access.log. Now I want to gzip and move log to different directory after it's been finished. ...
1
vote
2answers
206 views

unidentifiable httpd log rotator

I have my own server instance which is centos 5.7 and have installed apache some time ago. Now I noticed that my log files are rotating. I couldn't remember if I had set up something or not since ...
3
votes
2answers
164 views

Programme that accepts stdin, then writes to a datetime stamped file?

I wonder is there a programme that'll do what I want. This is like an streaming log rotation programme. For the linux/unix command line. Let's say I have some input that is streaming some data. I ...
2
votes
1answer
1k views

Varnish logrotate issue

I have this in logrotate.d/varnish file: /var/log/varnish/*log { create 640 http log compress postrotate /bin/kill -USR1 `cat /...
6
votes
1answer
6k views

Logrotation when filenames includes date

My log files are in the format "2011-03-28.log.php". Log files are created every day. I want to keep 5 days log and rest I want to remove it, which means only 5 log files will be kept and rest ...