Skip to content

dominicletz/rotating_file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RotatingFile

Simple rotating file writer for additional logs that shouldn't go into the main application log.

# Rotate every 10mb, don't keep more than 10 files
{:ok, pid} = RotatingFile.start_link(file: "test.log", max_size: 10*1024*1024, max_files: 10)
RotatingFile.write(pid, "hello world\n")

This will create a test.log file and also test.log.<timestamp>.(zstd|xz|gz)

Installation

If available in Hex, the package can be installed by adding rotating_file to your list of dependencies in mix.exs:

def deps do
  [
    {:rotating_file, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/rotating_file.

About

GenServer writing to compressed and rotating files

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages