Questions tagged [log-rotation]
143 questions
21
votes
4 answers
Log Rotation in Node.js?
In my web analytics, I am logging the data in plain text file. I want to rotate the log on a daily basis because its logging too much data. Currently I am using bunyan to rotate the logs.
Problem I am facing
It is rotating the file correctly, but…

karthick
- 5,998
- 12
- 52
- 90
16
votes
6 answers
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:
{
compress
copytruncate
delaycompress
dateext
missingok
notifempty
daily
rotate 30
}
There is…

Ashok
- 531
- 1
- 3
- 12
15
votes
2 answers
QPlainTextEdit truncate history linewise
I have a GUI application whose main part is a QPlainTextEdit. It is used to display a log of the application, and as such the associated text grows line by line ad infinitum.
As the application is intended to run very long, I need to limit the…

moooeeeep
- 31,622
- 22
- 98
- 187
12
votes
2 answers
Is there a difference between RotatingFileHandler and logrotate.d + WatchedFileHandler for Python log rotation?
Python has its own RotatingFileHandler which is supposed to automatically rotate log files. As part of a linux application which would need to rotate it's log file every couple of weeks/months, I am wondering if it is any different than having a…

devhallo
- 337
- 3
- 13
11
votes
3 answers
How to create one uwsgi log file per day?
I use uwsgi with the parameter --daemonize /logs/uwsgi.log
This file is however becoming large and I would like to split it into smaller pieces. One per day would be preferable. I have done that for nginx where it was easy to specify the log file…

Markus Johansson
- 3,733
- 8
- 36
- 55
11
votes
1 answer
log4j fileappender doesn't switch to the new file when logrotate rotates the log file
Context:
I want to use log4j to write audit-related logs to a specific log file, let's say audit.log. I don't want to use syslogappender(udp based) because I don't want to be tolerant to data loss. Plus, I am using logrotate to rotate the audit.log…

Shengjie
- 12,336
- 29
- 98
- 139
9
votes
1 answer
Logback, set max history files per day
I use TimeBasedRollingPolicy and SizeAndTimeBasedFNATP triggering policy for my logback configuration. The rollover of log files is set to happen every day and it will also be triggered if log file size goes beyond a limit.
If I do…

Prasanna
- 3,703
- 9
- 46
- 74
7
votes
1 answer
PHP Monolog logger RotatingFileHandler never rotates files
PHP 7.1, ubuntu 12.04 LTS, monolog version is 1.23.0.
Logger initialisation:
pushHandler(
new RotatingFileHandler(
Main\Application::getDocumentRoot() .…

userlond
- 3,632
- 2
- 36
- 53
7
votes
1 answer
Log rotation on logs consuming disk space in Google Cloud Kubernetes pod
We have a pod in a Google Cloud Platform Kubernetes cluster writing JsonFormatted to StdOut. This is picked up by Stackdriver out of box. However, we see the disk usage of the pod just growing and growing, and we can't understand how to set a max…

chrisva
- 625
- 9
- 17
5
votes
2 answers
Enable log rotation in rsyslog
How to enable log rotation in rsyslog configuration. The method described in the official documentation of rsyslog using output channels is not working for me.
The script given in the official documentation of rsyslog for output channel is available…

Kumar Rounak
- 49
- 1
- 5
5
votes
3 answers
Log rotation - python and windows
(I have searched and not found a duplicate for this question but happy to be proved otherwise).
I need to rotate a log from within some Python code. The code is running on Windows (Server 2008 R2).
Initially I used TimedRotatingFileHandler (from…

azp74
- 1,841
- 2
- 17
- 23
5
votes
4 answers
logrotate: delete tomcat/jboss logs older than n days
I haven't found a solution to purge old tomcat or jboss logs or any other timestamped logs: catalog.log./server.log.. Basically these logs are rotated by jboss as:
server.log, server.log.20131201, server.log.20131203 and so on.
Is there a way I can…

dOps
- 730
- 2
- 7
- 16
4
votes
1 answer
How to configure filebeat to handle log rotation?
My settings
I have a docker cluster in which supervisord is writing logs to output.log on a shared volume, from which Filebeat is reading and shipping logs to ES. In order to prevent disk-full problems, I have configured supervisord to rotate the…

Adam Matan
- 128,757
- 147
- 397
- 562
4
votes
4 answers
Logging Handlers Empty - Why Logging TimeRoatingFileHandler doesn't work
So I do logging.config.fileConfig to setup my logging from a file config that has console and file handler. Then I do logging.getLogger(name) to get my logger and log. At certain times I want the filehandler's filename to change i.e. log rotate (I…

OriginalCliche
- 381
- 4
- 15
3
votes
0 answers
How to log limitation and rotation to ROS2
I want to apply limitation to the size, number and rotation of log files that will be saved under .ros/log. People mentioned this issue here but I could not find any example/instruction for that so any idea/suggestion/sample would help. The target…

Keivan
- 1,300
- 1
- 16
- 29