FAQ
For what its worth, I contributed github.com/keep94/weblogs.

After finishing my web server, I missed having the access logs. I started
by by wrapping the default handler with a simple log.Printf() to show the
URL, remote address, time, and method but later found handling panics and
extracting http status codes to be less trivial. Therefore I decided to
create this weblogs package so that others can easily add web logs to their
servers.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Kamil Kisiel at Apr 24, 2013 at 4:50 pm
    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlers
    which are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I started
    by by wrapping the default handler with a simple log.Printf() to show the
    URL, remote address, time, and method but later found handling panics and
    extracting http status codes to be less trivial. Therefore I decided to
    create this weblogs package so that others can easily add web logs to their
    servers.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Travis Keep at Apr 24, 2013 at 5:10 pm
    Thanks for showing me this. I did not find this when searching for web log
    libraries before, but it looks quite useful. Question: Is it possible to
    add custom fields to the logs using these gorilla handlers? I am logging
    the current logged in user as well as the usual fields in common logging
    format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlerswhich are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I started
    by by wrapping the default handler with a simple log.Printf() to show the
    URL, remote address, time, and method but later found handling panics and
    extracting http status codes to be less trivial. Therefore I decided to
    create this weblogs package so that others can easily add web logs to their
    servers.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Travis Keep at Apr 24, 2013 at 5:18 pm
    Is there a way to handle panics with the gorilla handlers so that the panic
    trace gets logged, and the user sees a 500 error instead of something like
    "No data sent"?
    On Wednesday, April 24, 2013 10:10:21 AM UTC-7, Travis Keep wrote:

    Thanks for showing me this. I did not find this when searching for web log
    libraries before, but it looks quite useful. Question: Is it possible to
    add custom fields to the logs using these gorilla handlers? I am logging
    the current logged in user as well as the usual fields in common logging
    format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlerswhich are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I
    started by by wrapping the default handler with a simple log.Printf() to
    show the URL, remote address, time, and method but later found handling
    panics and extracting http status codes to be less trivial. Therefore I
    decided to create this weblogs package so that others can easily add web
    logs to their servers.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kamil Kisiel at Apr 24, 2013 at 5:48 pm
    Not at the moment.
    On Wednesday, April 24, 2013 10:18:17 AM UTC-7, Travis Keep wrote:

    Is there a way to handle panics with the gorilla handlers so that the
    panic trace gets logged, and the user sees a 500 error instead of something
    like "No data sent"?
    On Wednesday, April 24, 2013 10:10:21 AM UTC-7, Travis Keep wrote:

    Thanks for showing me this. I did not find this when searching for web
    log libraries before, but it looks quite useful. Question: Is it possible
    to add custom fields to the logs using these gorilla handlers? I am logging
    the current logged in user as well as the usual fields in common logging
    format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlerswhich are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I
    started by by wrapping the default handler with a simple log.Printf() to
    show the URL, remote address, time, and method but later found handling
    panics and extracting http status codes to be less trivial. Therefore I
    decided to create this weblogs package so that others can easily add web
    logs to their servers.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Bryan Whitehead at Apr 24, 2013 at 6:52 pm
    Travis, can you add a license to weblogs?
    On Wed, Apr 24, 2013 at 10:48 AM, Kamil Kisiel wrote:
    Not at the moment.

    On Wednesday, April 24, 2013 10:18:17 AM UTC-7, Travis Keep wrote:

    Is there a way to handle panics with the gorilla handlers so that the
    panic trace gets logged, and the user sees a 500 error instead of something
    like "No data sent"?
    On Wednesday, April 24, 2013 10:10:21 AM UTC-7, Travis Keep wrote:

    Thanks for showing me this. I did not find this when searching for web
    log libraries before, but it looks quite useful. Question: Is it possible to
    add custom fields to the logs using these gorilla handlers? I am logging the
    current logged in user as well as the usual fields in common logging format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlers
    which are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I
    started by by wrapping the default handler with a simple log.Printf() to
    show the URL, remote address, time, and method but later found handling
    panics and extracting http status codes to be less trivial. Therefore I
    decided to create this weblogs package so that others can easily add web
    logs to their servers.
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Travis Keep at Apr 24, 2013 at 11:16 pm
    I'll work on that. I never really understood open source licenses. Which
    license is the best to use? apache? MIT? a different one?
    On Wednesday, April 24, 2013 11:44:52 AM UTC-7, Bryan W wrote:

    Travis, can you add a license to weblogs?
    On Wed, Apr 24, 2013 at 10:48 AM, Kamil Kisiel wrote:
    Not at the moment.

    On Wednesday, April 24, 2013 10:18:17 AM UTC-7, Travis Keep wrote:

    Is there a way to handle panics with the gorilla handlers so that the
    panic trace gets logged, and the user sees a 500 error instead of
    something
    like "No data sent"?
    On Wednesday, April 24, 2013 10:10:21 AM UTC-7, Travis Keep wrote:

    Thanks for showing me this. I did not find this when searching for web
    log libraries before, but it looks quite useful. Question: Is it
    possible to
    add custom fields to the logs using these gorilla handlers? I am
    logging the
    current logged in user as well as the usual fields in common logging
    format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from
    http://godoc.org/github.com/gorilla/handlers
    which are wrappers you can put around an HTTP handler to add
    Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I
    started by by wrapping the default handler with a simple
    log.Printf() to
    show the URL, remote address, time, and method but later found
    handling
    panics and extracting http status codes to be less trivial.
    Therefore I
    decided to create this weblogs package so that others can easily add
    web
    logs to their servers.
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kamil Kisiel at Apr 24, 2013 at 5:48 pm
    Currently there is not a way to add custom fields, because the handler
    would need to know how to get the data for those fields. The handler works
    on the basis of using a custom ResponseWriter implementation that records
    the status code, but doesn't really know anything else you are doing in
    your handlers. You could probably adopt a similar approach for your custom
    handler, the code is not very complicated.

    As far as a general solution, it could be possible to write a logging
    handler that accepts a template format, and allow it to log request and
    response headers. You could then log the user if it was being sent in a
    header.
    On Wednesday, April 24, 2013 10:10:21 AM UTC-7, Travis Keep wrote:

    Thanks for showing me this. I did not find this when searching for web log
    libraries before, but it looks quite useful. Question: Is it possible to
    add custom fields to the logs using these gorilla handlers? I am logging
    the current logged in user as well as the usual fields in common logging
    format.
    On Wednesday, April 24, 2013 9:50:29 AM UTC-7, Kamil Kisiel wrote:

    You may also want to take a look at LoggingHandler and
    CombinedLoggingHandler from http://godoc.org/github.com/gorilla/handlerswhich are wrappers you can put around an HTTP handler to add Apache-style
    logging.
    On Wednesday, April 24, 2013 6:33:09 AM UTC-7, Travis Keep wrote:

    For what its worth, I contributed github.com/keep94/weblogs.

    After finishing my web server, I missed having the access logs. I
    started by by wrapping the default handler with a simple log.Printf() to
    show the URL, remote address, time, and method but later found handling
    panics and extracting http status codes to be less trivial. Therefore I
    decided to create this weblogs package so that others can easily add web
    logs to their servers.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 24, '13 at 1:33p
activeApr 24, '13 at 11:16p
posts8
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase