Questions tagged [log-rotation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Time-based rotation of Docker logs

We are running a stack of Docker Swarm services and, according to our Privacy Policy, we have to keep logs only for the last 6 months, but no older. I was trying to achieve it through different ...
0
votes
1answer
29 views

Logrotate docker container's logs when user doesn't exist on host

I mounted my containers' logs to the host (e.g. /var/log/container1, etc). Now I want to use the host's logrotate. But suppose I need to do this: create 660 mysql mysql There is no mysql user/group ...
1
vote
1answer
30 views

Log Rotate doesn't rotate logs [duplicate]

I have a logrotate running on Aws ec2 instance which is trying to rotate logs under /var/log/tomcat8/ every hour. I have below configuration under /etc/logrotate.d/rotate_tomcat: "/var/log/tomcat8/...
0
votes
0answers
26 views

Logrotate daily+maxsize not working

I have set the logrotate on centos7 with the max size and daily directives. But, it seems that it's not working when log size exceeds the specified size limit. Even in debug mode, it indicates that ...
0
votes
1answer
440 views

How to move compressed files with logrotate

This is probably insanely easy to do, but I can't find anything relevant to the topic. I'm setting up a custom logrotate.conf file for the logs in our service. As part of this, I would like to keep ...
2
votes
1answer
74 views

Apache outputting without .log

I am trying to fix an issue where an apache log is filling the /var/log/ partition. It is a single log in apache2 that is almost 4GB. I have set logrotate to rotate out at 3G, but it has not rotated ...
1
vote
0answers
84 views

Logrotate not rotating without size config

On RedHat, I have a logrotate configuration as follows : /custom/path/kibana/logs/*.log { missingok daily create 0644 suuser suuser rotate 7 notifempty sharedscripts compress dateext ...
1
vote
1answer
150 views

The logrotate 'rotate' directive and migrating from daily to weekly

I have a server collecting syslog messages from the network. Logrotate is currently setup and working, and the config looks like such: /logs/*/log { daily rotate 60 } Instead of rotating ...
1
vote
1answer
142 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 ...
1
vote
1answer
1k 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
514 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
446 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
276 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
899 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
81 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....
1
vote
2answers
1k 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
1k 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 ...
2
votes
0answers
2k 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
2k 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
315 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
2k 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
510 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 ...
3
votes
1answer
2k 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
175 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
626 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
1k 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
486 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
262 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
455 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/...
0
votes
1answer
4k 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 ...
2
votes
0answers
132 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
588 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
249 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
3k 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----...
2
votes
1answer
633 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
606 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
164 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
454 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
520 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
556 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
426 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
4k 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
4k 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
61 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
1k 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
4k 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
7k 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 ...
9
votes
2answers
27k 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 ...