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
4
votes
1 answer

Logrotate not working in Ubuntu 14.0.4

I have installed Logrotate in my system. My Log file name is like : log-2015-09-09.php Here is my configuration in etc/logrotate.conf file : /home/root/php/www/myProject/CI/application/logs/log-%Y-%m-%d.php{ daily size 1K …
Nilesh Kumar
  • 370
  • 2
  • 3
  • 16
4
votes
2 answers

How to use date and time as part of filename on Logrotate?

I need to use time and date as an extension of rotated logs. Right now I'm using dateext, but the problem is that I can't achieve rotation more than once on same date/day and I have to do rotation on hourly basis Here is the logorotate configuration…
Muneeb Nasir
  • 2,414
  • 4
  • 31
  • 54
4
votes
1 answer

Configure logrotate status file

I am trying to use logrotate to rotate my log files. However, we don't want to do that as root. However, if I execute it with some other job account it fails as its not able to edit or create file /var/lib/logrotate.status. Is there a way to…
Raj
  • 502
  • 5
  • 16
4
votes
1 answer

Rotate file according to size

I have the following setup: removed the line contaning /var/log/maillog from /etc/logrotate.d/syslog file, and added the following in /etc/logrotate.conf file: ... # system-specific logs may be also be configured here. /var/log/maillog { …
Jay
  • 347
  • 2
  • 5
  • 10
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
4
votes
1 answer

howto watch a rotating file with node.js?

I'm trying to watch log rotated files with node.js and parse each line for keywords. The Problem is: after logrotate I'm still watching the old file because of the opened file discriptor. I'm new to this and have two questions: Is it advisable to…
Marco
  • 43
  • 2
4
votes
2 answers

On Windows, how to open for writing a file already opened for writing by another process?

I'm trying to open a logfile which is kept open by another process and remove the first few lines. On Unix I'd simply do a os.open('/tmp/file.log', os.O_NONBLOCK) and that would get me closer to my goal. Now i'm stuck with Windows and I need to…
Torxed
  • 22,866
  • 14
  • 82
  • 131
3
votes
3 answers

Failures caused by logrotate on Apache 2 with passphrase protected SSL key

I have an Apache 2 installation on Debian with mod_ssl installed. The server private key is protected by a passphase that needs to be entered on start-up. The error and access logs are subject to logrotate on a weekly basis. I find that Apache…
Mike Tunnicliffe
  • 10,674
  • 3
  • 31
  • 46
3
votes
0 answers

Centralized logrotate Container for all containers in docker-compose

My logrotate container gives me following errors: error: Ignoring activity_logs because it is writable by group or others. error: Ignoring httpd because it is writable by group or others. error: Ignoring reminder_cron because it is writable by group…
3
votes
1 answer

traefik logrotate access log docker volume

I'm trying to logrotate access logs with traefik docker on the host. When logrotate run it create a new log file, great, but it always to zero like if the docker volume was not remount. On traefik docker the access log still continue to grow. What…
jrweb247
  • 95
  • 1
  • 8
3
votes
3 answers

Logrotate script not running

I have the following logrotate script /path/to/folder { daily rotate 30 notifempty sharedscripts copytruncate compress dateext preremove if file --mime-type "$1" | grep -q gzip$; then mkdir -p…
RPT
  • 728
  • 1
  • 10
  • 29
3
votes
2 answers

Rotate log for application in docker container

I have an application which writes log into file (example /var/log/my_app). Before Docker I used supervisor to start my app and logrotate.d for rotation logs. Logrotate.d runs script for supervisor to restart my app after log rotate (for delete old…
Mike
  • 860
  • 14
  • 24
3
votes
2 answers

Kubernetes with logrotate sidecar mount point issue

I am trying to deploy a test pod with nginx and logrotate sidecar. Logrotate sidecar taken from: logrotate My Pod yaml configuration: apiVersion: v1 kind: Pod metadata: name: nginx-apache-log labels: app: nginx-apache-log spec: …
DisplayName
  • 479
  • 2
  • 7
  • 20
3
votes
1 answer

Why is catalina.out empty

I have logrotate working perfectly, only thing is that when the log file is saved with the date at the end of the filename like: catalina.out-20180926. But there is nothing being logged to catalina.out. Everything is owned by root, tomcat is running…
juju
  • 553
  • 1
  • 4
  • 21
3
votes
2 answers

Size rule not working in logrotate

I created a log-rotate option for our docker logs and it is working fine. Here is the configuration file *root@aerogear:/var/lib/docker/containers/b8da13f8dc6cb642959103c23db2a02ef2c7291ae5f94625a92ac9329db1647e# cat…
Roni Baby
  • 91
  • 1
  • 10