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
3
votes
2 answers

Log rotation in Spring Boot service

I am deploying a Spring Boot 2.0.0-RC1 application as an init.d service, but I can't figure out how to configure the log rotation. The app logs to /var/log/appname.log, but if I configure logrotate the logging stops after a rotation, because a new…
vforchi
  • 123
  • 2
  • 7
3
votes
1 answer

Logrotate compression format

I want to use logrotate for managing my logs. I find the compressing option really useful. However gzip (the compression by default) isn't the best for my logs (Experimentally, other compression can be twice to 5 times more efficient). Is it…
Peni
  • 626
  • 1
  • 7
  • 18
3
votes
3 answers

How to set max size for a specific file in linux

I have an application which will write to a particular log file until the user session is going on. What i am looking for is to put a max cap on the size of a log file so it does not grow beyond a particular size, 2 scenarios which will be useful…
3
votes
1 answer

Logrotate not rotating old files even after rotate is set to 0

In my log rotate setup, for a specific log file the rotate has been set to 0. But once the size of the file is reached, the old file is rotated to application.log.1 instead of being deleted. As per the documentation, the file should be deleted when…
Aravindh S
  • 1,185
  • 11
  • 19
3
votes
1 answer

docker image ubuntu:16.04 seems to omit some files for logrotate

I built an image based on ubuntu:16.04. While building the image I did run some commands including apt-get -y update. Then, I browse the image by docker run -it myimage bash and I found there are some omitted files for logrotate in there comparing…
SangminKim
  • 8,358
  • 14
  • 69
  • 125
3
votes
2 answers

conditional logrotate with prerotate script

I have two syslog-ng servers in a cluster (hot/cold), both mapping the same NFS Share. I would like to run logrotate on the syslog servers to rotate the logs stored on the NFS Share. The problem is that currerntly if both nodes have a…
dobbs
  • 1,089
  • 6
  • 22
  • 45
3
votes
1 answer

Logrotate daily/weekly/monthly

Why are we setting daily/weekly/monthly option in config file, if we can do it in cron (and actually do)? What is the sense of this option ? For example: I set to execute "logrotate -f /etc/logrotate.d/app" every day(daily). But in config file…
ilya_direct
  • 501
  • 1
  • 6
  • 13
3
votes
1 answer

Vague deprecation error when running ansible playbook

My playbook contains vars that are passed to a role. When I run it, I get [DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.. Here's what I have: --- - hosts: hadoopL0X become: yes …
3
votes
1 answer

logrotate appending the date to logs in wrong way

I have a rails application and I have setup logrotate for the logs. The logs are like production.log, sidekiq.log, cron.log in the directory /home/username/myapp/log/. I want the rotated logs should be named like…
drishti ahuja
  • 1,379
  • 2
  • 15
  • 26
3
votes
0 answers

Customizing ec2 log rotation to S3 on elastic beanstalk

I have an AWS elastic beanstalk environment with some amazon linux instances running a tomcat8 server. I have enabled log rotation from the beanstalk console and I can see the logs getting published to S3 every hour. I would like to reduce the…
3
votes
2 answers

Logrotate cronjob not running

I wish to use the following command as a cron job: /usr/sbin/logrotate /home/xxxx/public_html/cgi-bin/logrotate.conf -f However the message is: error: error creating state file /var/lib/logrotate.status: Permission denied Is there a way around…
Techiescorner
  • 791
  • 2
  • 12
  • 25
3
votes
0 answers

Copytruncate does not work in logrotate

Truncate original file doesn’t work in logrotate. I’m using mosquitto and trying to make log file with logrotate. Want to seperate log file by everyday. But after save log file of yesterday, I can’t truncate(or clean) original log file so message…
김영석
  • 53
  • 5
3
votes
1 answer

MongoDB, log is unable to logrotate

The MongoDB version is v2.6.3 on my server, and mongod is running: ubuntu@koala:/var/log/mongodb$ ps -ef | grep mongo root 7434 1 17 Jun16 ? 06:57:26 mongod -f /etc/mongodb-onepiece.conf --fork I am using logrotate to daily rotate…
Vincent Qiao
  • 31
  • 1
  • 2
3
votes
1 answer

May logrotate rotate log in the middle of the line?

I working on a GUI for viewing audit.log, which can be rotated. Should I take care of situation when one part of some line is in one file, and the rest of the line is in another file?
kseniyam
  • 95
  • 1
  • 5
3
votes
1 answer

rsync and logrotate transfers old logs every day

I have Apache web server producing considerable amount of log files. I do logrotate them every day on the server. Every night I rsync server backups over Internet to another computer. The speedup of log files sync is very close to 1, because…
Pavel Niedoba
  • 1,554
  • 2
  • 19
  • 36