No announcement yet.

CustomLog to log actual SVN action

  • Filter
  • Time
  • Show
Clear All
new posts

  • CustomLog to log actual SVN action


    We used apache customLog to log the required details such as user(%u), path(%U) and time(%t). Now we need to log the actions SVN actually performed(say Checkout, Export, Update, Delete, Lock or Unlock) and we don't want any extra information to be logged(ex- SVN-ACTION).


  • #2
    Hi there,

    I'm afraid I can't fully understand what you're asking - you want to be able to record the action performed by SVN, but you don't want to use the "%{SVN-ACTION}e" command to do so?

    If that's the case I'm not sure it'll be possible, sorry if I've misunderstood though.


    • #3

      Your understanding is correct.

      If there any work around is there to achieve this ?


      • #4
        Hi there,

        I'm afraid that command is the only way to log the actions SVN has taken. What is it that it provides that you don't need? If you include your log format we'll have a look and see if we can advise, but it sounds like the only way to achieve what you want is to use that command and then have some means of parsing the log files to show what you do need and discard the rest.


        • #5
          Is it possible to use regular expression to filter the log. If so kindly provide some example like 'to log the information for particular user only'


          • #6
            Yes, that should be possible to do as the logs are taking a specific format. However what would be very useful - and would help me to be able to provide the examples you're after - is to know what you're getting from the log messages, the format you've specified for them, and also what you want to keep and what you want to get rid of.

            If you could let us know that I'll see what we can do for you.


            • #7
              This is the log format we are using,
              CustomLog "C:/Logs/CustomLog.log "%t, %u, %{SVN-ACTION}e" env=SVN-ACTION

              The log file we are getting,
              [18/Jul/2014:05:59:45 -0400], starks, get-dir /tags/Projects/PluginSupport r238119 text
              [18/Jul/2014:06:00:07 -0400], varunm, checkout-or-export get-dir /tags/Projects/EncriptionSupport r235360 depth=files

              So here we want to log the entries only for user 'varunm' with the action 'get-dir' to the separate log file.
              One more thing... what is the maximum size of log file for CustomLog ?


              • #8
                Well if that's the case, removing the %t will get rid of the timestamp. I believe the rest of it after the username is the command run but also on which file the command was run - then there's the revision number, not sure what that last bit is.

                You've got some delineators there though so if you do need to post process it you could work on spaces or commas (or adjust the format of your log messages to use hyphens or something else in place of the commas and spaces). That should let you feed it into an array or something and pull out the bits you want.

                As far as the log files go I think the limit is disk space rather than anything else so it'll just keep adding to that file until there's no more room to add any more.