go-cronowriter alternatives and similar packages
Based on the "Logging" category.
Alternatively, view go-cronowriter alternatives based on common mentions on social networks and blogs.
-
seelog
Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting. -
loggo
A logging library for Go. Doesn't use the built in go log standard library, but instead offers a replacement. -
ozzo-log
A Go (golang) package providing high-performance asynchronous logging, message filtering by severity and category, and multiple message targets. -
gologger
DISCONTINUED. Simple easy to use log lib for go, logs in Colored Cosole, Simple Console, File or Elasticsearch. -
noodlog
๐ Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content. -
gomol
DISCONTINUED. Gomol is a library for structured, multiple-output logging for Go with extensible logging outputs -
Kiwi Logs&Context
Fast, structured, with filters and dynamic sinks. No levels. Logger & context keeper for Go language ๐ฅ It smells like a mushroom. -
kemba
A tiny debug logging tool. Ideal for CLI tools and command applications. Inspired by https://github.com/visionmedia/debug
CodeRabbit: AI Code Reviews for Developers

Do you think we are missing an alternative of go-cronowriter or a related project?
README
cronowriter
This is a simple file writer that it writes message to the specified format path.
The file path is constructed based on current date and time, like cronolog.
This project follows the Semantic Versioning.
Installation
$ go get -u github.com/utahta/go-cronowriter
Documentation
API documentation can be found here.
The format specifications can be found here.
Examples
import "github.com/utahta/go-cronowriter"
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d")
w.Write([]byte("test"))
// output file
// /path/to/example.log.20170204
You can specify the directory as below
w := cronowriter.MustNew("/path/to/%Y/%m/%d/example.log")
w.Write([]byte("test"))
// output file
// /path/to/2017/02/04/example.log
with Location
w := cronowriter.MustNew("/path/to/example.log.%Z", writer.WithLocation(time.UTC))
w.Write([]byte("test"))
// output file
// /path/to/example.log.UTC
with Symlink
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d", writer.WithSymlink("/path/to/example.log"))
w.Write([]byte("test"))
// output file
// /path/to/example.log.20170204
// /path/to/example.log -> /path/to/example.log.20170204
with Mutex
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d", writer.WithMutex())
no use Mutex
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d", writer.WithNopMutex())
with Debug (stdout and stderr)
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d", writer.WithDebug())
w.Write([]byte("test"))
// output file, stdout and stderr
// /path/to/example.log.20170204
with Init
w := cronowriter.MustNew("/path/to/example.log.%Y%m%d", writer.WithInit())
// open the file when New() method is called
// /path/to/example.log.20170204
Example using with zap
uber-go/zap
package main
import (
"github.com/uber-go/zap"
"github.com/utahta/go-cronowriter"
)
func main() {
w1 := cronowriter.MustNew("/tmp/example.log.%Y%m%d")
w2 := cronowriter.MustNew("/tmp/internal_error.log.%Y%m%d")
l := zap.New(
zap.NewJSONEncoder(),
zap.Output(zap.AddSync(w1)),
zap.ErrorOutput(zap.AddSync(w2)),
)
l.Info("test")
}
// output
// /tmp/example.log.20170204
// {"level":"info","ts":1486198722.1201255,"msg":"test"}
Contributing
- Fork it ( https://github.com/utahta/go-cronowriter/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request