Giter VIP home page Giter VIP logo

logrotate's Introduction

Dockerized Logrotate

Open Issues Stars on GitHub Docker Stars Docker Pulls

This container can crawl for logfiles and rotate them. It is a side-car container for containers that write logfiles and need a log rotation mechanism. Just hook up some containers and define your backup volumes.

Supported tags and respective Dockerfile links

Distribution Version Tag Dockerfile
Logrotate Alpine latest, 1.3 latest, 1.3 Dockerfile

Make It Short

In short, this container can rotate all your Docker logfiles just by typing:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  blacklabelops/logrotate

This will rotate all your Docker logfiles on a daily basis up to 5 times.

You want to do it hourly? Just type:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_INTERVAL=hourly" \
  blacklabelops/logrotate

This will put logrotate on an hourly schedule.

How To Attach to Logs

In order to attach the side-car container to your logs you have to hook your log file folders inside volumes. Afterwards specify the folders logrotate should crawl for log files. The container attaches by default to any file ending with .log inside the specified folders.

Environment variable for specifying log folders: LOGS_DIRECTORIES. Each directory must be separated by a whitespace character.

Example:

LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker

Example Logrotating all Docker logfiles:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  blacklabelops/logrotate

This will logrotate any logfile(s) under /var/lib/docker/containers, /var/log/docker (or subdirectories of them).

Customize Log File Ending

You can define the file endings fluentd will attach to. The container will by default crawl for files ending with .log. This can be overriden and extended to any amount of file endings.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOG_FILE_ENDINGS=json xml" \
  blacklabelops/logrotate

Crawls for file endings .json and .xml.

Set the Log interval

Logrotate can rotate logfile according to the following intervals:

  • hourly
  • daily
  • weekly
  • monthly
  • yearly

You can override the default setting with the environment variable LOGROTATE_INTERVAL.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_INTERVAL=hourly" \
  blacklabelops/logrotate

This will logrotate logfile(s) on hourly basis.

Set the Number of Rotations

The default number of rotations is five. Further rotations will delete old logfiles. You can override the default setting with the environment variable LOGROTATE_COPIES.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_COPIES=10" \
  blacklabelops/logrotate

Will create 10 daily logs before deleting old logs.

Set Maximum File size

Logrotate can do additional rotates, when the logfile exceeds a certain file size. You can specifiy file size rotation with the environment variable LOGROTATE_SIZE.

Valid example values:

  • 100k: Will rotate when log file exceeds 100 kilobytes.
  • 100M: Will rotate when log file exceeds 100 Megabytes.
  • 100G: Will rotate when log file exceeds 100 Gigabytes.
$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_SIZE=10M" \
  blacklabelops/logrotate

This will logrotate when logfile(s) reaches 10M+.

Set Log File compression

The default logrotate setting is nocompress. In order to enable logfile compression you can set the environment variable LOGROTATE_COMPRESSION to compress.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_COMPRESSION=compress" \
  blacklabelops/logrotate

This will compress the logrotated logs.

Turn Off Log File delaycompress

When compression is turned on, delaycompress will be set by default. To turn this off, set the environment variable LOGROTATE_DELAYCOMPRESS to false.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_COMPRESSION=compress" \
  -e "LOGROTATE_DELAYCOMPRESS=false" \
  blacklabelops/logrotate

This will compress all logrotated logs, including the most recent one.

Set logrotate mode

By default, logrotate will use copytruncate mode to create a new rotated file, however certain log collection applications won't work properly with this configuration. To use a different option, such as create <mode> <owner> <group>, set the environment variable LOGROTATE_MODE.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_MODE=create 0644"
  blacklabelops/logrotate

This will rename the current log file, and create a new one in its place

Set the Output directory

By default, logrotate will rotate logs in their respective directories. You can specify a directory for keeping old logfiles with the environment variable LOGROTATE_OLDDIR. You can specify a full or relative path.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -v $(pwd)/logs:/logs/ \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_OLDDIR=/logs" \
  blacklabelops/logrotate

Will move old logfiles in the local directory logs/.

Set the Cron Schedule

You can set the cron schedule independently of the logrotate interval. You can override the default schedule with the enviroment variable LOGROTATE_CRONSCHEDULE.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_CRONSCHEDULE=* * * * * *" \
  blacklabelops/logrotate

This will logrotate on go-cron schedule * * * * * * (every second).

Log and View the Logrotate Output

You can specify a logfile for the periodical logrotate execution. The file is specified using the environment variable LOGROTATE_LOGFILE. Must be a full path!

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -v $(pwd)/logs:/logs \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_INTERVAL=hourly" \
  -e "LOGROTATE_LOGFILE=/logs/logrotatecron.log" \
  blacklabelops/logrotate

You will be able to see logrotate output every minute in file logs/logrotatecron.log.

Logrotate Commandline Parameters

You can define the logrotate commandline parameters with the environment variable LOGROTATE_PARAMETERS.

v: Verbose

d: Debug, Logrotate will be emulated but never executed!

f: Force

Example for a typical testrun:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -v $(pwd)/logs:/logs \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_PARAMETERS=vdf" \
  -e "LOG_FILE=/logs/cron.log" \
  blacklabelops/logrotate

Will run logrotate with: /usr/bin/logrotate -dvf

Logrotate Status File

Logrotate must remember when files have been rotated when using time intervals, e.g. 'daily'. The status file will be written by default to the container volume but you can specify a custom location with the environment variable LOGROTATE_STATUSFILE.

Example:

$ docker run -d \
  -e "LOGROTATE_INTERVAL=hourly" \
  -e "LOGROTATE_STATUSFILE=/logrotate-status/logrotate.status" \
  -e "ALL_LOGS_DIRECTORIES=/var/log" \
  -e "LOGROTATE_PARAMETERS=vf" \
  blacklabelops/logrotate

Writes the latest status file each logrotation. Reads status files at each start.

Log and View the Cron Output

You can specify a separate logfile for cron. The file is specified using the environment variable LOG_FILE. Must be a full path!

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -v $(pwd)/logs:/logs \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_INTERVAL=hourly" \
  -e "LOG_FILE=/logs/cron.log" \
  blacklabelops/logrotate

You will be able to see cron output every minute in file logs/cron.log.

Setting a Date Extension

With Logrotate it is possible to split files and name them by the date they were generated when used with LOGROTATE_DATEFORMAT. By setting LOGROTATE_DATEFORMAT you will enable the Logrotate dateext option.

The default Logrotate format is -%Y%m%d, to enable the defaults LOGROTATE_DATEFORMAT should be set to this.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGROTATE_INTERVAL=daily" \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_DATEFORMAT=-%Y%m%d" \
  blacklabelops/logrotate

This will set logrotate to split files and name them by date format -%Y%m%d.

Setting MaxAge and minsize

Maxage and minsize for logs can be configured with the environment variables LOGROTATE_MAXAGE and LOGROTATE_MINSIZE.

  • Maxage: Remove rotated logs older than <count> days. The age is only checked if the logfile is to be rotated.
  • Minsize: Log files are rotated when they grow bigger than size bytes, but not before the additionally specified time interval (daily, weekly, monthly, or yearly). The related size option is similar except that it is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time. When minsize is used, both the size and timestamp of a log file are considered.

Source

Size Parameter: If size is followed by k, the size is assumed to be in kilo-bytes. If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G are all valid.

Source

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_MAXAGE=60" \
  -e "LOGROTATE_MINSIZE=100k" \
  blacklabelops/logrotate

Maxage is sixty days and minsize is 100 kilobytes.

Custom Script execution

Sometimes it is necessary to signal the process in order to start logrotation or stop logrotation. You can do this with the environment variables LOGROTATE_PREROTATE_COMMAND and LOGROTATE_POSTROTATE_COMMAND.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_PREROTATE_COMMAND=/usr/bin/yourscript.sh" \
  -e "LOGROTATE_POSTROTATE_COMMAND=/usr/bin/killall -HUP httpd" \
  blacklabelops/logrotate

Will print messages before and after rotation.

Disable Auto Update

With Logrotate by default it auto update its logrotate configuration file to ensure it only captures all the intended log file in the LOGS_DIRECTORIES (before it rotates the log files). It is possible to disable auto update when used with LOGROTATE_AUTOUPDATE. By setting LOGROTATE_AUTOUPDATE (to not equal true) you will disable the auto update of Logrotate.

The default LOGROTATE_AUTOUPDATE is true, to disable the defaults LOGROTATE_AUTOUPDATE should be set not equal true.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "LOGROTATE_AUTOUPDATE=false" \
  blacklabelops/logrotate

This will disable logrotate configuration file update (when logrotate action is triggering).

Set Time Zone

With Logrotate by default it logrotate logs in UTC time zone. It is possible to set time zone when used with TZ. By setting TZ (to a valid time zone) it will logrotate logs in the specified time zone.

The default TZ is "", to set to different time zone. E.g Australia/Melbourne.

Example:

$ docker run -d \
  -v /var/lib/docker/containers:/var/lib/docker/containers \
  -v /var/log/docker:/var/log/docker \
  -e "LOGS_DIRECTORIES=/var/lib/docker/containers /var/log/docker" \
  -e "TZ=Australia/Melbourne" \
  blacklabelops/logrotate

This will logrotate in Australia/Melbourne time zone.

Used in Kubernetes

When we run container in Kubernetes, we can use the logrotate container to rotate the logs. As we create

An DaemonSet in cluster ,we can deploy an logrotate container in every nodes of the cluster.

# kubectl create -f logrotate_ds.yaml
daemonset "logrotate" created

References

logrotate's People

Contributors

bhperry avatar chrif avatar msh100 avatar ravikumawat7716 avatar yan234280533 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logrotate's Issues

Pre/post scripts

How would one go about sending a signal from one container process to another container process?

For nginx, the worker needs to be gracefully restarted to remove the file handle on the log files via something like:

postrotate
  [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript

But, as a sidecar, how would you do this without exposing the docker control socket?

Question: will logs keep expiring when a container dies

Hi, one quick question, if a container dies/recreated with a new container ID, and the old one is deleted, e.g. by K8s, will the rotated logs expire after the expected date?

I guess not, since the config is updated to new containers. If this is true, is there a way to handle this?

Thanks!

Healthcheck?

Hi is there some way to do a healthcheck when using blacklabelops/logrotate?

Dockerhub Build Fail

The new image is Alpine Docker 1.9 conform. Dockerhub is still on Docker 1.8 build slaves. This ticket is to remind me to check builds.

Imagelayers also seems to have problems when Dockerhub builds fail.

Add 'ignore folders' option?

Hi

I'm not sure if this container is abandonware or not, but I just discovered and implemented it, and it seems perfect for me with one small exception.

I have all of my containers set to place all of their logs in a central location on the host (/mnt/e/logs) and then a subdir per container.

In my case, it would be cleaner and more efficient to just mount the top-level dir as the volume mount, and then use an env var to ignore specific dirs (some containers have built in rotate mechanisms that I don't need this container to rotate for them).

Currently, I have to mount something like 20 containers, and also add them each on the single env var line, like this:

LOGS_DIRECTORIES: '/mnt/e/Docker/Logs/authelia /mnt/e/Docker/Logs/mysql /mnt/e/Docker/Logs/something /mnt/e/Docker/Logs/somethingelse' (etc., for another 15 or so more)

Having an env var something like:

LOGS_IGNORE_DIRECTORIES: '/mnt/e/Docker/Logs/ignorethisone /mnt/e/Docker/Logs/ignorethisonetoo'

Would be much nicer, because then I'd just mount the top-level dir, let logrotate recurse through all subdirs, and ignore just like, 3 directories. :)

Not to able run in K8s w/o root user

Hi,
I am trying to deploy log rotate in the K8s cluster as a sidecar container but getting permission denied error.
touch: /usr/bin/logrotate.d/logrotate.conf: Permission denied

Is it possible to run logrotate w/o root privileges?

LOGROTATE_MAXAGE does not work

configurations as below:

  • name: LOGS_DIRECTORIES
    value: /var/log/cmcapi
  • name: LOGROTATE_COPIES
    value: "3"
  • name: LOGROTATE_SIZE
    value: 100M
  • name: LOGROTATE_MAXAGE
    value: "2"
  • name: LOGROTATE_CRONSCHEDULE
    value: '0 */1 * * *'

but the LOGROTATE_MAXAGE does not work. there still are 3 days logs.
MicrosoftTeams-image

Logrotate a subfolder folder inside a volume

Any way to log rotate a subfolder of a volume?
I've tried:

volumes:
  - /var/lib/docker/volumes/wp_docker_litespeed_lsws_sites/_data/localhost/wp_logs:/var/log/wp

and

LOGS_DIRECTORIES: "/var/lib/docker/containers /var/log/docker /var/lib/docker/volumes /var/log/wp"

Compression doesn't seem to work using docker-compose

I'm using this in my docker-compose.yml:

 logrotate:                                                                                                                                                        
    image: "blacklabelops/logrotate"                                                                                                                                
    volumes:                                                                                                                                                        
      - /var/lib/docker/containers:/var/lib/docker/containers                                                                                                       
    environment:                                                                                                                                                    
      - LOGS_DIRECTORIES=/var/lib/docker/containers                                                                                                                 
      - LOGROTATE_INTERVAL=hourly                                                                                                                                   
      - LOGROTATE_COPIES=7                                                                                                                                          
      - LOGROTATE_SIZE=10M                                                                                                                                          
      - LOGROTATE_COMPRESSION=compress    

I don't see any compression when it rotates.
The logs were also much bigger when I first ran it and it didn't split it up in files of max 10M size, it just moved the old file to .1

Add support for logging files without extension?

I would like to setup this cool container to rotate syslog file, but it looks like it cannot be done with the envs provided, since the code assume you have files with extension, or am I missing something?

LOGROTATE_INTERVAL=hourly rotates on a daily basis

I have the fallowing docker compose that is launched within a docker swarm. The rotation interval is set to hourly, but the logs are rotated daily.

version: '3.3'

services:
  log-roate:
    image: blacklabelops/logrotate
    environment:
      - LOGS_DIRECTORIES=/var/lib/docker/containers
      - LOGROTATE_COPIES=100
      - LOGROTATE_COMPRESSION=compress
      - LOGROTATE_INTERVAL=hourly
      - LOGROTATE_DATEFORMAT=-%Y-%m-%d-%s
    volumes:
      - type: bind
        source: /var/lib/docker/containers
        target: /var/lib/docker/containers
    deploy:
      mode: global

New release please!

We'd love to be able to use a pinned version of logrotate - mostly so we don't run latest - and a new release would be greatly appreciated :)

Default logrotate_croninterval invalid

The default logrotate_croninterval="1 0 0 0 * *" (at

logrotate_croninterval="1 0 0 0 * *"
) seems to be invalid. This value is used when LOGROTATE_CRONSCHEDULE is not set. It results in no invocations of logrotate and the following error message:

2016/11/21 16:40:23 Beginning of range (0) below minimum (1): 0

The 4th (day of month) can not be 0, it must be in range 1-31.

I am unsure what the intended value is, but I think it must be at least hourly looking at the lowest possible logrotate interval. If this is the case a cron interval of 0 0 * * * * would work. (every hour at 0 minutes and 0 seconds).

I am working around this by providing a valid LOGROTATE_CRONSCHEDULE as environment var.

I got an error no such files or directories

executing: /bin/bash -c /usr/bin/logrotate.d/update-logrotate.sh; /usr/sbin/logrotate --state=/logrotate-status/logrotate.status /usr/bin/logrotate.d/logrotate.conf
find: "/var/log/docker: No such file or directory
find: /var/log/nginx": No such file or directory

├── docker-compose.yml
└── logs
    ├── file.log
    └── nginx
        ├── access.log
        └── error.log

This is my docker-compose.yaml setup

---
version: '2.4'
services:
  ssl:
    image: nginx:latest
    ports:
      - 2020:80
    volumes:
      - ./logs/nginx:/var/log/nginx
  logrotate:
    image: blacklabelops/logrotate:1.3
    environment:
      - LOGS_DIRECTORIES="/var/log/docker /var/log/nginx"
      - LOGROTATE_INTERVAL=hourly
      - LOGROTATE_COMPRESSION=compress
      - LOGROTATE_COPIES=30
      - TZ=Asia/Singapore
      - LOGROTATE_CRONSCHEDULE=* * * * * *
    volumes:
      - ./logs:/var/log/docker
      - ./logs/nginx:/var/log/nginx

Repository Deprecated

I will stop supporting and implementing Docker images starting in early 2019.

Repositories will be transferred to blacklabelops-legacy and archived for read only purpose.

The following repositories and images are affected:

January 2019

  • blacklabelops/crowd
  • blacklabelops/nginx
  • blacklabelops/bitbucket
  • blacklabelops/java
  • blacklabelops/letsencrypt
  • blacklabelops/postgres

March 2019

  • blacklabelops/baseimages
  • blacklabelops/confluence
  • blacklabelops/jira
  • blacklabelops/volumerize
  • blacklabelops/logrotate

Cron environment variable not having impact on logrotate

Hello,

I'm trying to use the logrotate docker image. I am overriding the LOGROTATE_CRONSCHEDULE environment variable. However, it is not having an impact on the logrotate command. Can you take a look?

environment:
        - "LOGS_DIRECTORIES=/home/logs"
        - "LOGROTATE_CRONSCHEDULE=* * * * * *"
        - "LOGROTATE_LOGFILE=/tmp/rotate-log"
        - "LGROTATE_PARAMETERS=vf"
        - "LOGROTATE_DATEFORMAT=-%Y-%m-%d-%s"
        - "LOGROTATE_COPIES=5"

Unknown groups/users don't appear to be rotated

I have many log files present in /var/log/company_name to be rotated on an hourly basis into /var/log/company_name/rotated, keeping the past 24-hours. All logs seem to be rotating except a select few, which grow to gigabytes in size.

Upon inspecting the logrotate logs with docker logs logrotate, it appears that all the logfiles that aren't rotating have the following message printed when processing:

Found new file /var/log/company_name/mysql_error.log, Processing...
File has unknown user or group: , user: UNKNOWN, group: video

However, logfiles that are properly rotated have the following message printed:

Found new file /var/log/company_name/wkhtmltopdf.gunicorn.log, Processing...
Inserting new /var/log/company_name/wkhtmltopdf.gunicorn.log to /usr/bin/logrotate.d/logrotate.conf

Other notes:
User: root
Logrotate version: 1.2
Logrotate hash: sha256:e0d5e50a8716d7859079df4849f9034c56d0cb38ed46ad118b87e41f8a9437d6
Capabilities: dac_override, setgid, setuid
Network: none
Environment:

LOGROTATE_INTERVAL=hourly
LOGS_DIRECTORIES=/var/log/company_name
LOGROTATE_OLDDIR=/var/log/company_name/rotated
LOGROTATE_LOGFILE=/var/log/company_name/logrotate.log
LOGROTATE_COPIES=24
LOGROTATE_COMPRESSION=compress
LOGROTATE_STATUSFILE=/company_name/logrotate_status/logrotate.status
LOGROTATE_PARAMETERS=vf

I also tried enabling all capabilities and the network without any luck.

The error message appear accurate when running an ls -lahS on the log directory. But I don't understand why logrotate won't touch those files or how to force it to work with those files.

Specifying files in the options

Thanks for a great project. I have only a small (yet getting bigger) problem:

$ ls -lh
-rwxrw-rw-    1 root     root        1.6K Dec  3 01:14 alternatives.log
drwxrw-rw-    2 root     root        4.0K Dec  3 01:42 apt
drwxr-xr-x    2 root     root        4.0K Nov 19 03:59 docker
-rwxrw-rw-    1 root     root      527.4K Dec  9 05:15 docker.log
-rwxrw-rw-    1 root     root       36.5M Dec  4 00:00 docker.log-20171204.gz
-rwxrw-rw-    1 root     root        1.2M Dec  8 00:00 docker.log-20171208
-rwxrw-rw-    1 root     root       59.4K Dec  3 01:42 dpkg.log
-rw-r--r--    1 root     root         510 Dec  3 01:42 fontconfig.log
-rwxrw-rw-    1 root     root      314.0K Dec  9 05:15 lastlog
-rwxrw-rw-    1 root     root        1.7G Dec  9 05:17 messages
-rwxrw-rw-    1 root     root      663.5M Dec  9 05:17 secure
-rwxrw-rw-    1 root     root        2.3G Dec  9 05:17 syslog

As you can see secure, messages and syslog weren't touched by logrotate. Is it possible for you guys to have an option where we can add LOGS_FILES?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.