Skip to content

Commit

Permalink
log to an outfile
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Jun 1, 2011
1 parent f6fa7fd commit c967a3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turk.go
Expand Up @@ -15,6 +15,7 @@ import (
var (
host = flag.String("host", "localhost:8080", "listening port and hostname that will appear in the urls")
help = flag.Bool("h", false, "show this help")
logf = flag.String("log", "turk.log", "name and location of logfile")
pool *Pool
)

Expand Down Expand Up @@ -184,6 +185,9 @@ func main() {

log.Println("Starting Turk server on " + *host)

out, _ := os.OpenFile(*logf, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
log.SetOutput(out)

pool = NewDialPool("127.0.0.1", 11211, 10)

http.HandleFunc("/", handler)
Expand Down

0 comments on commit c967a3f

Please sign in to comment.