Skip to main content

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
0 votes
0 answers
32 views

Logrotate runs specific config only when executed manually

The legacy software (tango-controls) I am currently using on our servers stores logs in /var/tmp/ds.log as opposed to /var/log usually used by other software and I can't just change it. This software (...
KMadura's user avatar
0 votes
1 answer
78 views

Nginx not logging after Logrotate

I've a nginx reverse proxy with custom log files (depending on hostname) pwd : /var/log/nginx/domain/fqdn.(log|err) Since some time (maybe after switching to Ubuntu 23.10), my log files are very often ...
guillaumearnx's user avatar
0 votes
2 answers
161 views

Is it safe to use logrotate utility while logs are still being written by Apache?

I have a server where Apache mod_log_config mod is enabled. Using rotatelogs, it will produce a new log file once it reach 1GB : CustomLog "|/usr/sbin/rotatelogs /var/log/logs 1G" On the ...
tigrou's user avatar
  • 111
0 votes
2 answers
2k views

Logrotate in Debian 12

I have installed Debian 12 on a server and installed nginx service. However, Debian 12 don't have installed logrotate package. I would like know the best practice for this case, if should I install ...
Filipi Souza's user avatar
0 votes
1 answer
208 views

Ubuntu system logs written to ".log.1" instead of ".log" after rotation

I have an EC2 instance on AWS with Ubuntu 16.04.4 LTS where system logs are written into ".log.1" instead of ".log" (e.g. /var/log/auth.log.1 instead of /var/log/auth.log). This is ...
Henrik Koberg's user avatar
0 votes
1 answer
118 views

logrotate wont compress and delete syslog templated files

I am facing a very weird issue with logrotate and syslog files on my central syslog server. What is happening is that files generated by syslog templates are not compressed nor deleted when logrotate ...
giomanda's user avatar
  • 1,904
1 vote
0 answers
153 views

logrotate in centos does not rotate logs

Running centos 8 and have logrotate to rotate my logs for nginx. The logs rotate as expected if I run the command manually using "logrotate -v /etc/logrotate.conf", but do not run when the ...
Trevor Handermann's user avatar
0 votes
1 answer
315 views

Logrotate permission denied

I have a custom logrotate configuration like: /var/log/myapp-*log { daily rotate 7 missingok notifempty su www-data www-data } And when I run: sudo logrotate /etc/logrotate.d/...
Cerin's user avatar
  • 3,680
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 ...
xrkr's user avatar
  • 423
0 votes
0 answers
207 views

logrotate doesn't work even if status shows that the logrotate run on my files

hello guys i have a problem with my logrotate, in the status it shows me that the logrotate run on my files but no logrotate is done each day i don't know why. can someone help please ? I also need to ...
Abdel's user avatar
  • 1
0 votes
0 answers
472 views

inside nginx custom docker image, cron service is running but not the jobs executing

Dockerfile of nginx container FROM nginx:latest # Remove sym links from nginx image RUN rm /var/log/nginx/access.log RUN rm /var/log/nginx/error.log RUN apt-get update && apt-get install -y ...
Rajsekar Reddy's user avatar
1 vote
1 answer
314 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 ...
userskin's user avatar
-1 votes
1 answer
372 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); };...
19mike95's user avatar
3 votes
2 answers
953 views

How to automatically change the name of a file on a daily basis

I am new to Linux/CentOS and right now I am running into a little problem. My CentOS7 Server logs all Maillogs, via Logrotate, on a daily basis and moves them to the folder /var/log/old_maillogs. ...
Moritz's user avatar
  • 65
0 votes
2 answers
164 views

Logrotate group of files if any member is eligible

I have a group of log files (they are related but that's application level and not relevant). I want to set up logrotate configuration on Debian linux to rotate the whole group (all the files) once ...
wick's user avatar
  • 157
0 votes
1 answer
588 views

Nginx doesnt' log into access.log

I'v been struggling with Nginx logging. A problem that I found out first was logrotate failure. so I've changed user to the same owner of nginx worker process which is www-data and I forced logrotate, ...
Taylor's user avatar
  • 1
0 votes
0 answers
1k views

logrotate works manually but not works automatically via cron on Ubuntu 18.04

I have a logrotate task to rotate my nginx logs. I have my config file in /etc/logrotate.d/nginx. When I run logrotate -f /etc/logrotate.d/nginx, it can rotate the logs correctly, which means my ...
Hank Chow's user avatar
  • 111
1 vote
2 answers
765 views

Logrotate is not working in /tmp

I'm facing a strange problem with logrotate on my Debian 10 server. All in one, logrotate (v3.20.1) is working and rotating fine... except for some files in /tmp that I want to "skrink" ...
sbocquet's user avatar
2 votes
1 answer
251 views

logrotate fails to run Java postrotate program

Somewhat recent versions of logrotate fail to execute postrotate actions that invoke Java when logrotate is started via systemd. In my logs I see: logrotate[123]: Error occurred during initialization ...
C-Otto's user avatar
  • 374
-1 votes
2 answers
821 views

ESXi rotate logfiles by hours

ESXI: 70u2 Hi, I can't found "/etc/logrotate.conf", I understand he don't exist in this version. In the file "/etc/vmsyslog.conf" I can specify some options, the split by size has ...
CH06's user avatar
  • 13
0 votes
0 answers
741 views

Can run daily logrotate without cron?

On my docker, i use amazonlinux:2 at this default enviroment not install cron. I want to use logrotate for rotating log of application every daily. Can Logrotate work automatic without cron? This file ...
VoVuong's user avatar
1 vote
0 answers
194 views

Logrotate Create Mode Issue

I have a trouble with logrotate service in linux. I have a logrotate config for mongodb log as below: /var/log/mongodb/mongod.log { rotate 10 daily dateext dateformat %Y-%m-%d-%s ...
Fatemeh Davoudi's user avatar
0 votes
1 answer
2k views

apache in docker: best practice to manage logs written to mounted volume?

What the best practice to write and manage log files written by Apache HTTPD running in a container? We run Apache HTTPD using docker base image httpd:2.4-bullseye. Right now HTTPD is configured to ...
chrisinmtown's user avatar
0 votes
0 answers
177 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/...
vansh kumar's user avatar
1 vote
0 answers
352 views

logrotate on ubuntu 20.04.4 won't run *my config* in systemd

I have a a few processes that output logs to /var/tmp/ and /tmp/. I am trying to get logrotate to work on them using a file I have put in /etc/logrotate.d/. One set of files is generated by rsyslog ...
Jacques Amar's user avatar
0 votes
1 answer
5k 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'. ...
theirman's user avatar
0 votes
0 answers
2k views

How to avoid data loss during log rotation in linux/kubernetes?

Brief We are running our workloads in kubernetes on AWS EKS. All our applications write the logs in /var/log/app_logs directory using hostPath. (yes it's not a best practice, this is due to legacy ...
dm90's user avatar
  • 101
1 vote
1 answer
2k views

Logrotate Fails Without Error

Ok, I made a boo-boo. I think Problem: Logrotate fails (or I incorrectly think its dead) and does not provide any error message to explain why: ● logrotate.service - Rotate log files Loaded: loaded ...
Maestro223's user avatar
0 votes
1 answer
292 views

What is the default configuration for logrotate.conf in Ubuntu?

In /etc/logrotate.conf is user permission different from one ubuntu version to another? .... and why ?? as i found it like that in ubuntu 18.04 # use the syslog group by default, since this is the ...
User.. 's user avatar
1 vote
2 answers
2k views

GitLab with local IP install hangs at logrotate

I am trying and failing to install GitLab (EE) onto an on-premises bare-metal server PC running Ubuntu Server 20.04. The server is intended to later have internet-facing access, but for now it needs ...
rdi_pck's user avatar
  • 31
0 votes
1 answer
444 views

How does logrotate work?

What exactly does logrotate do when it "rotates" a log file? For example, does it rename the existing file and create a new one with the old name? This article describes restarting a service ...
TS_'s user avatar
  • 3
1 vote
1 answer
668 views

Rotation not executing when file size reaches certain threshold

I have the following configurations in /etc/logrotate.d/rsyslog: /var/log/syslog { rotate 7 size 1G missingok notifempty delaycompress compress ...
justanotheruser1019's user avatar
1 vote
1 answer
4k views

Logrotate not writing to new .log file

I have 4 custom systemd services that write to custom logs in /var/log/. I set up a logrotate config file, but it is not writing to the newest log. It is still writing to the old .log.1 file. The new ...
DevOpsSauce's user avatar
2 votes
2 answers
10k views

Logrotate Service Failure

My logrotate service failes. It complains about a duplicate entry for modsecurity. ● logrotate.service - Rotate log files Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor ...
Maestro223's user avatar
1 vote
1 answer
48 views

Logrotate daily issue

I have a problem with logrotate. Each day I have a script that saves over 180 configs froms switchs and routers. Via tftp it puts the files into /scripts/backups/ with the text extension. The names of ...
IoNuTz's user avatar
  • 11
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/...
sarvesh.lad's user avatar
0 votes
0 answers
942 views

Nginx/Openresty keeps creating an empty log file and writes in the previous one causing logs to never get rotated

My Django app runs on an nginx/openresty server. The user running the server is root:root but typically the app is owned by webapp:webapp. This means logs get created and written on by root. The ...
dabadaba's user avatar
  • 101
1 vote
1 answer
1k views

logrotate postrotate seems not being executed

I have this configuration on Ubuntu 20.04: /home/impulse/nginx/log/*/notice.log /home/impulse/nginx/log/*/access.status_ok.log /home/impulse/nginx/log/*/access.status_erro.log { daily nomail ...
Niloct's user avatar
  • 121
1 vote
1 answer
614 views

Logrotate Says It Rotated Logs, But Didn't

OK, here's my situation. I'm trying to use logrotate to rotate VNC logs for a specific user on an hourly basis. Based on the feedback I get when I run the utility, the log rotation goes off, but ...
Jeff D.'s user avatar
  • 11
0 votes
1 answer
542 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 ...
Rasa's user avatar
  • 1
2 votes
0 answers
195 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 ...
sgon00's user avatar
  • 173
0 votes
1 answer
1k views

Rsyslog rotates, but still logging to old log

Server: Ubuntu Server 14.04 I have a Watchguard Firebox logging to a server. It is supposed to rotate daily, however, when the rotate occurs, it doesn't write to the new log. It keeps writing to the ...
DevOpsSauce's user avatar
1 vote
0 answers
1k views

Logrotate permission errors when using compress

I'm struggling to make logrotate work. Basically I just want to have a cronjob run once an hour to rotate my logs. Now I had this working initially but logrotate completely crapped itself and stopped ...
sjaak's user avatar
  • 111
1 vote
0 answers
156 views

logrotate not rotating file, but is running

Running CentOS 7 and have several logrotate scripts. For the past several days I've noticed it hasn't rotated my files. When I check logrotate.status it says it ran, but my logs are indeed not ...
Phaelax z's user avatar
  • 111
1 vote
1 answer
776 views

Null after logrotate copytruncate

I am using logrotate to manage my logs. As I have to manage a bunch of log files. My logrotate config looks like /log/typeA*.log /log/typeB*.log /log/typeC*.log{ daily rotate 7 ...
Pranjal Doshi's user avatar
0 votes
1 answer
136 views

Logrotate wtmp `su prime gadmin` Contabo Ubuntu 20.04

Logrotate gives error in Ubuntu server 20.04 from Contabo VDM: Oct 31 00:00:01 foo logrotate[364456]: error: wtmp:3 unknown user 'prime' Oct 31 00:00:01 foo logrotate[364456]: error: found error in /...
Miroslav Popov's user avatar
0 votes
2 answers
3k 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/...
ignacio's user avatar
  • 101
4 votes
1 answer
10k views

NGINX service rotate doesn't use new log files

I'm having issues with any commands which tell nginx to use new log files. I'm using Ubuntu 18.04, nginx/1.14.0, logrotate 3.11.0 If I create new access.log or error.log files in /var/log/nginx, ...
x3nr0s's user avatar
  • 289
0 votes
1 answer
475 views

How to sort incoming log messages by their hostname & timestamp with Rsyslog?

I was curious if anyone has sorted incoming logs captured by Rsyslog by hostname and time stamp in the log. Right now I have Rsyslog sort messages by the hostname moving them to appropriate folders ...
cabotek's user avatar
0 votes
1 answer
467 views

Logrotate - Is there a conflict?

/etc/logrotate.d/auth.conf is somnething I created manually. But there is a entry for /var/log/auth.log in /etc/logrotate.d/rsyslog as well. Is there a conflict? Do I have to remove auth.log entry ...
user630702's user avatar

1
2 3 4 5
9