Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit 25f3dc8

Browse files
committed
Add request logging
1 parent a0276d1 commit 25f3dc8

22 files changed

+2526
-2
lines changed

Gopkg.lock

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@
3636
[[constraint]]
3737
name = "github.com/hownetworks/nfq-go"
3838
version = "1.0.0"
39+
40+
[[constraint]]
41+
name = "github.com/gorilla/handlers"
42+
version = "1.3.0"

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"log"
1010
"net"
1111
"net/http"
12+
"os"
1213
"strconv"
1314
"strings"
1415
"sync"
@@ -17,6 +18,7 @@ import (
1718
"github.com/google/gopacket"
1819
"github.com/google/gopacket/layers"
1920
"github.com/google/gopacket/tcpassembly"
21+
"github.com/gorilla/handlers"
2022
nfq "github.com/hownetworks/nfq-go"
2123
"github.com/kelseyhightower/envconfig"
2224
"github.com/rs/cors"
@@ -535,7 +537,7 @@ func main() {
535537
fmt.Printf("Serving on %v...\n", s.HostPort())
536538
server := http.Server{
537539
Addr: s.HostPort(),
538-
Handler: cors.Default().Handler(handler),
540+
Handler: handlers.CombinedLoggingHandler(os.Stdout, cors.Default().Handler(handler)),
539541
}
540542
server.SetKeepAlivesEnabled(false)
541543
server.ListenAndServe()

vendor/github.com/gorilla/handlers/.travis.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gorilla/handlers/LICENSE

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gorilla/handlers/README.md

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gorilla/handlers/canonical.go

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gorilla/handlers/canonical_test.go

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)