This section is empty.


This section is empty.


func NewAccumulateConfig

func NewAccumulateConfig(cfg *SyslogConfig)

NewAccumulateConfig creates a SyslogConfig instance used to accumulate log entries from the various unit nodes.

func NewForwardConfig

func NewForwardConfig(cfg *SyslogConfig)

NewForwardConfig creates a SyslogConfig instance used on unit nodes to forward log entries to the state server nodes.

func Restart

func Restart() error

Restart restarts the "rsyslog" service using the local host's currently running init system (e.g. upstart, systemd). If the caller is not a superuser then Restart returns an error.


type SyslogConfig

type SyslogConfig struct {

	// the directory where the config file is written.
	ConfigDir string
	// the config file name.
	ConfigFileName string
	// the name of the log file to tail.
	LogFileName string
	// the name of the logrotate configuration file.
	LogrotateConfFileName string
	// the name of the script that executes the logrotate command.
	LogrotateHelperFileName string
	// the addresses of the state server to which messages should be forwarded.
	StateServerAddresses []string
	// CA certificate file name.
	CACertFileName string
	// Server certificate file name.
	ServerCertFileName string
	// Server private key file name.
	ServerKeyFileName string
	// the port number for the listener
	Port int
	// the directory for the logfiles
	LogDir string
	// namespace is used when there are multiple environments on one machine
	Namespace string
	// directory where juju stores its config files
	JujuConfigDir string
	// contains filtered or unexported fields

SyslogConfig provides a means to configure and generate rsyslog conf files for the state server nodes and unit nodes. rsyslog is configured to tail the specified log file.

func (*SyslogConfig) CACertPath

func (slConfig *SyslogConfig) CACertPath() string

func (*SyslogConfig) ConfigFilePath

func (slConfig *SyslogConfig) ConfigFilePath() string

func (*SyslogConfig) LogrotateConfFile

func (slConfig *SyslogConfig) LogrotateConfFile() ([]byte, error)

LogrotateConfFile returns a ready to write to disk byte array of the logrotate.conf file.

func (*SyslogConfig) LogrotateConfPath

func (slConfig *SyslogConfig) LogrotateConfPath() string

LogrotateConfPath returns the the the entire logrotate.conf path including filename.

func (*SyslogConfig) LogrotateHelperFile

func (slConfig *SyslogConfig) LogrotateHelperFile() ([]byte, error)

LogrotateHelperFile returns a ready to write to disk byte array of the logrotate.helper file.

func (*SyslogConfig) LogrotateHelperPath

func (slConfig *SyslogConfig) LogrotateHelperPath() string

LogrotateHelperPath returns the entire logrotate.helper path including filename.

func (*SyslogConfig) Render

func (slConfig *SyslogConfig) Render() ([]byte, error)

Render generates the rsyslog config.

func (*SyslogConfig) ServerCertPath

func (slConfig *SyslogConfig) ServerCertPath() string

func (*SyslogConfig) ServerKeyPath

func (slConfig *SyslogConfig) ServerKeyPath() string

func (*SyslogConfig) Write

func (slConfig *SyslogConfig) Write() error

Write generates and writes the rsyslog config.

type SyslogConfigRenderer

type SyslogConfigRenderer interface {
	Render() ([]byte, error)

SyslogConfigRenderer instances are used to generate a rsyslog conf file.


Path Synopsis