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.

learn more… | top users | synonyms

1
vote
1answer
4k 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 ...
0
votes
2answers
274 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 ...
1
vote
3answers
5k 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 ...
3
votes
3answers
926 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 ...
0
votes
2answers
291 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 ...
8
votes
2answers
2k 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 conf, I have delaycompress enabled. Does Apache really need this (as the logrotate documentation says ...
9
votes
3answers
13k 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 ...
1
vote
0answers
297 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 } ...
5
votes
1answer
1k 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 ...
0
votes
3answers
1k 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 ...
0
votes
1answer
181 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 ...
0
votes
1answer
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 ...
0
votes
2answers
1k 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 ...
1
vote
1answer
667 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 ...
0
votes
1answer
207 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 ...
0
votes
1answer
991 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 ...
8
votes
2answers
5k 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 ...
7
votes
5answers
18k 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 ...
4
votes
4answers
2k 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 ...
2
votes
2answers
426 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, ...
5
votes
4answers
4k 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 rotate 1 ...
2
votes
2answers
355 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 ...
3
votes
1answer
5k 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 ...
4
votes
3answers
3k 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 ...
5
votes
2answers
5k 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 ...
1
vote
1answer
181 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.
1
vote
8answers
980 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 ...
2
votes
2answers
217 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 ...
2
votes
2answers
844 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 ...
10
votes
5answers
8k 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 ...
8
votes
3answers
6k 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 ...
1
vote
2answers
4k 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 ...
13
votes
3answers
3k views

Logrotate and Open Files

How does logrotate handle open files? Can logrotate rotate files that a process has open?
16
votes
8answers
4k views

Continuosly 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 ...
2
votes
3answers
1k 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: root@localhost.localdomain (Cron ...
1
vote
2answers
347 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/.. , ...
10
votes
3answers
9k views
5
votes
3answers
4k 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 ...
2
votes
1answer
2k 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 ...
1
vote
3answers
2k 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 ...
8
votes
4answers
4k views

Cronolog vs logrotate

Which log rotation tool do you prefer?