add flag (-http-log) to disable http request logging
This commit is contained in:
committed by
Senan Kelly
parent
7d420f61a9
commit
2a11017d54
@@ -37,6 +37,7 @@ func main() {
|
|||||||
confJukeboxEnabled := set.Bool("jukebox-enabled", false, "whether the subsonic jukebox api should be enabled (optional)")
|
confJukeboxEnabled := set.Bool("jukebox-enabled", false, "whether the subsonic jukebox api should be enabled (optional)")
|
||||||
confProxyPrefix := set.String("proxy-prefix", "", "url path prefix to use if behind proxy. eg '/gonic' (optional)")
|
confProxyPrefix := set.String("proxy-prefix", "", "url path prefix to use if behind proxy. eg '/gonic' (optional)")
|
||||||
confGenreSplit := set.String("genre-split", "\n", "character or string to split genre tag data on (optional)")
|
confGenreSplit := set.String("genre-split", "\n", "character or string to split genre tag data on (optional)")
|
||||||
|
confHTTPLog := set.Bool("http-log", true, "http request logging (optional)")
|
||||||
confShowVersion := set.Bool("version", false, "show gonic version")
|
confShowVersion := set.Bool("version", false, "show gonic version")
|
||||||
_ = set.String("config-path", "", "path to config (optional)")
|
_ = set.String("config-path", "", "path to config (optional)")
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ func main() {
|
|||||||
ProxyPrefix: *confProxyPrefix,
|
ProxyPrefix: *confProxyPrefix,
|
||||||
GenreSplit: *confGenreSplit,
|
GenreSplit: *confGenreSplit,
|
||||||
PodcastPath: *confPodcastPath,
|
PodcastPath: *confPodcastPath,
|
||||||
|
HTTPLog: *confHTTPLog,
|
||||||
})
|
})
|
||||||
|
|
||||||
var g run.Group
|
var g run.Group
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ type Options struct {
|
|||||||
CoverCachePath string
|
CoverCachePath string
|
||||||
ProxyPrefix string
|
ProxyPrefix string
|
||||||
GenreSplit string
|
GenreSplit string
|
||||||
|
HTTPLog bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
@@ -60,7 +61,9 @@ func New(opts Options) *Server {
|
|||||||
}
|
}
|
||||||
// router with common wares for admin / subsonic
|
// router with common wares for admin / subsonic
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.Use(base.WithLogging)
|
if opts.HTTPLog {
|
||||||
|
r.Use(base.WithLogging)
|
||||||
|
}
|
||||||
r.Use(base.WithCORS)
|
r.Use(base.WithCORS)
|
||||||
//
|
//
|
||||||
sessKey := opts.DB.GetOrCreateKey("session_key")
|
sessKey := opts.DB.GetOrCreateKey("session_key")
|
||||||
|
|||||||
Reference in New Issue
Block a user