Skip to main content

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
1 answer
420 views

How to prevent Kubernetes log rotation from compressing files?

Hi we have Kubernetes log rotation setup to rotate every 100MB. We have a Filebeat daemonset reading the /var/log/pods folder. That works all nice and dandy except when we experience large volume, ...
user432024's user avatar
0 votes
0 answers
29 views

Need help in logrotation

I have custom logrotation as below.. cat /etc/logrotate.d/apache # # /var/log/apache/apache.log { daily rotate 30 size 1G compress missingok ...
xrkr's user avatar
  • 433
1 vote
1 answer
535 views

how to make logrotate take filesize into consideration when rotating

Lets say I want to logrotate when the filesize is 1kb . Before the run if the filesize of the log is 4kb I expect logrotate to create 4 different log files. Before: something.log (4kb) What I expect ...
userskin's user avatar
-1 votes
1 answer
508 views

Sending rotated files with syslog-ng

Hello I am currently sending the suricata logs from a probe to a Syslog-ng server(172.16.238.15): @version: 3.25 options { keep-timestamp (no); chain_hostnames (off); keep_hostname (no); };...
19mike95's user avatar
1 vote
1 answer
379 views

Where can I find older wtmp log files?

Every so often the last log is rotated out and stored in /var/log as wtmp* however when I look in my system in /var/log I only see the current wtmp file and the wtmp* file before it. I know the ...
Larmes's user avatar
  • 13
0 votes
0 answers
389 views

how to handle extreme hug Weblogic server .out file?

Weblogic server under logs folder has servername.out0000x files which are extreme huge. Log folder is over 1.4TB and some servername.out000 files are over 100 G. How these file can be reduced size or ...
Ryan Exlay's user avatar
0 votes
0 answers
182 views

Logs are not shifting to new directory after log rotation

I am facing issue. We have setup log forwarder for sentinel and logs are frequently coming on /var/log/messages. Actual problem is i have created one script for log rotation and placed it under /etc/...
vansh kumar's user avatar
0 votes
1 answer
6k views

How to properly configure a custom logrotate configuration file?

For the first time today, I am trying to write a configuration file for logrotate. When I restart the logrotate service, I get the following error: logrotate.service: Failed with result 'exit-code'. ...
theirman's user avatar
1 vote
1 answer
3k views

How to configure log rotate to compress and archive logs weekly [closed]

We have rsyslog that save logs based on requirement to various directories: /opt/logs/stats/dc1/stats_YYYY-MM-DD_%somename%.log /opt/logs/stats/dc2/stats_YYYY-MM-DD_%somename%.log /opt/logs/events/dc1/...
sarvesh.lad's user avatar
0 votes
1 answer
662 views

How to rotate compressed log file on centos 7?

I have customized kafka server and the app is creating log files and configures log rotation. My problem is that I need to compress the rotation logs that were created. I tried to create new log ...
Rasa's user avatar
  • 1
2 votes
0 answers
214 views

Is that possible to let "multilog" program output human-readable file name instead of TAI64N timestamp name?

I am using "multilog" to do log rotation in debian server. When the log roates, "multilog" will create a filename as @TAI64N_timestamp.s or @TAI64N_timestamp.u. I know I can ...
sgon00's user avatar
  • 173
0 votes
2 answers
4k views

Is logrotate supposed to work only in logs inside /var/log?

I currently have a systemd service in a Ubuntu 18.04 machine that redirects the StandardOuput and StandardError to a custom path: StandardError=file:/opt/my_tests/my.log StandardOutput=file:/opt/...
ignacio's user avatar
  • 101
0 votes
0 answers
44 views

logrotate broken yet not error message

It seems like there are quite a few common issues with logrotate not doing what it suppose to and as it happens I am in the same boat. -rw-r--r-- 1 root root 24G Jun 23 01:15 A10.log -rw-r--r-- 1 ...
Maciej Cygan's user avatar
3 votes
0 answers
982 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 ...
Dmytro Titov's user avatar
1 vote
1 answer
717 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 ...
lonix's user avatar
  • 1,049
1 vote
1 answer
525 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/...
krish's user avatar
  • 13
2 votes
1 answer
5k 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 ...
SVill's user avatar
  • 87
2 votes
1 answer
92 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 ...
Anath3ma's user avatar
2 votes
0 answers
528 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 ...
Pierre's user avatar
  • 21
1 vote
1 answer
550 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 ...
user3629081's user avatar
1 vote
1 answer
759 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 ...
TDN169's user avatar
  • 135
2 votes
1 answer
4k 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 ...
spiffytech's user avatar
  • 1,123
0 votes
1 answer
3k 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. ...
Adil Saju's user avatar
  • 101
0 votes
1 answer
1k 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/...
Jake's user avatar
  • 35
0 votes
0 answers
1k 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 ...
Prashant Lakhera's user avatar
1 vote
1 answer
2k 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 ...
jschmitter's user avatar
1 vote
0 answers
146 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....
Fabian Dellwing's user avatar
1 vote
2 answers
4k 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/...
Angelo's user avatar
  • 111
0 votes
1 answer
2k 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 ...
Lapsio's user avatar
  • 363
3 votes
0 answers
5k 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 ...
AbhishekSinghNegi's user avatar
0 votes
3 answers
3k 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 ...
emsoff's user avatar
  • 103
2 votes
1 answer
509 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 (...
Tom's user avatar
  • 61
0 votes
1 answer
4k 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 ...
sawe's user avatar
  • 11
0 votes
0 answers
1k 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 ...
Paolo's user avatar
  • 149
4 votes
2 answers
4k 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/...
Shailesh Sutar's user avatar
0 votes
2 answers
478 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, ...
Startec's user avatar
  • 107
0 votes
1 answer
1k 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 -...
Hassan Baig's user avatar
  • 2,675
1 vote
0 answers
2k 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 ...
Soorya Prakash's user avatar
-1 votes
1 answer
699 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 ...
Vikash's user avatar
  • 151
0 votes
1 answer
439 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 ...
Plicatibu's user avatar
  • 101
0 votes
0 answers
682 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/...
Aminah Nuraini's user avatar
0 votes
1 answer
6k 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 ...
kghbln's user avatar
  • 441
2 votes
0 answers
301 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 ...
OmegaMy's user avatar
  • 31
2 votes
0 answers
1k 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 ...
Alex Balashov's user avatar
1 vote
1 answer
666 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 ...
ItamarBe's user avatar
3 votes
1 answer
5k 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----...
Zakalwe's user avatar
  • 153
2 votes
1 answer
938 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,...
user1065145's user avatar
0 votes
2 answers
8k 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 ...
alexus's user avatar
  • 13.6k
1 vote
2 answers
745 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 ...
MohammedSimba's user avatar
5 votes
1 answer
248 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 ...
Alistair Evans's user avatar