Giter Site home page Giter Site logo

Comments (1)

fititnt avatar fititnt commented on June 22, 2024
root@a1:/etc/logrotate.d# cat alb
# Ansible managed
#
# FILE:             /etc/logrotate.d/alb
#
# TODO: implement logrotate for ALB (fititnt, 2019-11-07 21:49 BRT)
# @see https://linux.die.net/man/8/logrotate
# @see https://manpages.debian.org/jessie/logrotate/logrotate.8.en.html

# IMPORTANT NOTE: this logrotate file still need testing (fititnt, 2019-11-07 22:04 BRT) 

/var/log/alb/access.log /var/log/alb/error.log {
    daily
    minsize 1M
    rotate 365
    dateext
    missingok
    compress
    delaycompress
    missingok
    sharedscripts
    postrotate
        [ ! -f /usr/local/openresty/nginx/logs/nginx.pid ] || kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
    endscript
}

/var/log/alb/letsencrypt.log {
    monthly
    rotate 48
    maxsize 10M
    dateext
    missingok
    compress
    delaycompress
    missingok
    sharedscripts
    postrotate
        [ ! -f /usr/local/openresty/nginx/logs/nginx.pid ] || kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
    endscript
}root@a1:/etc/logrotate.d# logrotate -d alb
reading config file alb
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state

Handling 2 logs

rotating pattern: /var/log/alb/access.log /var/log/alb/error.log  after 1 days (365 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/alb/access.log
Creating new state
  Now: 2019-11-08 02:18
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/alb/error.log
Creating new state
  Now: 2019-11-08 02:18
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/alb/letsencrypt.log  monthly (48 rotations)
empty log files are rotated, log files >= 10485760 are rotated earlier, old logs are removed
considering log /var/log/alb/letsencrypt.log
Creating new state
  Now: 2019-11-08 02:18
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
not running postrotate script, since no logs were rotated
root@a1:/etc/logrotate.d# cat alb_apps 
# Ansible managed
#
# FILE:             /etc/logrotate.d/alb_apps
#
# TODO: implement logrotate for ALB Apps (fititnt, 2019-11-07 21:49 BRT)
# @see https://linux.die.net/man/8/logrotate
# @see https://manpages.debian.org/jessie/logrotate/logrotate.8.en.html

# IMPORTANT NOTE: this logrotate file still need testing (fititnt, 2019-11-07 22:04 BRT) 

/var/log/app/*/access.log /var/log/app/*/error.log {
    monthly
    rotate 36
    maxsize 10M
    dateext
    missingok
    compress
    delaycompress
    missingok
    sharedscripts
    postrotate
        [ ! -f /usr/local/openresty/nginx/logs/nginx.pid ] || kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
    endscript
}root@a1:/etc/logrotate.d# logrotate -d alb_apps 
reading config file alb_apps
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state

Handling 1 logs

rotating pattern: /var/log/app/*/access.log /var/log/app/*/error.log  monthly (36 rotations)
empty log files are rotated, log files >= 10485760 are rotated earlier, old logs are removed
considering log /var/log/app/AAAAAAAAAAAA/access.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/app/BBBBBBBBBBBB/access.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/app/CCCCCCCCCCCC/access.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/app/DDDDDDDD/error.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/app/EEEEEEEE/error.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
considering log /var/log/app/haproxy-a1-vps/error.log
Creating new state
  Now: 2019-11-08 02:20
  Last rotated at 2019-11-08 02:00
  log does not need rotating (log has been already rotated)
not running postrotate script, since no logs were rotated

from ap-application-load-balancer.

Related Issues (20)

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.