Add a hook around LiftServlet#doService() to enable custom service time measurement #1144

Open
indrajitr opened this Issue Nov 3, 2011 · 2 comments

Comments

Projects
None yet
3 participants
@indrajitr
Owner

indrajitr commented Nov 3, 2011

Discussion thread including ticket request: https://groups.google.com/d/topic/liftweb/zw2SJv7Ms2s/discussion

It would be nice if user code could hook in at the same place that "logTime" does in the code below (from LiftServlet#doService()):

  def service(req: Req, resp: HTTPResponse): Boolean = {
    try {
      def doIt: Boolean = {
        if (LiftRules.logServiceRequestTiming) {
          logTime {
            val ret = doService(req, resp)
            val msg = "Service request (" + req.request.method + ") " + req.request.uri + " returned " + resp.getStatus + ","
            (msg, ret)
          }
        } else {
          doService(req, resp)
        }
      }
      ...

Thanks!

@github-importer

This comment has been minimized.

Show comment Hide comment
@Shadowfiend

This comment has been minimized.

Show comment Hide comment
@Shadowfiend

Shadowfiend May 13, 2014

Owner

Can't you now hook into onBeginServicing and onEndServicing to basically do exactly this? I guess these two miss the actual sending of the response…

Owner

Shadowfiend commented May 13, 2014

Can't you now hook into onBeginServicing and onEndServicing to basically do exactly this? I guess these two miss the actual sending of the response…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment