Questions tagged [logrotate]

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.

Filter by
Sorted by
Tagged with
74 votes
5 answers
136k views

How can I monitor what logrotate is doing?

How can I monitor what logrotate is doing in Ubuntu? Can the activity of logrotate be monitored?
user avatar
2 votes
1 answer
14k views

Specific names after logrotate

I'd like logrotate to create files which have nice names. Is there some way to force some pattern for the names after rotation? I'd like to create a service-{year}-{month}-{day}-{hour} format and ...
viraptor's user avatar
  • 1,306
0 votes
2 answers
565 views

logrotate problems

I have the following problem. When my logs are rotated something like that is procuded -rw-r--r-- 1 root admin 169K Sep 24 12:15 messages -rw-r--r-- 1 root admin 0 Sep 24 04:03 messages.1 -...
Nikolaidis Fotis's user avatar
1 vote
3 answers
9k views

Logrotate Mysql - No rotate happens

I work with CentOS5, and I have the following version of mysql : mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1 I want to rotate the logs of mysql using ...
user avatar
6 votes
4 answers
5k views

Is there any alternate to logrotate for apache logs?

I need an alternate for rotating logs on my server, everytime logrotate runs apache goes down for like 10-20 minutes, i'm not sure if this is right, but don't seem right for me. Is there any ...
Rod's user avatar
  • 371
0 votes
2 answers
427 views

Why is apache2 not logging properly given the following logrotate.conf

access_log seems to be permanently size 0. But error_log is written to fine. Surprisingly access_log.[1-5].gz are created but only access_log.3.gz and access_log.4.gz contain non-empty logs. Ok, so ...
Tom Viner's user avatar
  • 101
10 votes
2 answers
7k views

Apache2 and logrotate: delaycompress needed?

I am currently looking at the file size of my Apache logs as they became huge. In my logrotate configuration, I have delaycompress enabled. Does Apache really need this (as the logrotate documentation ...
j0nes's user avatar
  • 955
17 votes
3 answers
31k views

When & how does logrotate run under Ubuntu 10.04?

I am new to sysadmining and have a few questions: Where and how is the logrotate procedure initaited by the system? What time of day are my "daily" rotated logfiles being rotated? Do the prerotate ...
user avatar
1 vote
0 answers
375 views

How to configure logrotate to just prune a directory once a week?

How to configure logrotate to just delete all files under selected directory once a week? I'm testing the following: /var/spool/mydir/* { daily rotate 0 nocompress copytruncate } But ...
ctinnist's user avatar
  • 375
5 votes
1 answer
4k views

I want my logs sent to my mail with logrotate

Not strictly a question about programming as such, more of a log handling question. Anyway. My company has multiple clients, and each of these clients have a set of logs that I'd rather much want to ...
lericson's user avatar
  • 161
3 votes
4 answers
4k views

Logfiles go blank after logrotate rotates them

I have an ubuntu 8.04 LTS server that runs openvpn. The openvpn server writes to a standard logfile under /var/log and prior to a month ago logrotate would automatically rotate the files and compress ...
Hilton D's user avatar
  • 279
0 votes
1 answer
262 views

Strange behavior of logRotate?

I have the following configuration of logrotate: /var/log/test/app.log { missingok notifempty compress copytruncate daily rotate 4 } The application ...
Ariod's user avatar
  • 189
0 votes
1 answer
1k views

logrotation within Jboss 4

I have looked around and I havent been able to find a clear cut answer to how this can be configured. i read that the native logrotate is a bad idea. so is there a way to do this within the log4j ...
user avatar
0 votes
2 answers
3k views

Nginx, logrotate and empty files

I have a problem with nginx/logrotate. The problems is that nginx is logging access to 2 files (main and data). I have the following contrab setting: 0 * * * * /usr/sbin/logrotate -f /home/...
tzulberti's user avatar
  • 113
1 vote
1 answer
807 views

Apache, logerror and logrotate: what is the best method?

Here's a vhost example of my sites: <VirtualHost *:80> DocumentRoot /datas/web/woog ServerName woog.com ServerAlias www.woog.com ErrorLog "|/httpd-2.2.8/bin/rotatelogs /logs/...
user avatar
0 votes
1 answer
245 views

Apache, and logrotate instances

If I have one website and I want to rotate its logs, there's one instance of logrotate that is launched. There are as many logrotate instances launched as they are virtual websites. Here you can find ...
OlivierDofus's user avatar
0 votes
1 answer
2k views

Can Apache be configured to write to access.log or error.log with a different extension?

One of the things that I am investigating is using the dateext option for logrotate. However if I understood things correctly apache will keep writing to the files access.log and error.log. I was ...
Mohan Gulati's user avatar
11 votes
2 answers
13k views

What are pros and cons of logrotate vs rotatelogs with Apache?

Apache provides a tool called rotatelogs which has the benefit of not restarting apache when rotating logs which happens with logrotate. I do not have enough experience to speak if this is enough ...
Mohan Gulati's user avatar
16 votes
3 answers
105k views

logrotate does not compress /var/log/messages

Over time I noticed some logs in /var/log such as auth, kern and messages were getting huge. I made logrotate entries for them: $ cat /etc/logrotate.d/auth.log /var/log/kern.log { rotate 5 ...
Mike Mazur's user avatar
  • 6,263
5 votes
4 answers
6k views

Daily Weekly and Monthly DB backup with logrotate?

I am currently keeping daily backup of my database by doing a daily mysqldump and by using logrotate to keep the 7 last days of mysqldump. I would like to improve this backup process to keep 7 daily ...
benjisail's user avatar
  • 1,331
2 votes
1 answer
721 views

syslog rotation

I wrote a small c app that uses the syslog c interface to write messages (from man 3 syslog): void openlog(const char *ident, int logopt, int facility); void syslog(int priority, const char *message, ...
user avatar
5 votes
4 answers
11k views

Exclude files / dirs logrotate

I am logging all our applications logs to /logs/, where all our applications have an seperate directory. I have made a custom logrotate file as follows: /logs/*.log { daily missingok ...
Tom's user avatar
  • 63
2 votes
2 answers
729 views

Two scripts in /etc/cron.daily seem to be rotating my logs: logrotate and sysklogd

It seems that my logfiles generated by syslog are getting rotated twice each day. I believe this is due to both /etc/cron.daily/logrotate and /etc/cron.daily/sysklogd doing overlapping work. Here are ...
mike's user avatar
  • 4,013
6 votes
1 answer
10k views

How do you rotate apache logs on windows without interrupting service?

I administrate a Windows Server 2003 (Standard Edition, 32-bit) installation running Apache2 and ColdFusion. The server has over 100 virtual hosts, each with an access log and an error log. I've been ...
Joe's user avatar
  • 1,775
8 votes
3 answers
10k views

Logrotate creates long names and does not delete logs

postgres_db_dump_20091016.gz.1.1.1.1.1.1.1.1.1.1.1-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021-20091021 postgres_db_dump_20091017.gz.1.1.1.1.1.1.1.1.1.1.1-20091021-...
iElectric's user avatar
  • 358
7 votes
3 answers
12k views

Why do JBoss and Logrotate create log files full of NUL characters?

I've set up Logrotate to rotate my JBoss Application Server 4.2.2.GA logs nightly. After the log files have been rotated and JBoss starts writing to them again, the new log files begin with as many ...
Ben Williams's user avatar
  • 2,396
1 vote
1 answer
246 views

Compressed email attachments for logrotate

How can I configure logrotate so that it emails me the files 'after' they have been compressed? Right now I am emailed the uncompressed files which can results in huge attachments.
Kiffin's user avatar
  • 111
1 vote
8 answers
1k views

Weekly Cron / Logrotate / Denyhosts error

I am getting the following error email every week. It appears to be a problem with either cron, logrotate, or denyhosts. I'm not sure which. Subject: Cron <root@vps> test -x /usr/sbin/anacron ||...
Unknown's user avatar
  • 1,715
2 votes
2 answers
229 views

script to rotate apache weblog

I am looking for a script that would rotate weblogs on apache. I'd like to schedule the script over cron so it could run periodically and rotate access_log and error_log for all websites on the server....
user avatar
3 votes
2 answers
2k views

Script to modify logrotate configuration files?

I'm looking for a script that will allow me to programatically modify logrotate configuration files. At the least I'd like it to be able to replace a block such as /var/log/wtmp { missingok ...
Michael Kohne's user avatar
13 votes
4 answers
15k views

Proper way to rotate Nginx logs

I would like to achieve rotation of nginx logs that: would work without any extra software (i.e. - best if without "logrotate") would create rotated files with names based on date Best approach is ...
user avatar
10 votes
3 answers
10k views

NginX Log Rotation

I am serving a couple different domains through NginX on the same server and they each log to their own file. I need to set up a script to rotate, and compress these files and add it to cron. I ...
John F. Miller's user avatar
3 votes
2 answers
14k views

How to use wildcards within logrotate configuration files

I have the following configuration that is not working: 1) Using rsyslog with Centos 5. 2) Inside /etc/logrotate.d I have the file sj-piers-logs. SJ-PIERS-LOGS: /syslogrep/sjpiers-logs/0* { weekly ...
3D1L's user avatar
  • 209
23 votes
3 answers
15k views

Logrotate and Open Files

How does logrotate handle open files? Can logrotate rotate files that a process has open?
Kyle Brandt's user avatar
  • 84.3k
24 votes
7 answers
15k views

Continuously monitor logs with tail that are occasionally rotated

We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease. As far as I understand, the problem is that when the log is rotated, there is a new ...
xkcd150's user avatar
  • 928
2 votes
3 answers
2k views

Logrotate ERROR: No file found for /var/log/apache*/*error.log

Logrotate runs daily and emails me a report. This has been working fine however I now get the following email daily also: Date: Mon, 10 Aug 2009 04:02:08 +0100 From: [email protected] (Cron ...
Patrick Kiernan's user avatar
1 vote
2 answers
431 views

Log Rotate and OpenVZ Virtual Machines

I noticed that my OpenVZ virtual machines (VEs) don't have logrotate installed, and my logs are getting a bit big :-) Since the file systems of the VEs are exposed to the host via /vz/private/.. , ...
Kyle Brandt's user avatar
  • 84.3k
29 votes
3 answers
39k views

How i configure logrotate to not delete my log files after rotation?

There's a way to do this?
Guilherme's user avatar
  • 761
7 votes
3 answers
13k views

logrotate rename files with date

Right now, logrotate renames old log files to access.log.1.gz, access.log.2.gz, etc. I would prefer if it named them access.log.20090714.gz, access.log.20090715.gz, etc - one for each day. I cannot ...
Krystian Cybulski's user avatar
2 votes
1 answer
5k views

Best practices for web server log archiving (Linux + Nginx)

I want to preserve/archive all of my web server logs, and not have any of them be deleted by logrotate. What would a recommended approach be for this? This is a Linux box, running Nginx. Thanks in ...
user avatar
1 vote
3 answers
6k views

Apache access log rotation

I think my system is using logrotate for rotating logs including httpd logs The "current" files is logged here /var/log/httpd/ but I only see the last 5 days(I think) But how can I find where ...
user avatar
11 votes
4 answers
12k views

Cronolog vs logrotate

Which log rotation tool do you prefer?
Unknown's user avatar
  • 1,715

1
5 6 7 8
9