Categorygithub.com/rclancey/logrotate
modulepackage
1.0.1
Repository: https://github.com/rclancey/logrotate.git
Documentation: pkg.go.dev

# README

Log rotation package for Go

GoDoc

This package provides automatic log rotation for servers

Installation

Use the go command:

$ go get github.com/rclancey/logrotate

Example

package main

import (
    "log"
    "time"
)

func init() {
    logFn := "/var/log/myServer/errors.log"
    rotationPeriod := 24 * time.Hour
    maxSize := 0
    retainCount := 7
    rotlog, err := logrotate.Open(logFn, rotationPeriod, maxSize, retainCount)
    log.SetOutput(rotlog)
}

Documentation

Documentation is hosted at GoDoc project.

Copyright

Copyright (C) 2019-2020 by Ryan Clancey

Package released under MIT License. See LICENSE for details.

# Functions

No description provided by the author

# Structs

No description provided by the author