Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log duplicate #57

Closed
guotie opened this issue Aug 20, 2014 · 5 comments
Closed

log duplicate #57

guotie opened this issue Aug 20, 2014 · 5 comments

Comments

@guotie
Copy link

guotie commented Aug 20, 2014

such as following:

2014/08/20 17:20:25.099016 [PC-CORP/O6smW20tuK-000001] Started GET "/admin/" from [::1]:35653
2014/08/20 17:20:25.099016 [PC-CORP/O6smW20tuK-000001] Started GET "/admin/" from [::1]:35653
2014/08/20 17:20:25.101017 [PC-CORP/O6smW20tuK-000001] Returning 200 in 2.001ms
2014/08/20 17:20:25.101017 [PC-CORP/O6smW20tuK-000001] Returning 200 in 2.001ms

@zenazn
Copy link
Owner

zenazn commented Aug 20, 2014

Would you mind posting additional details about how you are invoking Goji? For instance, are you adding the logging middleware twice by any chance? (the default goji mux already has a middleware logger, for instance).

@guotie
Copy link
Author

guotie commented Aug 21, 2014

such as following:

mux := web.New()
mux.Use(middleware.Logger)

mux.Get("/admin", xxxhandler)

goji.Handle("/admin/*", mux)

@guotie
Copy link
Author

guotie commented Aug 21, 2014

should i comment

mux.Use(middleware.Logger)

@elithrar
Copy link
Contributor

The default Goji mux already includes the logger, so there's no need to Use
it in your subrouter.

i.e. remove this line

  • mux.Use(middleware.Logger

On Thursday, August 21, 2014, 铁哥 notifications@github.com wrote:

such as following:

mux := web.New()

mux.Use(middleware.Logger)

mux.Get("/admin", xxxhandler)

goji.Handle("/admin/*", mux)


Reply to this email directly or view it on GitHub
#57 (comment).

@guotie
Copy link
Author

guotie commented Aug 21, 2014

thanks, solved.

@guotie guotie closed this as completed Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants