Refactoring / optimizations:
- Display of the end of hit debug messages has been factored out into
- log_headers, log_request and log_response methods which all call
+ log_headers, log_request, log_request_headers, log_response and
+ log_response_headers methods so that plugins which customise how
+ much information is shown on the debug screen as easy to write.
+ - Make all logging of request and response state get the information from
$c->dump_these so that there is a unified point from which to hook
in parameter filtering (for example).
- $c->model/view/controller have become a lot faster for non-regexp names
=item * Request method, path, and remote IP address
-=item * Request headers (see L</log_headers>)
-
=item * Query keywords (see L<Catalyst::Request/query_keywords>)
=item * Request parameters
$address ||= '';
$c->log->debug(qq/"$method" request for "$path" from "$address"/);
- $c->log_headers('request', $request->headers);
+ $c->log_request_headers($request->headers);
if ( my $keywords = $request->query_keywords ) {
$c->log->debug("Query keywords are: $keywords");
=item * Response status code
-=item * Response headers (see L</log_headers>)
+=item * Content-Type header (if present)
+
+=item * Content-Length header (if present)
=back
}
}
+=head2 $c->log_request_headers($headers);
+
+Hook method which can be wrapped by plugins to log the request headers.
+No-op in the default implementation.
+
+=cut
+
+sub log_request_headers {}
+
=head2 $c->log_headers($type => $headers)
Logs L<HTTP::Headers> (either request or response) to the debug logs.