Skip to content
Snippets Groups Projects
Unverified Commit 78a74981 authored by Philipp Winter's avatar Philipp Winter
Browse files

Use snowflake's safe logger.

The http package can log error messages that include the client's IP
address.  We don't want any IP addresses in our log file and snowflake's
safe logger can scrub them.
parent a8e637cd
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,13 @@ package main
import (
"flag"
"io"
"log"
"net/http"
"os"
"time"
"git.torproject.org/pluggable-transports/snowflake.git/common/safelog"
"github.com/gorilla/mux"
)
......@@ -82,6 +85,11 @@ func main() {
flag.StringVar(&keyFile, "key-file", "", "Path to the certificate's private key, in .pem format.")
flag.Parse()
var logOutput io.Writer = os.Stderr
// We want to send the log output through our scrubber first
log.SetOutput(&safelog.LogScrubber{Output: logOutput})
log.SetFlags(log.LstdFlags | log.LUTC)
if certFile == "" {
log.Fatalf("The -cert-file argument is required.")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment