Slide logging comes in three basic flavors:

Service/Store Logging

By defaut logging in the Services utilizes a custom logging system created for Slide. The default logger if it is not overridden in the domain.xml file's root slide element uses SimpleLogger which simply performs System.out.println commands to dump the log statements to the console.

The default logger can be overridden in the domain.xml file by specifying the logger to use (which must extend "Logger") like this:

<slide logger="log4j.Log4jLogger" logger-level="7">

As indicated in the above example the logger-level can also me manually set here. It's default value is 6. Here is a list of the available logger levels (as defined in org.apache.slide.util.logger.Logger:

WebdavServlet Logging

The WebdavServlet uses the Log4J framework for logging information and will look for a log4j.properties file in the classpath of the WAR.

Here are the contents of the "log4j.properties" file that comes standard in the jar:

log4j.rootCategory=DEBUG,STDOUT,R

# Set the level to DEBUG if you want to log all SlideExceptions (some of them aren't errors)
log4j.category.org.apache.slide.common.SlideException=FATAL

########################################
# Appender Configuration
########################################
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
#log4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
#log4j.appender.STDOUT.layout.ConversionPattern=%4p [%t] %c - %m%n
log4j.appender.STDOUT.layout.ConversionPattern=[%t] %-5p %-20c{2} - %m %n 

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=slide.log

log4j.appender.R.ImmediateFlush=true

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
#log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
#log4j.appender.R.layout.ConversionPattern=%4p [%t] %c - %m%n
log4j.appender.R.layout.ConversionPattern=%d{ABSOLUTE} [%t] %-5p %-30c{3} %x - %m %n

Additionally there is a "filter" in the "web.xml" that is logging related:

    <filter>
        <filter-name>webdavlog</filter-name>
        <filter-class>org.apache.slide.webdav.filter.LogFilter</filter-class>
        <init-param>
            <param-name>logFormat</param-name>
            <param-value>%T, %t, %P, %m, %s "%l", %i, %p</param-value>
            <description>
                Defines the format of a log line.
                The following placeholders are available: 
                    %T=thread-name, 
                    %t=date-time, 
                    %P=principal-name, 
                    %m=method-name, 
                    %s=status-code, 
                    %l=default-status-text, 
                    %L=detailed-status-text, 
                    %i=elapsed-time, 
                    %p=relative-request-uri, 
                    %u=request-uri.
                    %x=request-content-length.
                    %A=header User-Agent.
            </description>
        </init-param>

        <!-- The following three "init-param" elements can be used to tailor the output location. -->
        <init-param>
            <param-name>outputToConsole</param-name>
            <param-value>true</param-value>
            <description>If true, output is directed to STDOUT.</description>
        </init-param>
        <init-param>
            <param-name>outputToServletLog</param-name>
            <param-value>false</param-value>
            <description>If true, output is directed to the servlet's log file.</description>
        </init-param>
        <!--
        <init-param>
            <param-name>outputToFile</param-name>
            <param-value>c:\webdav.log.xml</param-value>
            <description>If present, output is directed to the specified file.</description>
        </init-param>
        -->
    </filter>

There is also a servlet parameter "debug" that doesn't seem to do anything no matter what the value is set to, even though in seems like it should be somewhat analogous to a logging level.

        <init-param>
            <param-name>debug</param-name>
            <param-value>6</param-value>
        </init-param>

"Note: If anyone knows what this parameter does please update this section. If it has nothing to do with logging at all please add that statement to clarify that it is not logging related."

Event Logging

Event logging uses the same logging system as the Service/Store logging but must be enabled in the <events> section of the domain.xml. Like this

    <events>

        <event classname="org.apache.slide.webdav.event.WebdavEvent" enable="true" />
        <event classname="org.apache.slide.event.ContentEvent" enable="true" />

        <listener classname="org.apache.slide.util.event.EventLogger" />

    </events>

Logging (last edited 2009-09-20 22:02:38 by localhost)