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.

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.

Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the criterium for that log is based on the log’s size and logrotate is being run multiple times each day, or unless the -f or -force option is used.

Any number of config files may be given on the command line. Later con- fig files may override the options given in earlier files, so the order in which the logrotate config files are listed in is important. Nor- mally, a single config file which includes any other config files which are needed should be used. See below for more information on how to use the include directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file.

If no command line arguments are given, logrotate will print version and copyright information, along with a short usage summary. If any errors occur while rotating logs, logrotate will exit with non-zero status.

AUTHORS

   Erik Troan 
   Preston Brown 
436 questions
0
votes
2 answers

logrotate fails to instruct Apache to reopen logs on Amazon Linux

I have very good experience with logrotate normally, but on a recent installation using "Amazon Linux" (CentOS 6 deployed by Amazon) on EC2, logrotate fails to cause Apache to reopen its logs. The logrotate configuration for Apache is slightly…
Guss
  • 2,670
  • 5
  • 34
  • 59
0
votes
2 answers

apache access.log to keep only records from last 3 monthes

I need Apache accesslog file to be parsed fast in realtime and always to keep only last 3 months data. So I need tool which everyday cutting old records(and moving them to another file) from log file while keeping same filename for main…
Boris Ivanov
  • 161
  • 8
0
votes
1 answer

Understanding logrotate's create directive

There is a web application (php/apache2) which opens a log file somewhere at a start of a request handling and closes it (as far as I know) when the handling is finished. Between log file open and close, entries are of course written. Let's assume…
Dariusz Walczak
  • 205
  • 1
  • 2
  • 6
0
votes
2 answers

logrotation size limit is not effecting

I have fixed size limit in logrotation 1M. The script run on every hours even though its rotating less than 1Mb files. I dont know what i have done wrong. Below is my configuration parameters. /opt/PostgreSQL/8.4/data/pg_log/postgresql-* { …
sathish
  • 1
  • 2
0
votes
3 answers

Apache log rotation: logrotate vs rotatelogs vs chronolog

I have been researching log rotation for my server which hosts ~5 fairly high traffic sites. From what I can tell, my options are to use logrotate or to use piped logging with either rotatelogs or chronolog. logrotate requires a restart of apache…
Enrico
  • 491
  • 2
  • 6
  • 15
0
votes
2 answers

logrotate not working. Is this configuration correct?

/var/log/apache2/*.log { daily missingok rotate 31 compress delaycompress notifempty create 640 root adm sharedscripts postrotate if [ -f "`.…
orokusaki
  • 2,763
  • 4
  • 32
  • 43
0
votes
1 answer

directory which stores logs has grown to 3.7 GB how can I manage

I am having this situation the log file /var/log/auth.log on my server has grown very large in size.A lot of webserver are running on it and similar stuff I see the log entries since 15 days have not been recorded. I have been doing an SSH on it…
Bond
  • 781
  • 4
  • 12
  • 22
0
votes
2 answers

logrotate pattern matching for daemon restart

In a setup very much like: http://wiki.apache.org/httpd/ExtendingPrivilegeSeparation I have logs located in /var/weblog//error_log I would like to use logrotate to rotate these logs 50M, gzip the rest, and keep 5. Instead of repeating the…
0
votes
2 answers

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 -rw-r--r-- 1 root admin 0 Sep 19 04:02…
Nikolaidis Fotis
  • 2,032
  • 11
  • 13
0
votes
2 answers

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 here is the logrotate.conf that is also in the…
Tom Viner
  • 101
  • 2
0
votes
1 answer

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 generating the log is a Java application. 2 I set…
Ariod
  • 179
  • 2
  • 5
  • 13
0
votes
1 answer

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 configuration?
Mohammad Alam
0
votes
2 answers

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/orwell/orwell-setup/bin/logrotate-nginx And the…
tzulberti
  • 113
  • 2
  • 6
0
votes
1 answer

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 mod_log_rotate, with a 1.3 version and (only) 2.0…
0
votes
1 answer

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 wondering if there was a way to have apache log to a…
Mohan Gulati
  • 211
  • 1
  • 2
  • 4