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
10
votes
4 answers

Are variables supported in logrotate configuration files?

I looked at logrotate.conf examples and everything in my /etc/logrotate.d directory. Nowhere was I able to find documentation on variables in these files. I am trying to create a config file for rotating the logs of an application we are writing. I…
kzyapkov
  • 627
  • 2
  • 8
  • 11
9
votes
4 answers

Apache rotate Access and Error logs Windows

How can I rotate the Apache Access and Error logs on a Window 2000 box? I include my batch file below as an answer. Is there a way of doing this directly via the Apache config file? I'm currently using the following customlog command to generate…
alimack
  • 611
  • 2
  • 9
  • 20
9
votes
2 answers

How to configure logrotate with php logs

I'm running php5 FPM with APC as an opcode and application cache. As is usual, I am logging php errors into a file. Since that is becoming quite large, I tried to configure logrotate. It works, but after rotation, php continues to log to the…
Steven De Groote
  • 2,187
  • 5
  • 32
  • 52
8
votes
3 answers

logrotate - compression files modified x number of days

Is there a way to get logrotate to only compress files modified X number of days ago (e.g. mtime +2)
user353829
  • 1,244
  • 5
  • 25
  • 38
8
votes
1 answer

Redirecting output of a program to a rotating file

I am trying to redirect the output of a continuously running program to a file say error_log. The command I am using looks like this, where myprogram.sh runs continuously generating data and writing to /var/log/httpd/error_log myprogram.sh >>…
Albatross
  • 669
  • 7
  • 24
8
votes
3 answers

How to enable log rotation in Jenkins for weekly?

I am trying to enable the log rotation for jenkins. Because the log file occupied more memory space. Is there any plugins or method to do it?
jass
  • 343
  • 2
  • 6
  • 16
8
votes
2 answers

How does "tail -f" and logrotate work?

When I run tail -f for a log file, logrotate rotate it but tail -f did not stop. It continue show logs in new file. After that I try manually; mv my.log my.log.2 touch my.log echo "test text" >> my.log echo "test text" >> my.log It does not works.…
umut
  • 1,016
  • 1
  • 12
  • 25
8
votes
2 answers

Using logrotate with logback

When using logback in conjunction with logrotate, what is the recommended configuration? Based on a survey blogs and such, the implicit recommended configuration is to use FileAppender.append=true and then logrotate's copytruncate option. Is this…
Nino Walker
  • 2,742
  • 22
  • 30
7
votes
1 answer

My kubernetes pods are Evicting with ephemeral-storage issue

I am running a k8 cluster with 8 workers and 3 master nodes. And my pods are evicting repetively with the ephemeral storage issues. Below is the error I am getting on Evicted pods: Message: The node was low on resource: ephemeral-storage.…
7
votes
2 answers

Logrotate does not auto rotate when based on log size

I have a custom application (myApp) which is writing logs to the file '/var/log/myApp'. I can see the logs being written and it works fine. Now I am trying to setup logrotate for this file and for this I have created a config file…
One
  • 153
  • 1
  • 1
  • 5
7
votes
3 answers

Logging compatibly with logrotate

I am writing a Linux daemon that writes a log. I'd like the log to be rotated by logrotate. The program is written in C. Normally, my program would open the log file when it starts, then write entries as needed and then, finally, close the log file…
TheAG
  • 287
  • 1
  • 4
  • 10
7
votes
1 answer

logrotate working but ignoring size

CentOS v.7 Logrotate v.3.8.6 I set logrotate to rotate when file reaches 5M but it ignores it, if I add daily it will rotate daily regardless of size, i tried with size, minsize and maxsize all the same the only difference is with "size" it doesnt…
Sruli
  • 216
  • 2
  • 5
7
votes
3 answers

How do I rotate my Rails 5 logs?

I'm running Rails 5 on Ubuntu 14.04. Is there a way to rotate my logs without relying on the Linux logrotate system? I have this set up ... myuser@myapp:~$ cat /etc/logrotate.d/myapp /home/rails/myapp/log/*.log { daily missingok rotate 2 …
Dave
  • 15,639
  • 133
  • 442
  • 830
7
votes
2 answers

containerized nginx log rotation with logrotate

Nginx doesn't have native log rotation, so an external tool, such as logrotate, is required. Nginx presents a challenge in that the logs have to be reopened post rotation. You can send a USR1 signal to it if the pid is available in /var/run. But…
Mark Sawers
  • 302
  • 3
  • 7
7
votes
0 answers

Logrotate for processes which never close log file descriptors

I was wondering what are my options when it comes to doing logrotate for processes which never close their file descriptors. I am aware of the "restart the service" and copytruncate option. However, assuming that restarting the process is…
synepis
  • 1,292
  • 16
  • 28
1 2
3
31 32