Skip to content

tbaumann/charm-layer-logrotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Apache 2.0 License

This base layer provides a function to add logrotate support to any reactive charm.

Usage

Declarative via layer.yaml

options:
  logrotate:
    /var/log/foobar.log:
      - copytruncate
      - rotate 5
      - size 100k

In your charm code

from charms.layer import logrotate

@when(logrotate.installed, ...)
def setup_logrotate():
    logrotate_opts = {
        /var/log/foobar.log: [
            'copytruncate', 
            'rotate 5', 
            'size 100k', 
        ]
    }
    logrotate.configure(logrotate_opts)

About

Adding logrotate functionality to reactive charms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages