Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2007-02-28 13:42:59
Size: 1372
Editor: nat
Comment:
Revision 10 as of 2008-07-09 12:49:16
Size: 6158
Editor: gw
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
If you experience problems that you think are related to '''SVNKit''', it is always a good idea to post a bug report into [SVNKit Issue Tracker]. To provide more information with the bug report, please consider attaching SVNKit log file to it. Below you will find detailed instructions on how to get SVNKit log files. If you experience problems that you think are related to [[SVNKit]], it is always a good idea to post a bug report into [[http://svnkit.com/tracker/|SVNKit Issue Tracker]]. To provide more information with the bug report, please consider attaching [[SVNKit]] log file to it. Below you will find detailed instructions on how to get [[SVNKit]] log files.
Line 4: Line 4:
SVNKit is used as a library in a standalone application
By default SVNKit operations logging is switched off. To enable it, you should replace the contents of the JAVA_HOME/jre/lib/logging.properties file with the contents of the logging.properties.disabled file that you can find in your "standalone" archive or in the svnkit/cli/ directory in case you've checked out the SVNKit sources. Or when launching the Java VM you can use the following system property:
<<Anchor(debug_logs)>>
==
SVNKit is used as a library in a standalone application ==
By default [[SVNKit]] operations logging is switched off. To enable it, you should replace the contents of the {{{JAVA_HOME/jre/lib/logging.properties}}} file with the contents of the {{{logging.properties.disabled}}} file that you can find in your "standalone" archive or in the {{{svnkit-cli/scripts}}} directory in case you've checked out the [[SVNKit]] sources. Or when launching the Java VM you can use the following system property:
{{{
$java -Djava.util.logging.config.file=path/to/logging.properties.disabled
}}}
Line 7: Line 11:
$java -Djava.util.logging.config.file=path/to/logging.properties.disabled The {{{logging.properties.disabled}}} file contains several system properties which is used to control the log level. Every property corresponds to different area of [[SVNKit]] operations:
Line 9: Line 13:
The logging.properties.disabled file contains a system property svnkit.level used to control the log level. Up to your needs you can specify the following values for that property:  * svnkit.level - sets the log level of basic operations
 * svnkit-network.level - sets the log level for network operations, it enables or disables network tracing
 * svnkit-wc.level - sets the log level for operations with working copy
 * svnkit-cli.level - set the log level for operations performed by command line interface layer
Line 11: Line 18:
FINE(default) - the level for not detailed logging
FINER - the level for more detailed logging
FINEST - the level for full logging
Up to your needs you can specify the following values for every property above:
Line 15: Line 20:
You may find a SVNKit log file at USER_HOME/.svnkit/.svnkit.0.0.log.  * FINE(default) - the level for not detailed logging
 * FINER - the level for more detailed logging
 * FINEST - the level for full logging
Line 17: Line 24:
Read this article to get to know how to customize logging SVNKit operations. You may find an [[SVNKit]] log file at {{{USER_HOME/svnkit.0.log}}}.

<<Anchor(eclipse_debug_logs)>>
== SVNKit is used as Eclipse plugin (works for Subclipse extension as well) ==
When used within [[http://www.eclipse.org|Eclipse]] [[SVNKit]] logs its operation using [[http://www.eclipse.org|Eclipse]] built-in logging facilities. Logging is turned off by default. To enable [[SVNKit]] logging please do the following:
 1. Copy {{{ECLIPSE_HOME/plugins/org.tmatesoft.svnkit_version/.options}}} file to {{{ECLIPSE_HOME}}} directory
 1. Start [[http://www.eclipse.org|Eclipse]] with -debug command line argument:
{{{
$eclipse -debug
}}}
 1.#3 In [[http://www.eclipse.org|Eclipse]], open standard 'Error Log' view - it will contain detailed log of [[SVNKit]] operations that you may export to a file.
{{{ECLIPSE_HOME/plugins/org.tmatesoft.svnkit_version/.options}}} is a file in Java properties file format, with key=true or key=false pair per line. It contains following options with ''boolean'' values you can specify:
 * {{{org.tmatesoft.svnkit/debug}}} - enables or disables [[SVNKit]] logging
 * {{{org.tmatesoft.svnkit/debug/error}}} - enables or disables printing error messages to the 'Error Log' output
'''Note:''' if this option is turned on error messages will be shown in the 'Error Log' output independently of whether {{{org.tmatesoft.svnkit/debug}}} is turned on or not
 * {{{org.tmatesoft.svnkit/debug/warning}}} - enables or disables printing warnings to the 'Error Log' output
 * {{{org.tmatesoft.svnkit/debug/info}}} - enables or disables printing debug information to the 'Error Log' output
 * {{{org.tmatesoft.svnkit/debug/fine}}} - enables or disables printing all messages to the 'Error Log' output
 * {{{org.tmatesoft.svnkit/debug/trace}}} - enables or disables tracing of network operations
'''Note:''' if this option is turned on network traffic will be shown in the 'Error Log' output even if {{{org.tmatesoft.svnkit/debug}}} is turned off

== Setting a custom logger (for debug logging) ==
When you're using [[SVNKit]] in your application it is not always an option to let [[SVNKit]] use JDK logging API. Instead you may like to have a fine-grained control over the way [[SVNKit]] logs its operations. The solution is to provide [[SVNKit]] with a custom logger class that should extend the [[http://svn.svnkit.com/repos/svnkit/trunk/svnkit/src/org/tmatesoft/svn/util/SVNDebugLogAdapter.java|SVNDebugLogAdapter]] class. The code below demonstrates how it could be done.

{{{#!java
...
import org.tmatesoft.svn.util.SVNDebugLog;
import org.tmatesoft.svn.util.SVNDebugLogAdapter;
...
    
    /*
     * Set up your logger
     */
    public static void initSVNKitLogger() {
        SVNDebugLog.setLogger(new CustomSVNKitLogger());
    }

    private static class CustomSVNKitLogger
                                   extends SVNDebugLoggerAdapter {
     /* Override superclass methods to redirect logging
      * as you wish. Superclass implementaion is empty, i.e.
      * all log messages are swallowed.
      */
         
         
         public void log(String message, byte[] data) {
             /*
              * Used to log all data received or transmitted
              * over network
              */
             ...
         }
         
         public void logInfo(String message) {
             /*
              * Used to log information messages
              */
             ...
         }

         public void logError(String message) {
             /*
              * Used to log error messages
              */
             ...
         }

         public void logInfo(Throwable th) {
             /*
              * Used to log information on exceptions
              */
             ...
         }

         public void logError(Throwable th) {
             /*
              * Used to log exceptions
              */
             ...
         }
    }
...
    initSVNKitLogger();
...
}}}

Note: One have to set up a custom logger before any other calls are made to [[SVNKit]], otherwise default logging will be used - i.e. [[http://svn.svnkit.com/repos/svnkit/trunk/svnkit/src/org/tmatesoft/svn/core/internal/util/DefaultSVNDebugLogger.java|DefaultSVNDebugLogger]]. The [[#debug_logs|first section]] gives information how to obtain its log files.

Logging SVNKit operations

If you experience problems that you think are related to SVNKit, it is always a good idea to post a bug report into SVNKit Issue Tracker. To provide more information with the bug report, please consider attaching SVNKit log file to it. Below you will find detailed instructions on how to get SVNKit log files.

SVNKit is used as a library in a standalone application

By default SVNKit operations logging is switched off. To enable it, you should replace the contents of the JAVA_HOME/jre/lib/logging.properties file with the contents of the logging.properties.disabled file that you can find in your "standalone" archive or in the svnkit-cli/scripts directory in case you've checked out the SVNKit sources. Or when launching the Java VM you can use the following system property:

$java -Djava.util.logging.config.file=path/to/logging.properties.disabled

The logging.properties.disabled file contains several system properties which is used to control the log level. Every property corresponds to different area of SVNKit operations:

  • svnkit.level - sets the log level of basic operations
  • svnkit-network.level - sets the log level for network operations, it enables or disables network tracing
  • svnkit-wc.level - sets the log level for operations with working copy
  • svnkit-cli.level - set the log level for operations performed by command line interface layer

Up to your needs you can specify the following values for every property above:

  • FINE(default) - the level for not detailed logging
  • FINER - the level for more detailed logging
  • FINEST - the level for full logging

You may find an SVNKit log file at USER_HOME/svnkit.0.log.

SVNKit is used as Eclipse plugin (works for Subclipse extension as well)

When used within Eclipse SVNKit logs its operation using Eclipse built-in logging facilities. Logging is turned off by default. To enable SVNKit logging please do the following:

  1. Copy ECLIPSE_HOME/plugins/org.tmatesoft.svnkit_version/.options file to ECLIPSE_HOME directory

  2. Start Eclipse with -debug command line argument:

$eclipse -debug
  1. In Eclipse, open standard 'Error Log' view - it will contain detailed log of SVNKit operations that you may export to a file.

ECLIPSE_HOME/plugins/org.tmatesoft.svnkit_version/.options is a file in Java properties file format, with key=true or key=false pair per line. It contains following options with boolean values you can specify:

  • org.tmatesoft.svnkit/debug - enables or disables SVNKit logging

  • org.tmatesoft.svnkit/debug/error - enables or disables printing error messages to the 'Error Log' output

Note: if this option is turned on error messages will be shown in the 'Error Log' output independently of whether org.tmatesoft.svnkit/debug is turned on or not

  • org.tmatesoft.svnkit/debug/warning - enables or disables printing warnings to the 'Error Log' output

  • org.tmatesoft.svnkit/debug/info - enables or disables printing debug information to the 'Error Log' output

  • org.tmatesoft.svnkit/debug/fine - enables or disables printing all messages to the 'Error Log' output

  • org.tmatesoft.svnkit/debug/trace - enables or disables tracing of network operations

Note: if this option is turned on network traffic will be shown in the 'Error Log' output even if org.tmatesoft.svnkit/debug is turned off

Setting a custom logger (for debug logging)

When you're using SVNKit in your application it is not always an option to let SVNKit use JDK logging API. Instead you may like to have a fine-grained control over the way SVNKit logs its operations. The solution is to provide SVNKit with a custom logger class that should extend the SVNDebugLogAdapter class. The code below demonstrates how it could be done.

   1 ...
   2 import org.tmatesoft.svn.util.SVNDebugLog;
   3 import org.tmatesoft.svn.util.SVNDebugLogAdapter;
   4 ...
   5     
   6     /*
   7      * Set up your logger
   8      */
   9     public static void initSVNKitLogger() {
  10         SVNDebugLog.setLogger(new CustomSVNKitLogger());
  11     }
  12 
  13     private static class CustomSVNKitLogger 
  14                                    extends SVNDebugLoggerAdapter {
  15         /* Override superclass methods to redirect logging
  16          * as you wish. Superclass implementaion is empty, i.e.
  17          * all log messages are swallowed.
  18          */
  19          
  20          
  21          public void log(String message, byte[] data) {
  22              /*
  23               * Used to log all data received or transmitted 
  24               * over network
  25               */
  26              ...
  27          }
  28          
  29          public void logInfo(String message) {
  30              /*
  31               * Used to log information messages
  32               */
  33              ...
  34          }
  35 
  36          public void logError(String message) {
  37              /*
  38               * Used to log error messages
  39               */
  40              ... 
  41          }
  42 
  43          public void logInfo(Throwable th) {
  44              /*
  45               * Used to log information on exceptions
  46               */
  47              ...
  48          }
  49 
  50          public void logError(Throwable th) {
  51              /*
  52               * Used to log exceptions
  53               */
  54              ...
  55          }
  56     }
  57 ...
  58     initSVNKitLogger();
  59 ...    

Note: One have to set up a custom logger before any other calls are made to SVNKit, otherwise default logging will be used - i.e. DefaultSVNDebugLogger. The first section gives information how to obtain its log files.

Troubleshooting (last edited 2012-01-03 18:07:26 by ip-109-80-120-205)