Skip to content

Commit

Permalink
Added Rotating logs through the logging lib #8
Browse files Browse the repository at this point in the history
  • Loading branch information
SindreBrurberg committed Nov 2, 2021
1 parent 320b3aa commit 08e7508
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Your servers need to implement a way to not write persistent data when it is use
* endpoint is their base url / hostname / domain
* port_range is the range of ports used to start and test your servers. You should have more than 5 port available
* identifier is the base name of your server file. Without version information and without .jar. The prefix if you will.
* log_file is the file vili logs to. //TODO leave blank for stdout
* log_dir is the dir vili logs to. If blank it logs to std
* properties_file_name is **the** config file used for your applications. This will be copied to every instanve
* port_identifier is the key in your properties file that corresponds to the port your server will run on
3. Setup a service like [Visuale's](https://github.com/Cantara/visuale) [semantic_update_service](https://github.com/Cantara/visuale/blob/master/scripts/semantic_update_service.sh) to downloade new verions into a base folder.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cantara/vili
go 1.16

require (
github.com/cantara/bragi v0.1.8 // indirect
github.com/cantara/bragi v0.2.0 // indirect
github.com/joho/godotenv v1.4.0 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/cantara/bragi v0.1.7 h1:jZN+vsOswlKe5BAKqePn0VHtyA7bFXm6IKexaTc80ZA=
github.com/cantara/bragi v0.1.7/go.mod h1:UG6GZBNRGKiMkl2EwlKMQ1tWj2l/9bcXSIzG1b/jVC8=
github.com/cantara/bragi v0.1.8 h1:BVpNnkCT4ePpvnBTGEpg9JdDCFc+kkB/+/+go9ggrqU=
github.com/cantara/bragi v0.1.8/go.mod h1:UG6GZBNRGKiMkl2EwlKMQ1tWj2l/9bcXSIzG1b/jVC8=
github.com/cantara/bragi v0.2.0 h1:rn+kHWnSR6BYeoO3TpfiPhl5C8fzd5odu9+rdoYl+IA=
github.com/cantara/bragi v0.2.0/go.mod h1:UG6GZBNRGKiMkl2EwlKMQ1tWj2l/9bcXSIzG1b/jVC8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func main() {
log.Fatal("Unable to sett logdir")
}
defer cloaser()
done := make(chan func())
log.StartRotate(done)
defer close(done)
}
err := verifyConfig()
if err != nil {
Expand Down

0 comments on commit 08e7508

Please sign in to comment.