You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kamesh Jayachandran <ka...@collab.net> on 2006/12/20 15:31:30 UTC

[PATCH] operational logging for 'svn cat'

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

Re: [PATCH] operational logging for 'svn cat'

Posted by "C. Michael Pilato" <cm...@collab.net>.
Kamesh Jayachandran wrote:
> Ben Collins-Sussman wrote:
>> Sorry, I don't approve of this patch, I think it's misleading.
>>
>> The only thing it's doing is noticing when a GET request comes in that
>> has no X-SVN-Base: header.  That could be any number of things.  It
>> could be someone running 'svn cat'.  It could be an ordinary web
>> browser surfing the repository..  It could be someone running 'curl'.
>> It could even be libsvn_ra_serf doing a checkout!
>>
>> I do not think all four of those scenarios should be listed as "svn
>> cat" in a high-level log.  Furthermore, I don't think a lone GET
>> request is "high level" in the first place.  It's low-level, and thus
>> the apache access.log is already logging it.
>>
> 
> The idea behind this patch is to log all svn operations to one file, so
> that one can analyse single file for svn usage analysis, rather than
> analysing both access.log and svbversion.log.

The idea of the operation logging feature was simply to add clarity
where it was sorely lacking in the existing apache logs.  You can't look
at a REPORT request against the default VCC URL and know if it is for
checkout, log, get-dated-revisions, etc.  We needed a way to
disambiguate one Subversion operation from another.  It was never, and
still is not, a goal to log all Subversion interactions in
human-language style and to a single file.

This patch does nothing to further the goal.  It doesn't add much
clarity (it's pretty obvious what a GET is, and they operate on
path-revealing URLs unlike our REPORTs), merely redundancy.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [PATCH] operational logging for 'svn cat'

Posted by Kamesh Jayachandran <ka...@collab.net>.
Ben Collins-Sussman wrote:
> Sorry, I don't approve of this patch, I think it's misleading.
>
> The only thing it's doing is noticing when a GET request comes in that
> has no X-SVN-Base: header.  That could be any number of things.  It
> could be someone running 'svn cat'.  It could be an ordinary web
> browser surfing the repository..  It could be someone running 'curl'.
> It could even be libsvn_ra_serf doing a checkout!
>
> I do not think all four of those scenarios should be listed as "svn
> cat" in a high-level log.  Furthermore, I don't think a lone GET
> request is "high level" in the first place.  It's low-level, and thus
> the apache access.log is already logging it.
>

The idea behind this patch is to log all svn operations to one file, so 
that one can analyse single file for svn usage analysis, rather than 
analysing both access.log and svbversion.log.

Just before sending the patch, I thought about the web request, and 
decided to log as 'cat-or-web-browse'(I did not realize serf checkouts 
to be series of GETS!).
Somehow my testing revealed that this patch did not log web request but 
only 'svn cat'. So I decided to log 'cat /path rR', as it only logged 
'svn cat'.


Today after getting your email I just reverified and found that 'web 
requests'/serf checkouts is getting logged as 'cat ...'(Not sure why I 
got a misleading results yesterday!).

Thanks for pointing to peculiarity of 'serf'. How curl is different? is 
it not same as web browser?

With regards
Kamesh Jayachandran

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] operational logging for 'svn cat'

Posted by Ben Collins-Sussman <su...@red-bean.com>.
Sorry, I don't approve of this patch, I think it's misleading.

The only thing it's doing is noticing when a GET request comes in that
has no X-SVN-Base: header.  That could be any number of things.  It
could be someone running 'svn cat'.  It could be an ordinary web
browser surfing the repository..  It could be someone running 'curl'.
It could even be libsvn_ra_serf doing a checkout!

I do not think all four of those scenarios should be listed as "svn
cat" in a high-level log.  Furthermore, I don't think a lone GET
request is "high level" in the first place.  It's low-level, and thus
the apache access.log is already logging it.


On 12/20/06, Kamesh Jayachandran <ka...@collab.net> wrote:
> Hi All,
> Find the attached patch and log.
>
> With regards
> Kamesh Jayachandran
>
>
> [[[
>
> 'svn cat' command should log "cat '/path/to/file' rRev"
>
> * subversion/mod_dav_svn/repos.c
>   (deliver):
>    Operational Logging for 'svn cat' command.
>
> Patch by: kameshj
> Suggested by: Honey George <ge...@collab.net>
>
> ]]]
>
>
> Index: subversion/mod_dav_svn/repos.c
> ===================================================================
> --- subversion/mod_dav_svn/repos.c      (revision 22766)
> +++ subversion/mod_dav_svn/repos.c      (working copy)
> @@ -2877,6 +2877,7 @@
>      {
>        svn_stream_t *stream;
>        char *block;
> +      char *action;
>
>        serr = svn_fs_file_contents(&stream,
>                                    resource->info->root.root,
> @@ -2929,6 +2930,13 @@
>                               "Could not write EOS to filter.");
>        }
>
> +      action = apr_psprintf(resource->pool,
> +                            "cat '%s' r%" SVN_REVNUM_T_FMT,
> +                            svn_path_uri_encode(resource->info->repos_path,
> +                                                resource->pool),
> +                            resource->info->root.rev);
> +
> +      apr_table_set(output->r->subprocess_env, "SVN-ACTION", action);
>        return NULL;
>      }
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org