Changeset 1901


Ignore:
Timestamp:
2011-04-22 07:22:04 (13 months ago)
Author:
bruno
Message:

Make sure Restlet logging gets redirected through slf4j/log4j (and also introduced some newlines).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/kauri-runtime-cli/src/main/java/org/kauriproject/runtime/cli/KauriRuntimeCli.java

    r1878 r1901  
    5151import org.kauriproject.util.xml.SimpleNamespaceContext; 
    5252import org.kauriproject.util.io.IOUtils; 
     53import org.restlet.engine.Engine; 
    5354import org.slf4j.bridge.SLF4JBridgeHandler; 
    5455import org.w3c.dom.Document; 
     
    6869 
    6970    private void run(String[] args) throws Exception { 
     71        // Let Restlet configure its log now, since next we are going to redirect the JDK logging, and otherwise 
     72        // when the Restlet Engine is initialized it will undo that. 
     73        Engine.configureLog(); 
     74 
    7075        // Forward JDK logging to SLF4J 
    7176        LogManager.getLogManager().reset(); 
     
    7883        .withArgName("confdir") 
    7984        .hasArg() 
    80         .withDescription("The Kauri runtime configuration directory. Can be multiple paths separated by " + File.pathSeparator) 
     85        .withDescription("The Kauri runtime configuration directory. Can be multiple paths separated by " + 
     86                File.pathSeparator) 
    8187        .withLongOpt("confdir") 
    8288        .create('c'); 
     
    8692                .withArgName("maven-repo-path") 
    8793                .hasArg() 
    88                 .withDescription("Location of the (Maven-style) artifact repository. Use comma-separated entries to specify multiple locations which will be searched in the order as specified.") 
     94                .withDescription("Location of the (Maven-style) artifact repository. Use comma-separated entries to " + 
     95                        "specify multiple locations which will be searched in the order as specified.") 
    8996                .withLongOpt("repository") 
    9097                .create('r'); 
     
    108115                .withArgName("loglevel") 
    109116                .hasArg() 
    110                 .withDescription("Enable logging to console for the root log category with specified loglevel (debug, info, warn, error)") 
     117                .withDescription("Enable logging to console for the root log category with specified loglevel " + 
     118                        "(debug, info, warn, error)") 
    111119                .withLongOpt("console-logging") 
    112120                .create('l'); 
     
    203211            File confDir = new File(DEFAULT_CONF_DIR).getAbsoluteFile(); 
    204212            if (!confDir.exists()) { 
    205                 System.out.println("Default configuration directory " + DEFAULT_CONF_DIR + " not found in current directory: " + confDir.getAbsolutePath()); 
     213                System.out.println("Default configuration directory " + DEFAULT_CONF_DIR + 
     214                        " not found in current directory: " + confDir.getAbsolutePath()); 
    206215                System.out.println("To specify another location, use the -" + confDirsOption.getOpt() + " argument"); 
    207216                System.exit(1); 
Note: See TracChangeset for help on using the changeset viewer.