Questions tagged [log-rotation]
Log rotation is an automated process used in system administration in which dated log files are archived.
68 questions
0
votes
1
answer
420
views
How to prevent Kubernetes log rotation from compressing files?
Hi we have Kubernetes log rotation setup to rotate every 100MB. We have a Filebeat daemonset reading the /var/log/pods folder.
That works all nice and dandy except when we experience large volume, ...
0
votes
0
answers
29
views
Need help in logrotation
I have custom logrotation as below..
cat /etc/logrotate.d/apache
#
#
/var/log/apache/apache.log
{
daily
rotate 30
size 1G
compress
missingok
...
1
vote
1
answer
535
views
how to make logrotate take filesize into consideration when rotating
Lets say I want to logrotate when the filesize is 1kb . Before the run if the filesize of the log is 4kb I expect logrotate to create 4 different log files.
Before:
something.log (4kb)
What I expect ...
-1
votes
1
answer
508
views
Sending rotated files with syslog-ng
Hello I am currently sending the suricata logs from a probe to a Syslog-ng server(172.16.238.15):
@version: 3.25
options {
keep-timestamp (no);
chain_hostnames (off);
keep_hostname (no);
};...
1
vote
1
answer
379
views
Where can I find older wtmp log files?
Every so often the last log is rotated out and stored in /var/log as wtmp* however when I look in my system in /var/log I only see the current wtmp file and the wtmp* file before it. I know the ...
0
votes
0
answers
389
views
how to handle extreme hug Weblogic server .out file?
Weblogic server under logs folder has servername.out0000x files which are extreme huge. Log folder is over 1.4TB and some servername.out000 files are over 100 G.
How these file can be reduced size or ...
0
votes
0
answers
182
views
Logs are not shifting to new directory after log rotation
I am facing issue. We have setup log forwarder for sentinel and logs are frequently coming on /var/log/messages.
Actual problem is
i have created one script for log rotation and placed it under /etc/...
0
votes
1
answer
6k
views
How to properly configure a custom logrotate configuration file?
For the first time today, I am trying to write a configuration file for logrotate. When I restart the logrotate service, I get the following error: logrotate.service: Failed with result 'exit-code'.
...
1
vote
1
answer
3k
views
How to configure log rotate to compress and archive logs weekly [closed]
We have rsyslog that save logs based on requirement to various directories:
/opt/logs/stats/dc1/stats_YYYY-MM-DD_%somename%.log
/opt/logs/stats/dc2/stats_YYYY-MM-DD_%somename%.log
/opt/logs/events/dc1/...
0
votes
1
answer
662
views
How to rotate compressed log file on centos 7?
I have customized kafka server and the app is creating log files and configures log rotation. My problem is that I need to compress the rotation logs that were created.
I tried to create new log ...
2
votes
0
answers
214
views
Is that possible to let "multilog" program output human-readable file name instead of TAI64N timestamp name?
I am using "multilog" to do log rotation in debian server.
When the log roates, "multilog" will create a filename as @TAI64N_timestamp.s or @TAI64N_timestamp.u.
I know I can ...
0
votes
2
answers
4k
views
Is logrotate supposed to work only in logs inside /var/log?
I currently have a systemd service in a Ubuntu 18.04 machine that redirects the StandardOuput and StandardError to a custom path:
StandardError=file:/opt/my_tests/my.log
StandardOutput=file:/opt/...
0
votes
0
answers
44
views
logrotate broken yet not error message
It seems like there are quite a few common issues with logrotate not doing what it suppose to and as it happens I am in the same boat.
-rw-r--r-- 1 root root 24G Jun 23 01:15 A10.log
-rw-r--r-- 1 ...
3
votes
0
answers
982
views
Time-based rotation of Docker logs
We are running a stack of Docker Swarm services and, according to our Privacy Policy, we have to keep logs only for the last 6 months, but no older. I was trying to achieve it through different ...
1
vote
1
answer
717
views
Logrotate docker container's logs when user doesn't exist on host
I mounted my containers' logs to the host (e.g. /var/log/container1, etc). Now I want to use the host's logrotate.
But suppose I need to do this:
create 660 mysql mysql
There is no mysql user/group ...
1
vote
1
answer
525
views
Log Rotate doesn't rotate logs [duplicate]
I have a logrotate running on Aws ec2 instance which is trying to rotate logs under /var/log/tomcat8/ every hour. I have below configuration under /etc/logrotate.d/rotate_tomcat:
"/var/log/tomcat8/...
2
votes
1
answer
5k
views
How to move compressed files with logrotate
This is probably insanely easy to do, but I can't find anything relevant to the topic. I'm setting up a custom logrotate.conf file for the logs in our service. As part of this, I would like to keep ...
2
votes
1
answer
92
views
Apache outputting without .log
I am trying to fix an issue where an apache log is filling the /var/log/ partition. It is a single log in apache2 that is almost 4GB. I have set logrotate to rotate out at 3G, but it has not rotated ...
2
votes
0
answers
528
views
Logrotate not rotating without size config
On RedHat, I have a logrotate configuration as follows :
/custom/path/kibana/logs/*.log {
missingok
daily
create 0644 suuser suuser
rotate 7
notifempty
sharedscripts
compress
dateext
...
1
vote
1
answer
550
views
The logrotate 'rotate' directive and migrating from daily to weekly
I have a server collecting syslog messages from the network. Logrotate is currently setup and working, and the config looks like such:
/logs/*/log {
daily
rotate 60
}
Instead of rotating ...
1
vote
1
answer
759
views
What does the --force flag change about the behaviour of logrotate?
I am trying to find out why logrotate is only rotating a subset of logfiles in a folder when run without the --force flag. The man page for logrotate --force simply says:
Tells logrotate to force ...
2
votes
1
answer
4k
views
Name rotated auditd logs with date
Can auditd use a date instead of an integer to name its rotated audit logs? Right now I have
audit.log
audit.log.1
audit.log.2
...
When audit.log fills up all of the files are rotated one number ...
0
votes
1
answer
3k
views
where is rotation policy of logs under /var/log/messages-*
I would like to know how messages log file /var/log/messages are rotated.
I checked in /etc/logrotate.conf file and inside /etc/logrotate.d/ directory but nothing that could explain the rotation.
...
0
votes
1
answer
1k
views
Logrotate Separate Policies in Same Directory
I am running rsyslog on CentOS and logrotate to rotate my logs. All hosts write their logs to /var/log/syslog/ in their own separate directory in this manner:
/var/log/syslog/host1
/var/log/syslog/...
0
votes
0
answers
1k
views
Does logrotate check diskspace before rotating a logfile?
I am trying to figure out how logrotate work regarding disk space but not able to figure it out?
Scenario:
Let say I have 2GB of the log file and free disk space is also 2 GB, does logrotate first ...
1
vote
1
answer
2k
views
How to rotate mySQL query logs on Windows
I'm seeing conflicting (or complementary) answers on how to rotate mySQL logs and want to know if each method is sufficient in itself, or if I need to use a combination of both.
One method, suggested ...
1
vote
0
answers
146
views
Glassfish - log System.err to second location or do something after logrotate
we have a GF4 server that produces a lot of logs. Currently it is setup like this:
com.sun.enterprise.server.logging.GFFileHandler.excludeFields <>
com.sun.enterprise.server.logging....
1
vote
2
answers
4k
views
logrotate status files extremely large
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/...
0
votes
1
answer
2k
views
Logrotate with `copytruncate` "data loss" - is it serious?
Manpage of logrotate claims that using copytruncate option leads to "a very small time slice between copying the file and truncating it, so some logging data might be lost". Is it actually ...
3
votes
0
answers
5k
views
Nginx log rotation according to size
I'm using below cfg for log rotation by size but it's not working.
/var/log/nginx/access_log {
rotate 7
size 5k
dateext
dateformat -%Y-%m-%d
missingok
compress
...
0
votes
3
answers
3k
views
Ideal log rotation configuration for overloaded site
I've been in charge of a server that has been stressed beyond its tipping point for some time. I've recommended changes that are currently in the process of being implemented by other members of the ...
2
votes
1
answer
509
views
Apache log4j cloudstack log rotation archival policy
I am trying to limit the number of logs that are kept on my cloudstack management server. I am running log4j 1.2 and have recently added "<param name="MaxBackupIndex" value="31"/>" to my config (...
0
votes
1
answer
4k
views
logrotate when size reaches 10M
Please kindly advise/assist. I want to set up logrotate that does the following:
when the log file size reaches 10M,the file is rotated and also there is no keeping of older compressed log files.
I ...
0
votes
0
answers
1k
views
Use `tail` to rotate nginx logs in order have a single log file capped in size
Can use tail to rotate a nginx log file in orderer to have a single log file capped in size?
tail -c 1000000 access.log > temp.log
mv temp.log access.log
kill -USR1 `cat /var/run/nginx.pid`
The ...
4
votes
2
answers
4k
views
logrotate not writing logs to correct file
I have a production system on which there are multiple nginx apps hosted. those are nginx applications servers. Now for each of these nginx app servers a logrotate config file is configured in /etc/...
0
votes
2
answers
478
views
What is rotating my mail logs
In looking at my /var/log dir, I can see that my mail.log and mail.err files are being rotated.
An increasing digit is appended to the the end of the logs every six days and after the second long, ...
0
votes
1
answer
1k
views
Logrotate failing with `No data available` error
I'm using logrotate for various log rotation tasks, including rotating log files for the postgresql pooling utility pgbouncer.
pgbouncer logs expansively - I accumulate many GBs in a couple of days -...
1
vote
0
answers
2k
views
Logrotate not working with "daily"
Below is my logrotate configuration.I was not able to get the logrotate work using
"sudo /usr/sbin/logrotate /etc/logrotate.conf".But if I execute "sudo logrotate -f /etc/logrotate.conf" it is ...
-1
votes
1
answer
699
views
Logrotate is not working centos 6.6
I have the following configuration for logrotating the app logs.
/opt/tomcat/logs/app-web.txt {
copytruncate
daily
size 500M
compress
delaycompress
rotate 0
missingok
...
0
votes
1
answer
439
views
How to compress and remove olde compressed files using logrotate when the file has a date in its name?
I'm generating files daily named as my_file_YYYYMMDD.csv (for instance, my_file_20160406.csv, my_file_20160407.csv and so on).
I want logrotate to compress them daily and that it keep just the last ...
0
votes
0
answers
682
views
Logrotate does not work daily, but the status file says it does
This is my logrotate script:
/var/log/pyApi.log /var/log/runGet*.log {
daily
missingok
rotate 7
compress
notifempty
nocreate
su
}
Already checked /var/lib/logrotate/...
0
votes
1
answer
6k
views
(2)No such file or directory: AH00104: unable to start piped log program
Well sometimes apparently easy things turn into disaster.
As soon as I add to the VirtualHost:
CustomLog "|usr/sbin/rotatelogs -l ${APACHE_LOG_DIR}/01030/%Y%W_01030.access.log 604800" combined
I ...
2
votes
0
answers
301
views
Logrotation performance
One question about logrotation on a dedicated webserver (64gb RAM) with apache and mysql. In high load hours (2k users online every moment) we are experiencing a strange behaviour.
As an example, at ...
2
votes
0
answers
1k
views
Rotation and continuous writing of large log files with rsyslogd
I have an extremely busy log file (let's call it /var/log/service.log) that is also frequently searched for troubleshooting reasons. Output to it is nearly continuous and 24/7. It probably puts out ...
1
vote
1
answer
666
views
logrotation process stdout and stderr windows
I have a service on windows that's running another process that prints many lines to its STDERR and STDOUT. I'm capturing those lines and redirect them to some log file. I would like to logrotate on ...
3
votes
1
answer
5k
views
Syslog logging to syslog.1 not syslog
My syslog file is getting a bit unmanageable. I believed I had configured this previously to rotate daily but obviously something has gone amiss.
At the moment, my /var/log looks like this:
-rw-r----...
2
votes
1
answer
938
views
NGINX and log rotation: is missing log entries possible?
In it's simplest realization, one can implement NGINX log rotation as following:
mv access.log access.log.0
kill -USR1 `cat master.nginx.pid`
My question. Do we have a concurrency issue here? I mean,...
0
votes
2
answers
8k
views
freebsd's newsyslog.conf daily logs rotate
I'm trying to utilize newsyslog.conf -- newsyslog(8) configuration file to rotate my apache/nginx/squid log files:
# uname -a
FreeBSD X 9.2-RELEASE-p17 FreeBSD 9.2-RELEASE-p17 #0 r282430: Mon May 4 ...
1
vote
2
answers
745
views
/etc/init.d/apache2 file is being log rotated
I have monitored some strange behavior. Every week at logrotate process time, the apache2 daemon script /etc/init.d/apache2 is being rotated as if it was a log file.
The first week it created another ...
5
votes
1
answer
248
views
MongoDB Oplog Security
We are using a MongoDB replica set for sharing sessions and other (potentially sensitive) data in a web farm.
All the data we store uses TTL indexes to expire documents after a relatively short ...