diff --git a/1.1/Makefile b/1.1/Makefile deleted file mode 100644 index 0a222c9..0000000 --- a/1.1/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# $Id: Makefile,v 1.2 2004/04/13 16:26:18 kward Exp $ - -SHELL_SRC_DIR=$(PWD)/src/shell -TEST_SRC_DIR=$(PWD)/src/test -BUILD_DIR=$(PWD)/build -DIST_DIR=$(PWD)/dist - -all: build - -build: - mkdir $(BUILD_DIR) - cp -pr $(SHELL_SRC_DIR)/* $(BUILD_DIR) - -test: build - ( cd $(BUILD_DIR); $(TEST_SRC_DIR)/test-log4sh ) - -dist: build - mkdir $(DIST_DIR) - cp -p src/shell/log4sh $(DIST_DIR) - -clean: - rmdir $(BUILD_DIR) - -distclean: clean - rmdir $(DIST_DIR) diff --git a/1.1/doc/CHANGES b/1.1/doc/CHANGES deleted file mode 100644 index e4ec3eb..0000000 --- a/1.1/doc/CHANGES +++ /dev/null @@ -1,49 +0,0 @@ -Changes with 1.1.5 - -*) [kwa] added support for the %c conversion character. when used, it will be -replaced with the word 'shell' as there is no concept of a class within shell. - - -Changes with 1.1.4 - -*) [kwa] added support for thread name. by default, the value is empty, but -it can be set using the logger_setThreadName method. support for the %t -conversion character in the pattern layout is also provided. - - -Changes with 1.1.3 - -*) [kwa] added support for the following conversion characters in pattern -layouts: - %F - filename (set via logger_setFilename function) - -*) [kwa] began adding some function documentation - -*) [kwa] added appender_setPattern function to allow changing of the default -pattern layout for an appender. - -*) [kwa] added a private function _appender_getIndex that will return the -index position of a named appender. written so some code duplication can be -eliminated in a couple of functions. - - -Changes with 1.1.2 - -*) [kwa] no longer leaves shell in mode where unset variables cause errors - -*) [kwa] added appender_getLevel() method - -*) [kwa] added very basic support for patterns - a default pattern to be more -specific of "%d %p - %m" - - -Changes with 1.1.1 - -*) [kwa] added __LOG4SH_RELEASE variable - -*) [kwa] moved somewhat into a structured project - - -Changes with 1.1.0 - -*) [kwa] branched from 1.0.1 diff --git a/1.1/src/shell/log4sh b/1.1/src/shell/log4sh deleted file mode 100644 index 6d2c1b5..0000000 --- a/1.1/src/shell/log4sh +++ /dev/null @@ -1,523 +0,0 @@ -# $Id: log4sh,v 1.10 2004/06/21 22:59:50 kward Exp $ -# -# log4sh -# -# written by Kate Ward -# released under the GPL -# -# this module implements something like the log4j module from the Apache group -# -# notes: -# *) the default appender is STDERR with a level of ERROR and a layout of -# Simple -# *) the appender levels are as follows (decreasing order of output): -# DEBUG, INFO, WARN, ERROR, FATAL, OFF -# *) the pattern separator is the ~ char, so inherantly, that character cannot -# be used in patterns... -# -# usage: -# *) source the log4sh functions: -# . log4sh -# *) set the global logging level (default is ERROR): -# logger_setLevel INFO -# *) add an appender (STDOUT, STDERR, filename): -# logger_addAppender /tmp/log4sh.log -# *) set an appender's logging level: -# appender_setLevel /tmp/log4sh.log DEBUG -# *) disable default appender -# appender_setLevel STDERR OFF -# *) set an appender to use a pattern layout: -# appender_setLayout Pattern -# - -# treat unset variables as an error when substituting -set -u - -# -# constants -# -__LOG4SH_RELEASE='$Name: $' - -__LOG4SH_LEVEL_ALL=0 -__LOG4SH_LEVEL_DEBUG=1 -__LOG4SH_LEVEL_INFO=2 -__LOG4SH_LEVEL_WARN=3 -__LOG4SH_LEVEL_ERROR=4 -__LOG4SH_LEVEL_FATAL=5 -__LOG4SH_LEVEL_OFF=6 - -__LOG4SH_PATTERN_DEFAULT='%d %p - %m%n' - -# -# variables -# -__log4sh_filename='' -__log4sh_numAppenders=0 -__log4sh_threadName='' -__log4shAppenders='' -__log4shAppenderLayouts='' -__log4shAppenderLevels='' -__log4shAppenderPatterns='' - -# -# private functions -# - -_log4sh_level2tag() -{ - _level=$1 - - _result=0 - _tag='' - - case $_level in - $__LOG4SH_LEVEL_ALL) _tag='ALL' ;; - $__LOG4SH_LEVEL_DEBUG) _tag='DEBUG' ;; - $__LOG4SH_LEVEL_INFO) _tag='INFO' ;; - $__LOG4SH_LEVEL_WARN) _tag='WARN' ;; - $__LOG4SH_LEVEL_ERROR) _tag='ERROR' ;; - $__LOG4SH_LEVEL_FATAL) _tag='FATAL' ;; - $__LOG4SH_LEVEL_OFF) _tag='OFF' ;; - *) _result=1 ;; - esac - - echo $_tag - unset _level _tag - return $_result -} - -_log4sh_tag2level() -{ - _tag=$1 - - _level='' - _result=0 - - case $_tag in - ALL) _level=$__LOG4SH_LEVEL_ALL ;; - DEBUG) _level=$__LOG4SH_LEVEL_DEBUG ;; - INFO) _level=$__LOG4SH_LEVEL_INFO ;; - WARN) _level=$__LOG4SH_LEVEL_WARN ;; - ERROR) _level=$__LOG4SH_LEVEL_ERROR ;; - FATAL) _level=$__LOG4SH_LEVEL_FATAL ;; - OFF) _level=$__LOG4SH_LEVEL_OFF ;; - *) _result=1 ;; - esac - - echo $_level - unset _level _tag - return $_result -} - -_parsePattern() -{ - _pattern=$1 - _priority=$2 - _msg=$3 - - _date=`date '+%Y-%m-%d %H:%M:%S'` - echo "$_pattern" |sed \ --e "s/%c/shell/" \ --e "s/%d/$_date/" \ --e "s/%F/$__log4sh_filename/" \ --e "s/%n//" \ --e "s/%p/$_priority/" \ --e "s/%t/$__log4sh_threadName/" \ --e "s/%m/$_msg/" - unset _pattern _tag _msg -} - -# -# Logger -# - -# -# This function sets the filename to be shown when the %F conversion character -# is used in a pattern layout. -# -# @param filename -# @return (none) -# -logger_setFilename() -{ - __log4sh_filename=$1 -} - -logger_getLevel() -{ - _log4sh_level2tag $__log4shLevel -} - -logger_setLevel() -{ - _tag=$1 - - _level=`_log4sh_tag2level $_tag` - if [ $? -eq 0 ]; then - __log4shLevel=$_level - else - echo "log4sh error: attempt to set invalid log level '$_tag'" >&2 - fi - - unset _level _tag -} - -# -# This function sets the thread name (aka the name of the script). This thread -# name can be used with the %t conversion character within a pattern layout. -# -# @param thread_name -# @return (none) -# -logger_setThreadName() -{ - __log4sh_threadName=$1 -} - -# -# Appender -# - -logger_addAppender() -{ - _appender=$1 - _layout=$2 - - _level=`logger_getLevel` - __log4shAppenders="$__log4shAppenders $_appender" - __log4shAppenderLevels="$__log4shAppenderLevels -" - __log4shAppenderLayouts="$__log4shAppenderLayouts $_layout" - __log4shAppenderPatterns="${__log4shAppenderPatterns:+$__log4shAppenderPatterns~}$__LOG4SH_PATTERN_DEFAULT" - __log4sh_numAppenders=`expr $__log4sh_numAppenders + 1` - - # create the file (if it doesn't exist) - case $_appender in - STDOUT|STDERR) ;; - *) touch $_appender ;; - esac - - unset _appender _layout -} - -# -# Determines the index position of an appender in the appender array. -# -# @param _appender the name of the appender -# @return index the position of the appender in the appender array -# 0 if the appender is not found -# -_appender_getIndex() -{ - _appender=$1 - - _index=1 - while [ $_index -le $__log4sh_numAppenders ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - [ "$_a" = "$_appender" ] && break - _index=`expr $_index + 1` - done - [ $_index -gt $__log4sh_numAppenders ] && _index=0 - - _result=$_index - unset _a _appender _index - return $_result -} - -appender_getLayout() -{ - _appender=$1 - - _index=`_appender_getIndex $_appender` - if [ $_index -ne 0 ]; then - _layout=`echo $__log4shAppenderLayouts |awk "{print \\$$_index}"` - else - _layout="unknown" - fi - - echo $_layout - unset _appender _index _layout -} - -appender_setLayout() -{ - _appender=$1 - _layout=$2 - - case $_layout in - '') _layout='None' ;; - Pattern|Simple|None) ;; - *) - echo "log4sh error: unknown layout $_layout" >&2 - return 1 - ;; - esac - - _index=1 - _newAppenderLayouts='' - _found=0 - - while [ $_index -le $__log4sh_numAppenders ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - _l=`echo $__log4shAppenderLayouts |awk "{print \\$$_index}"` - - if [ ! "$_a" = "$_appender" ]; then - _newAppenderLayouts="$_newAppenderLayouts $_l" - else - _newAppenderLayouts="$_newAppenderLayouts $_layout" - _found=1 - fi - - _index=`expr $_index + 1` - done - __log4shAppenderLayouts="$_newAppenderLayouts" - - _result=$_found - unset _a _appender _found _index _l _layout _newAppenderLayouts - return $_result -} - -appender_getLevel() -{ - _appender=$1 - - _index=`_appender_getIndex $_appender` - if [ $_index -gt 0 ]; then - _level=`echo $__log4shAppenderLevels |awk "{print \\$$_index}"` - else - _level="unknown" - fi - - echo $_level - unset _appender _index _level -} - -appender_setLevel() -{ - _appender=$1 - _level=$2 - - _index=1 - _newAppenderLevels='' - _found=0 - - while [ $_index -le $__log4sh_numAppenders ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - _l=`echo $__log4shAppenderLevels |awk "{print \\$$_index}"` - - if [ ! "$_a" = "$_appender" ]; then - _newAppenderLevels="$_newAppenderLevels $_l" - else - _newAppenderLevels="$_newAppenderLevels $_level" - _found=1 - fi - - _index=`expr $_index + 1` - done - __log4shAppenderLevels="$_newAppenderLevels" - - _result=$_found - unset _a _appender _found _index _l _level _newAppenderLevels - return $_result -} - -appender_getPatternAtIndex() -{ - _index=$1 - - _pattern=`echo "$__log4shAppenderPatterns" |awk -F~ "{print \\$$_index}"` - - echo "$_pattern" - unset _index _pattern -} - -appender_setPattern() -{ - _appender=$1 - _pattern=$2 - - _index=1 - _newPatterns='' - _found=0 - - while [ $_index -le $__log4sh_numAppenders ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - _p=`echo $__log4shAppenderPatterns |awk -F~ "{print \\$$_index}"` - - if [ ! "$_a" = "$_appender" ]; then - _newPatterns="${_newPatterns:+$_newPatterns~}$_p" - else - _newPatterns="${_newPatterns:+$_newPatterns~}$_pattern" - _found=1 - fi - - _index=`expr $_index + 1` - done - __log4shAppenderPatterns="$_newPatterns" - - _result=$_found - unset _a _appender _found _index _newPatterns _p _pattern - return $_result -} - -appender_setAppend() -{ - _appender=$1 - _append=$2 - - # useless for the standard files - case $_appender in - STDOUT|STDERR) return 0 ;; - *) ;; - esac - - # verify the appender passed is valid - _found=0 - for _a in $__log4shAppenders; do - if [ "$_a" = "$_appender" ]; then - _found=1 - break - fi - done - if [ $_found -eq 0 ]; then - echo "log4sh:ERROR invalid appender" >&2 - return 1 - fi - - # truncate the file - case $_append in - false|False|FALSE) - if [ -f $_appender ]; then - rm $_appender - touch $_appender - fi - ;; - true|True|TRUE) ;; - *) echo "log4sh:ERROR invalid appender append setting" >&2 ;; - esac - - unset _a _append _appender _found - return 0 -} - -# -# Log -# - -log() -{ - _tag=$1 - _msg=$2 - - _level=`_log4sh_tag2level $_tag` - _newIndex=1 - _l=0 - - while [ $_newIndex -le $__log4sh_numAppenders ]; do - _index=$_newIndex - _newIndex=`expr $_newIndex + 1` # must come before continue statements :) - - # determine appender level - _tmpLevel=`echo $__log4shAppenderLevels |awk "{print \\$$_index}"` - if [ "$_tmpLevel" = "-" ]; then - # continue if requested is level less than general level - [ ! $__log4shLevel -le $_level ] && continue - else - _l=`_log4sh_tag2level $_tmpLevel` - # continue if requested level is less than specific appender level - [ ! $_l -le $_level ] && continue - fi - - # determine appender layout - _tmpLayout=`echo $__log4shAppenderLayouts |awk "{print \\$$_index}"` - case $_tmpLayout in - None) _thisLayout="$_msg" ;; - Simple) _thisLayout="$_tag - $_msg" ;; - Pattern) - _tmpPattern=`appender_getPatternAtIndex $_index` - _thisLayout=`_parsePattern "$_tmpPattern" $_tag "$_msg"` - ;; - esac - - # log to appender - _tmpAppender=`echo $__log4shAppenders |awk "{print \\$$_index}"` - case $_tmpAppender in - STDOUT) echo "$_thisLayout" ;; - STDERR) echo "$_thisLayout" >&2 ;; - *) - echo "$_thisLayout" >>$_tmpAppender - ;; - esac - done - - unset _index _l _level _msg _oldIndex _tag - unset _tmpAppender _tmpLayout _tmpLevel _tmpPattern -} - -# -# This is a helper function for log function in the DEBUG priority mode. -# -# @param msg message to be logged -# @return (none) -# @see log -# -logger_debug() -{ - log DEBUG "$1" -} - -# -# This is a helper function for log function in the INFO priority mode. -# -# @param msg message to be logged -# @return (none) -# @see log -# -logger_info() -{ - log INFO "$1" -} - -# -# This is a helper function for log function in the WARN priority mode. -# -# @param msg message to be logged -# @return (none) -# @see log -# -logger_warn() -{ - log WARN "$1" -} - -# -# This is a helper function for log function in the ERROR priority mode. -# -# @param msg message to be logged -# @return (none) -# @see log -# -logger_error() -{ - log ERROR "$1" -} - -# -# This is a helper function for log function in the FATAL priority mode. -# -# @param msg message to be logged -# @return (none) -# @see log -# -logger_fatal() -{ - log FATAL "$1" -} - -# set default level -logger_setLevel ERROR - -# add the default appender -logger_addAppender STDERR Simple - -# treat unset variables as an error when substituting (disable) -set +u diff --git a/1.1/src/test/test-log4sh b/1.1/src/test/test-log4sh deleted file mode 100755 index 9cd7de0..0000000 --- a/1.1/src/test/test-log4sh +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -# $Id: test-log4sh,v 1.7 2004/06/21 22:58:52 kward Exp $ -# -# Author: Kate Ward -# -# The spiffy comments were shamelessly pulled from the lf5 examples from log4j. -# - -# load log4sh -if [ -r log4sh ]; then - . log4sh -else - echo "error: could not load (log4sh)" - exit 1 -fi - -# a sample file to log to -logFile_simple=log4sh-simple.log -logFile_pattern=log4sh-pattern.log - -# setup the initial appenders -logger_setLevel INFO -logger_addAppender $logFile_simple Simple -appender_setAppend $logFile_simple false -appender_setLevel $logFile_simple DEBUG -logger_addAppender $logFile_pattern Pattern -#appender_setPattern $logFile_pattern "%d [%t] - %m" - -logger_debug "Hello, my name is Homer Simpson." -logger_debug "Hello, my name is Lisa Simpson." -logger_debug "Hello, my name is Marge Simpson." -logger_debug "Hello, my name is Bart Simpson." -logger_debug "Hello, my name is Maggie Simpson." - -appender_setLayout STDERR None -logger_info "We are the Simpsons!" -logger_info "Mmmmmm .... Chocolate." -logger_info "Homer likes chocolate" -logger_info "Doh!" -logger_info "We are the Simpsons!" - -appender_setLayout STDERR Simple -logger_warn "Bart: I am through with working! Working is for chumps!\ - Homer: Son, I'm proud of you. I was twice your age before\ - I figured that out." -logger_warn "Mmm...forbidden donut." -logger_warn "D'oh! A deer! A female deer!" -logger_warn "Truly, yours is a butt that won't quit.\ - - Bart, writing as Woodrow to Ms. Krabappel." - -appender_setLevel STDERR OFF -logger_error "Dear Baby, Welcome to Dumpsville. Population: you." -logger_error "Mr. Hutz, are you aware you're not wearing pants?" - -appender_setLevel STDERR DEBUG -logger_fatal "Eep." -logger_fatal "Mmm...forbidden donut." -logger_fatal "D'oh! A deer! A female deer!" -logger_fatal "Mmmmmm .... Chocolate." - -appender_setLayout STDERR Pattern -logger_info "test of the default pattern layout" - -logger_setFilename `basename $0` -appender_setPattern STDERR '%d [%F] %p - %m%n' -logger_info "test of setting a pattern layout" - -appender_setPattern STDERR '%d %p - %m%n' -logger_info "test of setting a pattern layout again" - -appender_setPattern $logFile_simple '%d [%F] %p - %m' -logger_info "setting a pattern for a simple layout logger. shouldn't matter" - -appender_setPattern $logFile_pattern '%d [%f] %p - %m%n' -logger_info "setting a pattern for a patterned layout file logger, using an invalid character conversion." - -appender_setPattern STDERR '%p [%t]: %m%n' -logger_info "setting a pattern layout that uses the thread name conversion character. it isn't set yet, so it should be empty..." -logger_setThreadName `basename $0` -logger_info "the thread name is now set to the name of this script, so it should show up in output now" diff --git a/1.1/test/log4sh b/1.1/test/log4sh deleted file mode 120000 index 657a0a0..0000000 --- a/1.1/test/log4sh +++ /dev/null @@ -1 +0,0 @@ -../src/shell/log4sh \ No newline at end of file diff --git a/1.2/Makefile b/1.2/Makefile deleted file mode 100644 index 2d2a3a8..0000000 --- a/1.2/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# $Id$ - -SHELL_SRC_DIR=$(PWD)/src/shell -TEST_SRC_DIR=$(PWD)/src/test -BUILD_DIR=$(PWD)/build -DIST_DIR=$(PWD)/dist - -all: build - -build: - mkdir $(BUILD_DIR) - cp -pr $(SHELL_SRC_DIR)/* $(BUILD_DIR) - -test: build - ( cd $(BUILD_DIR); $(TEST_SRC_DIR)/test-log4sh ) - -dist: build - mkdir $(DIST_DIR) - cp -p src/shell/log4sh $(DIST_DIR) - -clean: - rmdir $(BUILD_DIR) - -distclean: clean - rmdir $(DIST_DIR) diff --git a/1.2/doc/BUILD b/1.2/doc/BUILD deleted file mode 100644 index 0856f62..0000000 --- a/1.2/doc/BUILD +++ /dev/null @@ -1,45 +0,0 @@ -# $Id$ - -BUILD DOCUMENTATION - -As log4sh is a shell script, there is no need to build the code. It is already -built. There is a Makefile included that simplifies various things about -environment setup, but nothing more. - - -BUILDING THE DOCBOOK DOCUMENTATION - -To build the documentation, you will need the following installed on your -system: - -o Sun Java JRE 1.3.x (or newer) -o Apache Ant 1.5 (or newer) -o bzip2 -o tar -o unzip - -The documentation is built using XML and XSLT from the DocBook project. The -required files are not included in the log4sh distribution as they are not -normally needed. The necessary archives can be retrieved from the one of the -URLs listed below. Place the files in the share/dist directory. - -docbook-xml-4.3.zip - http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip - http://forestent.com/dist/docbook/docbook-xml-4.3.zip -docbook-xsl-1.67.2.tar.bz2 - http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.67.2.tar.bz2?download - http://forestent.com/dist/docbook/docbook-xsl-1.67.2.tar.bz2 - -Once the archives have copied to the share/dist directory, they can be -extracted into the share/docbook directory. There is a Makefile in that -directory that will automate this task. - -$ cd share/docbook -$ make - -Once the archives are extracted, it can be generated by running ant. Change to -the src/docbook directory, and run ant. The documentation will be generated in -the distributions doc directory. - -$ cd src/docbook -$ ant diff --git a/1.2/doc/CHANGES b/1.2/doc/CHANGES deleted file mode 100644 index 88beca5..0000000 --- a/1.2/doc/CHANGES +++ /dev/null @@ -1,105 +0,0 @@ -Changes with 1.2.10 - -[kwd] fixed bug that caused '\' chars in the logging message to cause problems - -[kwd] backported the _log4sh_mktempDir() function from the 1.3 series. it -attempts to use the native mktemp function if it is available on the system. if -the function is not available, it falls back to using the RANDOM variabl if it -is available. if not, it finally defaults to generating a semi-random number -that is a combination of the date and PID. - -[kwd] fixed bug that caused '&' characters in the logging message to be -replaced with '%m'. - - -Changes with 1.2.9 - -[kwd] removed extraneous call to logger_getLevel from logger_addAppender -(reported by Omner Calhoun) - -[kwd] backported a serious bugfix from 1.3.3pre. when log4sh is configured -from a properties file, there are problems when declaring more than one -appender when there are no spaces after the commas in the rootLogger -declaration. (thanks to Gordon Pedersen for indirectly finding this) - - -Changes with 1.2.8 - -*) [kwd] added a __LOG4SH_VERSION variable - -*) [kwd] implemented a more secure method for using temporary files. if the -TMPDIR variable is set, it is honored. the method is based on info from -http://www.linuxsecurity.com/content/view/115462/151/. - - -Changes with 1.2.7 - -*) [kwd] implemented logger_getThreadName, logger_pushThreadName, and -logger_popThreadName based on suggestions and a patch from Dan Johansson. - - -Changes with 1.2.6 - -*) [kwd] made some variable names in documentation a bit more readable - -*) [kwd] fixed bug #1232236 - insecure temporary file creation - - -Changes with 1.2.5 - -*) [kwd] defined the __LOG4SH_APPENDER_DAILY_ROLLING_FILE variable as it for -some reason was not defined - - -Changes with 1.2.4 - -*) [kwd] added docbook documentation - -*) [kwd] added documentation and code to build the docbook documentation - -*) [kwd] fixed the sample usage comments as they worked only for log4sh 1.1 - -*) [kwd] set all of the __LOG4SH_* constants to readonly - -*) [kwd] replaced appender_setAppend() function with appender_close() to better -match functionality of log4j - -*) [kwd] added ALL logging Level to better match log4j - -*) [kwd] added return codes to most functions for standardization - -*) [kwd] changed how log4sh was sourced in the test scripts so they would work -under solaris - - -Changes with 1.2.3 - -*) [kwd] included LGPL-2.1 license for the first official distribution - -*) [kwd] fixed the test-log4sh script so it works again - -*) [kwd] fixed many small bugs in log4sh found while fixing the test script - -*) [kwd] added initial website to source as a means of documentation - - -Changes with 1.2.2 - -*) [kwd] changed the configuration environment variable name from -LOG4SH_PROPERTIES to LOG4SH_CONFIGURATION to match log4j better - - -Changes with 1.2.1 - -*) [kwd] added support for a log4sh.properties file (not complete) - -*) [kwd] added support for %r conversion character. returns seconds as opposed -to milliseconds - - -Changes with 1.2.0 - -*) [kwd] none; this release is identical to release 1.1.5 - - -$Revision$ diff --git a/1.2/doc/LGPL-2.1 b/1.2/doc/LGPL-2.1 deleted file mode 100644 index b1e3f5a..0000000 --- a/1.2/doc/LGPL-2.1 +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/1.2/doc/TODO b/1.2/doc/TODO deleted file mode 100644 index 3c463f5..0000000 --- a/1.2/doc/TODO +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -- make logger level's case insensitive?? - -- support netcat for telnet - -- support logger for syslog diff --git a/1.2/doc/log4sh.html b/1.2/doc/log4sh.html deleted file mode 100644 index 1982b0c..0000000 --- a/1.2/doc/log4sh.html +++ /dev/null @@ -1,82 +0,0 @@ -log4sh

log4sh

Kate Ward

2005-08-30

Revision History
Revision 1.2.72005-08-30kwd
added the new get/push/pop thread name commands
Revision 1.2.62005-02-01kwd
improved examples where log4sh is searched for and sourced in
Revision 1.2.42004-12-28kwd
initial DocBook conversion

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundataion (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as this happens to be the primary platform used by myself.

Tested Operating Systems

  • Linux

  • Solaris 8, 9, 10

Tested Shells

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

1.1. Credits / Contributors

In this document, I have the pleasure of acknowledging:

  • Nobody in particular

1.2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

2. Quickstart

To get started quickly with log4sh, take a look at the test-log4sh sample script in the src/test directory of the distribution. You will need to copy the log4sh script itself from the src/shell directory into the test directory before running the test. This test script is designed to configure log4sh via code. Later on, we will configure log4sh with a properties file, very similar to how log4j is configured.

By default, log4sh is configured with a ConsoleAppender which logs to STDOUT using a SimpleLayout and a logging level of ERROR. If no configuration file is found, a warning message will be given letting the user know that no configuration file was found. This warning can be supressed by setting the LOG4SH_CONFIGURATION environment variable to none.

Run the first test.

Example 1. Test #1

-$ ./test-log4sh
-

After a first run you will see quite a bit of output to the display, and as well two log files will be created (log4sh-pattern.log and log4sh-simple.log). The display contains a mix of output to STDOUT and STDERR, and the files contain various versions of the same data, but with output that changes as various layouts and patterns are tested. To clean up the display a bit, you could send all of the output of the STDERR appender off to /dev/null.

Run the test again, but redirecting STDERR to /dev/null.

Example 2. Test #2

-$ ./test-log4sh 2>/dev/null
-

Go ahead a take a look at the test script to get a feel of what the script is trying to accomplish. Hopefully, you can see just how simple log4sh is to use and control.

For our next test, we will configure log4sh with a properties file. This test is incredibly simple as it is designed to show the power of the properties file. Copy first example properties file log4sh.properties.ex1 from the src/examples directory into the test directory, and give it the name log4sh.properties.

Run the second test.

Example 3. Test #3

-$ ./test-properties
-

This test is designed to look very much like one of the log4j examples. The properties file is taken almost verbatum from the log4j short manual, with only small changes required to make it work for log4sh. Log4sh is configured with a ConsoleAppender that has a PatternLayout. One limitation of log4sh is that it does not have access to a timer with millisecond accuracy, so it logs only with an accuracy of one second. For most situations, this should be sufficient.

Copy the second example properties file (log4sh.properties.ex2) as log4sh.properties, and rerun the test. This second properties file is only slightly different from the first in that it adds the filename to the output, and removes the %x pattern directive as that directive is not supported by log4sh.

The next example shows a typical situation where an administrator wants to run a script via a cron job, wants a log of the scripts actions, but only wants an email if the job failed.

Copy the third example properies file (log4sh.properties.ex3) over, and rerun the test. This time, the output will be sent to two separate locations; STDERR and a file called example.log. The output to STDERR is set to the ERROR level, and output sent to the file is at the INFO level. More output is written to the logfile (as expected) when the test is run.

In the situation of being run from a cron job, the logfile will always be written, but an email comes only when output from the script came at the ERROR or FATAL level. An administrator can even configure the log4sh.properties file to a DEBUG level so that more output is logged for testing or debugging purposes, and this change can happen without making any code changes to the script. Something very useful in a production environment!

3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code

  3. configure log4sh in code (optional)

  4. call logging statements

-

3.1. Preconfigure log4sh

To preconfigure log4sh, create a properties file (see the Properties File Configuration later in this document). Optionally set the LOG4SH_CONFIGURATION environment variable to point log4sh to the configuration file.

3.2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 4. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 5. Hello, world (using properties)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 6. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to DEBUG and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%r [%t] %p %c %x - %m%n
-

3.3. Configure log4sh in code

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 7. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# source log4sh (disabling properties file warning)
-LOG4SH_CONFIGURATION="none" . ./log4sh
-
-# configure log4sh defaults
-logger_setLevel INFO
-
-# configure appenders
-appender_setAppend stdout false
-logger_addAppender stderr
-appender_setAppenderType stderr FileAppender
-appender_setAppenderFile stderr STDERR
-
-# say Hello to the world
-logger_info "Hello, world"
-

3.4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

4. Properties File Configuration

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 8. Recommended minimum log4sh.properties file

-log4sh.rootLogger=INFO, stdout
-log4sh.appender.stdout=ConsoleAppender
-

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

4.1. Root Logger

(future)

4.2. Levels

Table 1. Logging Levels (from most output to least)

LevelDefinition
ALLThe ALL level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

4.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 9. Sample appender names

myAppender - good

4.3.1. Types

An appender can be set to one of several different types.

Example 10. Setting an appender type

-  log4sh.appender.A1=FileAppender
-  

Table 2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial
RollingFileAppenderoutput sent to a file that rolls over by sizepartial

4.3.2. Options

An appender can take several different options.

Example 11. Setting an appender option

-  log4sh.appender.A1.File=output.log
-  

Table 3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

4.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 12. Setting an appender's layout

-  log4sh.appender.A1.layout=PatternLayout
-  

Table 4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 13. Setting an appender's layout pattern

-  log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-  

Table 5. Pattern Options

OptionDefinitionSupported?
%ccurrent class (not applicable in shell; always returns 'shell')yes
%dcurrent date (see *NIX date man page; '%Y-%m-%d %H:%M:%S')yes
%Fcurrent script filename (default: `basename $0`)yes
%Lcurrent line number in scriptno (ignored)
%mlogging messageyes
%nOS specific line endingno (ignored)
%plogging level (aka priority)yes
%rnumber of seconds since script was startedpartial (bash)
%tcurrent executing thread (default: 'main'; code changable)yes
%xunknownno (ignored)

5. Function Reference

5.1. Root Logger

Table 6. Configuring the root logger

FunctionDefinitionExample
logger_addAppenderadd an appenderlogger_addAppender stdout
logger_addAppenderWithPatternshortcut for adding an appender with a specific pattern layoutlogger_addAppenderWithLayout myPattern '%d [%p] %m'
logger_setFilenameset the script filename for the %F pattern optionlogger_setFilename "myFilename"
logger_getLevelget the current root logger priority levellevel=`logger_getLevel`
logger_setLevelset the root logger priority levellogger_setLevel INFO
logger_getThreadNameget the current thread namethread=`logger_getThreadName`
logger_setThreadNameset the current thread name for the %t pattern optionlogger_setThreadName "myThread"
logger_pushThreadNamepush the current thread name to the thread name stack, and set a new thread namelogger_pushThreadName "myNewThread"
logger_popThreadNamepop the current thread name from the stack, and discard itlogger_popThreadName

5.2. Appenders

Table 7. Configuring appenders

FunctionDefinitionExample
appender_closeclose an appenderappender_close myAppender
appender_setAppenderFileset the output filename for the named appenderappender_setAppenderFile myAppender "output.log"
appender_setAppenderTypeset the type of appender for the named appenderappender_setAppenderType myAppender FileAppender
appender_getLayoutget an appender's layout typelayout=`appender_getLayout myAppender`
appender_setLayoutset the layout type for the named appenderappender_setLayout myAppender PatternLayout
appender_getLevelget an appender's logging prioritylevel=`appender_getLevel myAppender`
appender_setLevelset the logging priority for the named appenderappender_setLevel myAppender DEBUG
appender_setPatternset the output pattern for named appender (appender must be set to a PatternLayout)appender_setPattern myAppender '%d %p - %m%n'

5.3. Logging

Table 8. Logging statements

FunctionDefinitionExample
loglog a message at a specific levellog DEBUG "Hello, world"
logger_debuglog a message at the DEBUG levellogger_debug "This is a test"
logger_infolog a message at the INFO levellogger_info "Did you get it?"
logger_errorlog a message at the ERROR levellogger_error "I sure hope you did"
logger_warnlog a message at the WARN levellogger_warn "If not, you might be in trouble"
logger_fatallog a message at the FATAL levellogger_fatal "The end of the world is here!!!"

6. Miscellaneous Info

Log4sh has been completly developed from scratch by myself, Kate Ward. I use it in production environments where logging from shell scripts is critical, and where I need more than just a simple "Hello, I worked" type of logging message. If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at . If there is enough interest in the project, I will develop it further.

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this site and all provided source code are owned by Kate Ward.

\ No newline at end of file diff --git a/1.2/share/docbook/Makefile b/1.2/share/docbook/Makefile deleted file mode 100644 index 0b161f3..0000000 --- a/1.2/share/docbook/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# -# makefile to setup the the docbook support directory -# - -CWD=`pwd` -DIST=$(CWD)/../dist -XML=docbook-xml-4.4.zip -XSLT=docbook-xsl-1.68.1.tar.bz2 - -all: xml xslt - -xml: - if test ! -d xml/4.4; then \ - mkdir -p xml/4.4; \ - unzip -qq $(DIST)/$(XML) -d xml/4.4; \ - fi - -xslt: - if test ! -d docbook-xsl/1.68.1; then \ - mkdir -p docbook-xsl; \ - bzip2 -dc $(DIST)/$(XSLT) |tar xf -; \ - mv docbook-xsl-1.68.1 docbook-xsl/1.68.1; \ - fi - -clean: - rm -fr xml docbook-xsl* diff --git a/1.2/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl b/1.2/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl deleted file mode 100644 index 3605564..0000000 --- a/1.2/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - -start - - - - - - - - diff --git a/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl b/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl deleted file mode 100644 index f8cf7b1..0000000 --- a/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -text/css - - - - - - - diff --git a/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl b/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl deleted file mode 100644 index dd8b158..0000000 --- a/1.2/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/1.2/src/docbook/build.xml b/1.2/src/docbook/build.xml deleted file mode 100644 index 3824d80..0000000 --- a/1.2/src/docbook/build.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/1.2/src/docbook/log4sh.xml b/1.2/src/docbook/log4sh.xml deleted file mode 100644 index a9f6ab5..0000000 --- a/1.2/src/docbook/log4sh.xml +++ /dev/null @@ -1,698 +0,0 @@ - - - - - - - ALL"> - DEBUG"> - INFO"> - WARN"> - ERROR"> - FATAL"> - OFF"> -]> - -
-log4sh - - Kate - Ward - -
- - &myEmail; -
-
-
- - - 2005-08-30 - - - - - 1.2.7 - 2005-08-30 - kwd - added the new get/push/pop thread name commands - - - - 1.2.6 - 2005-02-01 - kwd - improved examples where log4sh is searched for and sourced in - - - - 1.2.4 - 2004-12-28 - kwd - initial DocBook conversion - - - - - - log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundataion (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce. - -
- - - - -
Introduction - Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as this happens to be the primary platform used by myself. - -
Tested Operating Systems - - Linux - Solaris 8, 9, 10 - -
- -
Tested Shells - - Bourne Shell (sh) - Bourne Again Shell (bash) - -
- - -
Credits / Contributors - In this document, I have the pleasure of acknowledging: - - - - Nobody in particular - -
- - -
Feedback - Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: &myEmail;. -
-
- - -
Quickstart - To get started quickly with log4sh, take a look at the test-log4sh sample script in the src/test directory of the distribution. You will need to copy the log4sh script itself from the src/shell directory into the test directory before running the test. This test script is designed to configure log4sh via code. Later on, we will configure log4sh with a properties file, very similar to how log4j is configured. - - By default, log4sh is configured with a ConsoleAppender which logs to STDOUT using a SimpleLayout and a logging level of &error;. If no configuration file is found, a warning message will be given letting the user know that no configuration file was found. This warning can be supressed by setting the LOG4SH_CONFIGURATION environment variable to none. - - Run the first test. - - Test #1 - - - - After a first run you will see quite a bit of output to the display, and as well two log files will be created (log4sh-pattern.log and log4sh-simple.log). The display contains a mix of output to STDOUT and STDERR, and the files contain various versions of the same data, but with output that changes as various layouts and patterns are tested. To clean up the display a bit, you could send all of the output of the STDERR appender off to /dev/null. - - Run the test again, but redirecting STDERR to /dev/null. - - Test #2 - /dev/null -]]> - - - Go ahead a take a look at the test script to get a feel of what the script is trying to accomplish. Hopefully, you can see just how simple log4sh is to use and control. - - For our next test, we will configure log4sh with a properties file. This test is incredibly simple as it is designed to show the power of the properties file. Copy first example properties file log4sh.properties.ex1 from the src/examples directory into the test directory, and give it the name log4sh.properties. - - Run the second test. - - Test #3 - - - - This test is designed to look very much like one of the log4j examples. The properties file is taken almost verbatum from the log4j short manual, with only small changes required to make it work for log4sh. Log4sh is configured with a ConsoleAppender that has a PatternLayout. One limitation of log4sh is that it does not have access to a timer with millisecond accuracy, so it logs only with an accuracy of one second. For most situations, this should be sufficient. - - Copy the second example properties file (log4sh.properties.ex2) as log4sh.properties, and rerun the test. This second properties file is only slightly different from the first in that it adds the filename to the output, and removes the pattern directive as that directive is not supported by log4sh. - - The next example shows a typical situation where an administrator wants to run a script via a cron job, wants a log of the scripts actions, but only wants an email if the job failed. - - Copy the third example properies file (log4sh.properties.ex3) over, and rerun the test. This time, the output will be sent to two separate locations; STDERR and a file called example.log. The output to STDERR is set to the &error; level, and output sent to the file is at the &info; level. More output is written to the logfile (as expected) when the test is run. - - In the situation of being run from a cron job, the logfile will always be written, but an email comes only when output from the script came at the &error; or &fatal; level. An administrator can even configure the log4sh.properties file to a &debug; level so that more output is logged for testing or debugging purposes, and this change can happen without making any code changes to the script. Something very useful in a production environment! -
- - -
Usage Guide - The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application. - - - - preconfigure log4sh (properties file) - source the log4sh script code - configure log4sh in code (optional) - call logging statements - - - -
Preconfigure log4sh - To preconfigure log4sh, create a properties file (see the later in this document). Optionally set the LOG4SH_CONFIGURATION environment variable to point log4sh to the configuration file. -
- -
Source log4sh - To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done. - - Sourcing external shell code into current program - - - - Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the &info; level to STDOUT. - - Hello, world (using properties) - &2 - exit 1 -fi -. $log4shDir/log4sh - -# say Hello to the world -logger_info "Hello, world" -]]> - - - Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from. - - Hello, world; properties file - - -
- -
Configure log4sh in code - To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the &info; level. - - Hello, world (configured in code) - - -
- -
Logging with log4sh - Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an &info; level. -
-
- - -
Properties File Configuration - Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf"). - - A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example. - - Recommended minimum log4sh.properties file - - - - In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender. - -
Root Logger - (future) -
- -
Levels - Logging Levels (from most output to least) - - - - Level - Definition - - - - - &all; - The &all; level has the lowest possible rank and is intended to turn on all logging. - - &debug; - The &debug; level designates fine-grained informational events that are most useful to debug an application. - - &info; - The &info; level designates informational messages that highlight the progress of the application at coarse-grained level. - - &warn; - The &warn; level designates potentially harmful situations. - - &error; - The &error; level designates error events that might still allow the application to continue running. - - &fatal; - The &fatal; level designates very severe error events that will presumably lead the application to abort. - - &off; - The &off; level has the highest possible rank and is intended to turn off logging. - - - -
-
- -
Appenders - An appender name can be any alpha-numeric string containing no spaces. - - Sample appender names - myAppender - good - - -
Types - An appender can be set to one of several different types. - - Setting an appender type - - - - Appender Types - - - - Type - Definition - Supported? - - - - - ConsoleAppender - output sent to console (STDOUT) - yes - - - FileAppender - output sent to a file - yes - - - DailyRollingFileAppender - output sent to a file that rolls over daily - partial - - - RollingFileAppender - output sent to a file that rolls over by size - partial - - - -
-
- -
Options - An appender can take several different options. - - Setting an appender option - - - - Appender Options - - - - Option - Definition - Supported? - - - - - DatePattern - configure a pattern for the output filename - no (ignored) - - - File - output filename (special filename of STDERR used for logging to STDERR) - yes - - - MaxBackupIndex - number of old logfiles to keep - no (ignored) - - - MaxFileSize - maximum size of old logfiles - no (ignored) - - - Threshold - logging level of the appender - yes - - - -
-
- -
Layouts - An appender can be configured with various Layouts to customize how the output looks. - - Setting an appender's layout - - - - Layouts - - - - Layout - Definition - Supported? - - - - - HTMLLayout - layout using HTML - no (same as SimpleLayout) - - - SimpleLayout - a simple default layout ('%p - %m') - yes - - - PatternLayout - a patterned layout (default: '%d %p - %m%n') - yes - - - -
- - An layout has many different options to configure how it appears. These are known as patterns. - - Setting an appender's layout pattern - - - - Pattern Options - - - - Option - Definition - Supported? - - - - - %c - current class (not applicable in shell; always returns 'shell') - yes - - - %d - current date (see *NIX date man page; '%Y-%m-%d %H:%M:%S') - yes - - - %F - current script filename (default: `basename $0`) - yes - - - %L - current line number in script - no (ignored) - - - %m - logging message - yes - - - %n - OS specific line ending - no (ignored) - - - %p - logging level (aka priority) - yes - - - %r - number of seconds since script was started - partial (bash) - - - %t - current executing thread (default: 'main'; code changable) - yes - - - %x - unknown - no (ignored) - - - -
-
-
-
- - -
Function Reference -
Root Logger - Configuring the root logger - - - - Function - Definition - Example - - - - - logger_addAppender - add an appender - logger_addAppender stdout - - - logger_addAppenderWithPattern - shortcut for adding an appender with a specific pattern layout - logger_addAppenderWithLayout myPattern '%d [%p] %m' - - - logger_setFilename - set the script filename for the %F pattern option - logger_setFilename "myFilename" - - - logger_getLevel - get the current root logger priority level - level=`logger_getLevel` - - - logger_setLevel - set the root logger priority level - logger_setLevel INFO - - - logger_getThreadName - get the current thread name - thread=`logger_getThreadName` - - - logger_setThreadName - set the current thread name for the %t pattern option - logger_setThreadName "myThread" - - - logger_pushThreadName - push the current thread name to the thread name stack, and set a new thread name - logger_pushThreadName "myNewThread" - - - logger_popThreadName - pop the current thread name from the stack, and discard it - logger_popThreadName - - - -
-
- -
Appenders - Configuring appenders - - - - Function - Definition - Example - - - - - appender_close - close an appender - appender_close myAppender - - appender_setAppenderFile - set the output filename for the named appender - appender_setAppenderFile myAppender "output.log" - - appender_setAppenderType - set the type of appender for the named appender - appender_setAppenderType myAppender FileAppender - - appender_getLayout - get an appender's layout type - layout=`appender_getLayout myAppender` - - appender_setLayout - set the layout type for the named appender - appender_setLayout myAppender PatternLayout - - appender_getLevel - get an appender's logging priority - level=`appender_getLevel myAppender` - - appender_setLevel - set the logging priority for the named appender - appender_setLevel myAppender DEBUG - - appender_setPattern - set the output pattern for named appender (appender must be set to a PatternLayout) - appender_setPattern myAppender '%d %p - %m%n' - - - -
-
- -
Logging - Logging statements - - - - Function - Definition - Example - - - - - log - log a message at a specific level - log DEBUG "Hello, world" - - logger_debug - log a message at the DEBUG level - logger_debug "This is a test" - - logger_info - log a message at the INFO level - logger_info "Did you get it?" - - logger_error - log a message at the ERROR level - logger_error "I sure hope you did" - - logger_warn - log a message at the WARN level - logger_warn "If not, you might be in trouble" - - logger_fatal - log a message at the FATAL level - logger_fatal "The end of the world is here!!!" - - - -
-
-
- - -
Miscellaneous Info - Log4sh has been completly developed from scratch by myself, Kate Ward. I use it in production environments where logging from shell scripts is critical, and where I need more than just a simple "Hello, I worked" type of logging message. If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at &myEmail;. If there is enough interest in the project, I will develop it further. - - Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this site and all provided source code are owned by Kate Ward. -
- -
diff --git a/1.2/src/examples/log4sh.properties.ex1 b/1.2/src/examples/log4sh.properties.ex1 deleted file mode 100644 index 3772b98..0000000 --- a/1.2/src/examples/log4sh.properties.ex1 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1 -log4sh.rootLogger=INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1=ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout=PatternLayout -log4sh.appender.A1.layout.ConversionPattern=%r [%t] %p %c %x - %m%n diff --git a/1.2/src/examples/log4sh.properties.ex2 b/1.2/src/examples/log4sh.properties.ex2 deleted file mode 100644 index a9c2065..0000000 --- a/1.2/src/examples/log4sh.properties.ex2 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to DEBUG and its only appender to A1 -log4sh.rootLogger=INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1=ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout=PatternLayout -log4sh.appender.A1.layout.ConversionPattern=%d [%F:%t] %p %c - %m%n diff --git a/1.2/src/examples/log4sh.properties.ex3 b/1.2/src/examples/log4sh.properties.ex3 deleted file mode 100644 index 768ff57..0000000 --- a/1.2/src/examples/log4sh.properties.ex3 +++ /dev/null @@ -1,16 +0,0 @@ -# set root logger to ERROR, and give it two appenders; stderr and R -log4sh.rootLogger=ERROR, stderr, R - -# set the stderr appender to STDERR with the default pattern -log4sh.appender.stderr=FileAppender -log4sh.appender.stderr.File=STDERR -log4sh.appender.stderr.layout=PatternLayout - -# setup the R appender as a file appender at the INFO level with a pattern -log4sh.appender.R=RollingFileAppender -log4sh.appender.R.Threshold=INFO -log4sh.appender.R.File=example.log -log4sh.appender.R.MaxFileSize=100KB -log4sh.appender.R.MaxBackupIndex=1 -log4sh.appender.R.layout=PatternLayout -log4sh.appender.R.layout.ConversionPattern=%d [%p] %c - %m%n diff --git a/1.2/src/shell/log4sh b/1.2/src/shell/log4sh deleted file mode 100644 index 4c432b5..0000000 --- a/1.2/src/shell/log4sh +++ /dev/null @@ -1,948 +0,0 @@ -# $Id$ -# -# log4sh 1.2.10 -# -# written by Kate Ward -# released under the LGPL -# -# this module implements something like the log4j module from the Apache group -# -# notes: -# *) the default appender is a ConsoleAppender called stdout with a level -# of ERROR and SimpleLayout -# *) the appender levels are as follows (decreasing order of output): -# DEBUG, INFO, WARN, ERROR, FATAL, OFF -# - -# (possibly) declare variables that might come in from outside -[ -z "$LOG4SH_CONFIGURATION" ] && LOG4SH_CONFIGURATION='' - -# treat unset variables as an error when substituting -set -u - -# -# constants -# -__LOG4SH_VERSION=1.2.10 - -__LOG4SH_TRUE=0 -__LOG4SH_FALSE=1 - -__LOG4SH_CONFIGURATION='log4sh.properties' - -__LOG4SH_APPENDER_CONSOLE='ConsoleAppender' -__LOG4SH_APPENDER_FILE='FileAppender' -__LOG4SH_APPENDER_ROLLING_FILE='RollingFileAppender' -__LOG4SH_APPENDER_DAILY_ROLLING_FILE='DailyRollingFileAppender' - -__LOG4SH_LAYOUT_HTML='HTMLLayout' -__LOG4SH_LAYOUT_SIMPLE='SimpleLayout' -__LOG4SH_LAYOUT_PATTERN='PatternLayout' - -__LOG4SH_LEVEL_ALL=0 -__LOG4SH_LEVEL_DEBUG=1 -__LOG4SH_LEVEL_INFO=2 -__LOG4SH_LEVEL_WARN=3 -__LOG4SH_LEVEL_ERROR=4 -__LOG4SH_LEVEL_FATAL=5 -__LOG4SH_LEVEL_OFF=6 -__LOG4SH_LEVEL_CLOSED=255 - -__LOG4SH_PATTERN_DEFAULT='%d %p - %m%n' -__LOG4SH_THREAD_DEFAULT='main' - -# set the constants to readonly -for _const in `set |grep "^__LOG4SH_" |awk -F= '{print $1}'`; do - readonly $_const -done -unset _const - -# -# variables -# -__log4sh_filename="`basename $0`" -__log4sh_tmpDir='' - -__log4shAppenders='' -__log4shAppenderCount=0 -__log4shAppenderFiles='' -__log4shAppenderLayouts='' -__log4shAppenderLevels='' -__log4shAppenderPatterns='' -__log4shAppenderTypes='' - -__log4shThreadArray=$__LOG4SH_THREAD_DEFAULT -__log4shThreadName=$__LOG4SH_THREAD_DEFAULT - -# -# private functions -# - -# -# Creates a secure temporary directory within which temporary files can be -# created. Honors the TMPDIR variable if it is set. -# -# @return string path to temporary location -# -_log4sh_mktempDir() -{ - # try the standard mktemp function - ( exec mktemp -dqt log4sh.XXXXXX 2>/dev/null ) && return - - # the standard mktemp didn't work. doing our own. - RANDOM="${RANDOM:-}" - if [ -n "${RANDOM}" ]; then - # $RANDOM works - _random=${RANDOM}${RANDOM}${RANDOM}${$} - else - # $RANDOM doesn't work - _date=`date '+%Y%m%d%H%M%S'` - _random=`expr ${_date} / ${$}` - fi - - _tmpDir="${TMPDIR-/tmp}/log4sh.${_random}" - ( umask 077 && mkdir "${_tmpDir}" ) || { - echo "log4sh:FATAL could not create temporary directory! exiting" >&2 - exit 1 - } - echo ${_tmpDir} - unset _date _random _tmpDir -} - -# -# Converts an internally used level constant into its external tag equivalent -# -# @param _level internal level (eg. 3) -# @echo string external tag equivalent (eg. WARN) -# @return boolean was the supplied _level valid? -# -_log4sh_level2tag() -{ - _level=$1 - - _return=$__LOG4SH_TRUE - _tag='' - - case $_level in - $__LOG4SH_LEVEL_ALL) _tag='ALL' ;; - $__LOG4SH_LEVEL_DEBUG) _tag='DEBUG' ;; - $__LOG4SH_LEVEL_INFO) _tag='INFO' ;; - $__LOG4SH_LEVEL_WARN) _tag='WARN' ;; - $__LOG4SH_LEVEL_ERROR) _tag='ERROR' ;; - $__LOG4SH_LEVEL_FATAL) _tag='FATAL' ;; - $__LOG4SH_LEVEL_OFF) _tag='OFF' ;; - $__LOG4SH_LEVEL_CLOSED) _tag='CLOSED' ;; - *) _return=$__LOG4SH_FALSE ;; - esac - - echo $_tag - unset _level _tag - return $_return -} - -# -# Converts an externally used tag into its internal constant equivalent -# -# @param _tag external tag (eg. WARN) -# @echo string internal level equivalent (eg. 3) -# @return boolean was the supplied _tag valid? -# -_log4sh_tag2level() -{ - _tag=$1 - - _level='' - _return=$__LOG4SH_TRUE - - case $_tag in - ALL) _level=$__LOG4SH_LEVEL_ALL ;; - DEBUG) _level=$__LOG4SH_LEVEL_DEBUG ;; - INFO) _level=$__LOG4SH_LEVEL_INFO ;; - WARN) _level=$__LOG4SH_LEVEL_WARN ;; - ERROR) _level=$__LOG4SH_LEVEL_ERROR ;; - FATAL) _level=$__LOG4SH_LEVEL_FATAL ;; - OFF) _level=$__LOG4SH_LEVEL_OFF ;; - CLOSED) _level=$__LOG4SH_LEVEL_CLOSED ;; - *) _return=$__LOG4SH_FALSE ;; - esac - - echo $_level - unset _level _tag - return $_return -} - -# -# Replaces a value at a given position in an array -# -# @param _pos position of value -# @param _value value to place into array -# @param _array space separated string of values (poor man's array) -# @echo string new version of array -# @return boolean boolean result of whether or not array position was found -# -_log4sh_arrayReplace() -{ - _pos=$1 - _value=$2 - _array=$3 - - _i=1 - _found=$__LOG4SH_FALSE - _max=`echo $_array |wc -w` - _new='' - while [ $_i -le $_max ]; do - if [ $_i -ne $_pos ]; then - _new="$_new "`echo $_array |awk "{print \\$$_i}"` - else - _new="$_new $_value" - _found=$__LOG4SH_TRUE - fi - _i=`expr $_i + 1` - done - - echo "$_new" |sed 's/^ //' - _return=$_found - unset _i _found _max _new - unset _pos _value _array - return $_return -} - -# -# This function generates message given a pattern template and a message -# to use -# -# Notes: -# * The %r character modifier does not work in the Solaris /bin/sh shell -# -# @param _pattern the pattern template -# @param _priority the priority of this logging message -# @param _msg the message to be -# @echo string parsed according to the pattern template -# -_log4sh_parsePattern() -{ - _pattern=$1 - _priority=$2 - _msg=$3 - - _date=`date '+%Y-%m-%d %H:%M:%S'` - - # escape any '\' and '&' chars in the message - _msg=`echo "${_msg}" |sed 's/\\\\/\\\\\\\\/g;s/&/\\\\&/g'` - - # parse the pattern - echo "$_pattern" |sed \ --e 's/%c/shell/' \ --e "s/%d/$_date/" \ --e "s/%F/$__log4sh_filename/" \ --e 's/%L//' \ --e 's/%n//' \ --e "s/%p/$_priority/" \ --e "s/%r/$SECONDS/" \ --e "s/%t/$__log4shThreadName/" \ --e 's/%x//' \ --e "s%m$_msg" - unset _date _pattern _tag _msg -} - -# -# Properties file functions -# - -# -# parses out the prefix of a property configuration command -# -# @param string configuration command -# @echo string prefix of the configuration command -# -_log4sh_getPropPrefix() -{ - echo $1 |sed 's/^\([^.]*\)\..*/\1/' -} - -# -# strips the prefix off a property configuration command -# -# @param string configuration command -# @echo string configuration command with prefix stripped off -# -_log4sh_stripPropPrefix() -{ - echo $1 |sed 's/^[^.]*\.//' -} - -# -# configures log4sh with an appender property configuration statement -# -# @param _key configuration command -# @param _value configuration value -# -_log4sh_propAppender() -{ - _key=$1 - _value=$2 - - # strip the leading appender name - _key=`_log4sh_stripPropPrefix $_key` - - # handle appender definitions - if [ "$_key" '=' "`echo $_key |sed 's/\.//g'`" ]; then - case $_value in - $__LOG4SH_APPENDER_CONSOLE) appender_setAppenderType $_key $_value ;; - $__LOG4SH_APPENDER_FILE) appender_setAppenderType $_key $_value ;; - $__LOG4SH_APPENDER_DAILY_ROLLING_FILE) appender_setAppenderType $_key $_value ;; - $__LOG4SH_APPENDER_ROLLING_FILE) appender_setAppenderType $_key $_value ;; - *) echo "log4sh:ERROR appender type ($_value) unrecognized" ;; - esac - unset _key _value - return - fi - - # handle appender values and methods - _appender=`_log4sh_getPropPrefix $_key` - _key=`_log4sh_stripPropPrefix $_key` - if [ "$_key" '=' "`echo $_key |sed 's/\.//g'`" ]; then - case $_key in - DatePattern) ;; # unsupported - File) appender_setAppenderFile $_appender "$_value" ;; - MaxBackupIndex) ;; # unsupported - MaxFileSize) ;; # unsupported - Threshold) appender_setLevel $_appender "$_value" ;; - layout) appender_setLayout $_appender "$_value" ;; - *) echo "log4sh:ERROR appender value/method ($_key) unrecognized" ;; - esac - unset _key _value _appender - return - fi - - # handle appender layout values and methods - _key=`_log4sh_stripPropPrefix $_key` - case $_key in - ConversionPattern) appender_setPattern $_appender "$_value" ;; - *) echo "log4sh:ERROR layout value/method ($_key) unrecognized" ;; - esac - unset _key _value _appender -} - -# -# TODO: configure log4sh with a logger configuration statement -# -# @param _key configuration command -# @param _value configuration value -# -_log4sh_propLogger() -{ - _key=$1 - _value=$2 - - _key=`_log4sh_stripPropPrefix $_key` - echo "logger: $_key $_value" - - unset _key _value -} - -# -# configure log4sh with a rootLogger configuration statement -# -# @param rootLogger configuration value -# -_log4sh_propRootLogger() -{ - __rootLogger=`echo "$@" |sed 's/ *, */,/g'` - __count=`echo "${__rootLogger}" |sed 's/,/ /g' |wc -w` - __index=1 - while [ ${__index} -le ${__count} ]; do - __operand=`echo "${__rootLogger}" |cut -d, -f${__index}` - if [ ${__index} -eq 1 ]; then - logger_setLevel "${__operand}" - else - logger_addAppender "${__operand}" - fi - __index=`expr ${__index} + 1` - done - - unset __count __index __operand __rootLogger -} - -# -# reads a properties file, and configures appropriate configuration functions -# -# @param _file filename of the properties file -# -log4sh_readProperties() -{ - _file=$1 - - _tmpDir=`_log4sh_mktempDir` - _tmpFile="$_tmpDir/properties" - grep "^log4sh\." $_file >"$_tmpFile" - _rp_count=`wc -l $_tmpFile |awk '{print $1}'` - _rp_i=1 - while [ $_rp_i -le $_rp_count ]; do - _line=`awk "$_rp_i==NR {print}" $_tmpFile` - _key=`echo "$_line" |sed 's^\([^=]*\)=.*\1'` - _value=`echo "$_line" |sed 's^[^=]*=\(.*\)\1'` - - # strip the leading 'log4sh.' - _key=`_log4sh_stripPropPrefix $_key` - _keyword=`_log4sh_getPropPrefix $_key` - case $_keyword in - appender) _log4sh_propAppender $_key "$_value" ;; - logger) _log4sh_propLogger $_key "$_value" ;; - rootLogger) _log4sh_propRootLogger "$_value" ;; - *) echo "log4sh:ERROR unrecognized properties keyword ($_keyword)" ;; - esac - - _rp_i=`expr $_rp_i + 1` - done - rm -fr $_tmpDir - - unset _tmpDir _tmpFile _rp_i _rp_count _line _key _value _keyword - unset _file -} - -# -# Logger -# - -# -# sets the filename to be shown when the %F conversion character is used in a -# pattern layout. -# -# @param string string to use as filename -# -logger_setFilename() -{ - __log4sh_filename=$1 -} - -# -# gets the default logging level -# -# @echo string current logging level (eg. DEBUG) -# -logger_getLevel() -{ - _log4sh_level2tag $__log4shLevel -} - -# -# sets the default logging level -# -# @param _tag new default logging level (eg. DEBUG) -# -logger_setLevel() -{ - _tag=$1 - - _level=`_log4sh_tag2level $_tag` - if [ $? -eq $__LOG4SH_TRUE ]; then - __log4shLevel=$_level - else - echo "log4sh:ERROR attempt to set invalid log level '$_tag'" >&2 - fi - - unset _level _tag -} - -# -# gets the thread name -# -# @echo string the current thread name -# -logger_getThreadName() -{ - echo $__log4shThreadName -} - -# -# sets the thread name (eg. the name of the script). this thread name can be -# used with the %t conversion character within a pattern layout. -# -# @param string string to use as thread name -# -logger_setThreadName() -{ - _thread=$1 - - __log4shThreadName=$_thread - _index=`echo $__log4shThreadArray |wc -w` - __log4shThreadArray=`_log4sh_arrayReplace $_index $_thread "$__log4shThreadArray"` - - unset _index _thread -} - -# -# sets the thread name (eg. the name of the script) and pushes the old on to a -# stack for later use. This thread name can be used with the %t conversion -# character within a pattern layout. -# -# @param string string to use as thread name -# -# push thread name -# -logger_pushThreadName() -{ - _thread=$1 - - __log4shThreadArray="$__log4shThreadArray $_thread" - __log4shThreadName=$_thread - - unset _thread -} - -# -# Sets the thread name from the top item on the stack (and removes it from the -# stack). If the stack is empty the default thread name is set. The default -# thread name will never be popped from the stack. -# -logger_popThreadName() -{ - _count=`echo $__log4shThreadArray |wc -w` - if [ $_count -gt 1 ]; then - __log4shThreadArray="`echo $__log4shThreadArray |sed 's/ [^ ]*$//'`" - __log4shThreadName="`echo $__log4shThreadArray |awk '{print \$NF}'`" - else - __log4shThreadName=$__log4shThreadArray - echo "log4sh:WARN no more thread names on stack." >&2 - fi - - unset _count -} - -# -# Appenders -# - -# -# determines the index position of an appender in the appender array. -# -# @param _appender the name of the appender -# @echo integer the position of the appender in the appender array; 0 if -# not found -# -_appender_getIndex() -{ - _appender=$1 - - _index=1 - while [ $_index -le $__log4shAppenderCount ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - [ "$_a" '=' "$_appender" ] && break - _index=`expr $_index + 1` - done - [ $_index -gt $__log4shAppenderCount ] && _index=0 - - echo $_index - unset _a _appender _index -} - -# -# adds a new appender -# -# @param _appender name of appender to add -# -logger_addAppender() -{ - _appender=$1 - - __log4shAppenders="$__log4shAppenders $_appender" - __log4shAppenderFiles="$__log4shAppenderFiles -" - __log4shAppenderLevels="$__log4shAppenderLevels -" - __log4shAppenderLayouts="$__log4shAppenderLayouts $__LOG4SH_LAYOUT_SIMPLE" - __log4shAppenderPatterns="${__log4shAppenderPatterns:+$__log4shAppenderPatterns~}$__LOG4SH_PATTERN_DEFAULT" - __log4shAppenderTypes="$__log4shAppenderTypes -" - __log4shAppenderCount=`expr $__log4shAppenderCount + 1` - - unset _appender _layout -} - -# -# adds a new appender, and configures the appender to use a pattern layout -# using the supplied pattern -# -# @param _myAppender name of new appender -# @param _myPattern pattern to set for the new appender -# -logger_addAppenderWithPattern() -{ - _myAppender=$1 - _myPattern=$2 - - logger_addAppender $_myAppender - appender_setLayout $_myAppender $__LOG4SH_LAYOUT_PATTERN - appender_setPattern $_myAppender "$_myPattern" - - unset _myAppender _myPattern -} - -# -# Release any resources allocated within the appender -# -# @param _myAppender name of appender -# @return boolean was the operation successful? -# -appender_close() -{ - _myAppender=$1 - - # set the appender level to CLOSED - appender_setLevel $_myAppender CLOSED - _return=$? - - unset _myAppender - return $_return -} - -# -# sets the appender type for an appender -# -# @param _appender name of appender -# @param _type type to set appender to -# @return boolean was the operation successful? -# -appender_setAppenderType() -{ - _appender=$1 - _type=$2 - - _index=`_appender_getIndex $_appender` - __log4shAppenderTypes=`_log4sh_arrayReplace $_index $_type "$__log4shAppenderTypes"` - _return=$? - - unset _index - unset _appender _type - return $_return -} - -# -# sets the filename for an appender -# -# @param _appender name of appender -# @param _file filename for appender -# @return boolean was the operation successful? -# -appender_setAppenderFile() -{ - _appender=$1 - _file=$2 - - if [ -n "$_appender" -a -n "$_file" ]; then - # set the file - _index=`_appender_getIndex $_appender` - __log4shAppenderFiles=`_log4sh_arrayReplace $_index $_file "$__log4shAppenderFiles"` - _return=$? - - # create the file (if it isn't already) - [ $_return -eq $__LOG4SH_TRUE \ - -a ! "$_file" '=' "-" \ - -a ! "$_file" '=' "STDERR" \ - -a ! -f "$_file" \ - ] && touch $_file - else - echo "log4sh:ERROR appender_setAppenderFile(): missing appender and/or file" >&2 - $_return=$__LOG4SH_FALSE - fi - - unset _index - unset _appender _file - return $_return -} - -# -# gets the layout of the specified appender -# -# @param _appender name of appender -# @echo string layout of specified appender -# -appender_getLayout() -{ - _appender=$1 - - _index=`_appender_getIndex $_appender` - if [ $_index -ne 0 ]; then - _layout=`echo $__log4shAppenderLayouts |awk "{print \\$$_index}"` - else - _layout="unknown" - fi - - echo $_layout - unset _appender _index _layout -} - -# -# sets the layout of the specified appender -# -# @param _appender name of appender -# @param _layout layout for the appender -# @return boolean was the operation successful? -# -appender_setLayout() -{ - _appender=$1 - _layout=$2 - - case $_layout in - '') _layout=$__LOG4SH_LAYOUT_SIMPLE ;; - $__LOG4SH_LAYOUT_HTML|$__LOG4SH_LAYOUT_SIMPLE|$__LOG4SH_LAYOUT_PATTERN) ;; - *) - echo "log4sh:ERROR unknown layout $_layout" >&2 - return $__LOG4SH_FALSE - ;; - esac - - _index=`_appender_getIndex $_appender` - __log4shAppenderLayouts=`_log4sh_arrayReplace $_index $_layout "$__log4shAppenderLayouts"` - _return=$? - - unset _appender _layout _index - return $_return -} - -# -# gets the current logging level of the specified appender -# -# @param _appender name of appender -# @echo string level of appender, or "unknown" if not found -# @return boolean was the operation successful? -# -appender_getLevel() -{ - _appender=$1 - - _return=$__LOG4SH_TRUE - _index=`_appender_getIndex $_appender` - if [ $_index -gt 0 ]; then - _level=`echo $__log4shAppenderLevels |awk "{print \\$$_index}"` - else - _level="unknown" - _return=$__LOG4SH_FALSE - fi - - echo $_level - unset _appender _index _level - return $_return -} - -# -# set the logging level of the specified appender -# -# @param _appender name of appender -# @param _level level to set appender to -# @return boolean was the operation successful? -# -appender_setLevel() -{ - _appender=$1 - _level=$2 - - _index=`_appender_getIndex $_appender` - __log4shAppenderLevels=`_log4sh_arrayReplace $_index $_level "$__log4shAppenderLevels"` - _return=$? - - unset _appender _level _index - return $_return -} - -# -# gets the pattern of appender at the specified array index -# -# @param _index array index of the pattern -# @echo string pattern -# -_appender_getPatternAtIndex() -{ - _index=$1 - - _pattern=`echo "$__log4shAppenderPatterns" |awk -F~ "{print \\$$_index}"` - - echo $_pattern - unset _index -} - -# -# sets the pattern of the specified appender -# -# @param _appender name of appender -# @param _pattern pattern to set for appender -# @return boolean was the operation successful? -# -appender_setPattern() -{ - _appender=$1 - _pattern=$2 - - _index=1 - _newPatterns='' - _found=$__LOG4SH_FALSE - - while [ $_index -le $__log4shAppenderCount ]; do - _a=`echo $__log4shAppenders |awk "{print \\$$_index}"` - _p=`echo $__log4shAppenderPatterns |awk -F~ "{print \\$$_index}"` - - if [ ! "$_a" '=' "$_appender" ]; then - _newPatterns="${_newPatterns:+$_newPatterns~}$_p" - else - _newPatterns="${_newPatterns:+$_newPatterns~}$_pattern" - _found=$__LOG4SH_TRUE - fi - - _index=`expr $_index + 1` - done - __log4shAppenderPatterns="$_newPatterns" - - _return=$_found - unset _a _appender _found _index _newPatterns _p _pattern - return $_return -} - -# -# Log -# - -# -# base logging command that logs a message to all defined appenders -# -# @param _tag logging level to log the message at -# @param _msg message to be logged -# -log() -{ - _tag=$1 - _msg=$2 - - _level=`_log4sh_tag2level $_tag` - _nextIndex=1 - _l=0 - - while [ $_nextIndex -le $__log4shAppenderCount ]; do - _myIndex=$_nextIndex - _nextIndex=`expr $_nextIndex + 1` - - # determine appender level - _tmpLevel=`echo $__log4shAppenderLevels |awk "{print \\$$_myIndex}"` - if [ "$_tmpLevel" = "-" ]; then - # continue if requested is level less than general level - [ ! $__log4shLevel -le $_level ] && continue - else - _l=`_log4sh_tag2level $_tmpLevel` - # continue if requested level is less than specific appender level - [ ! $_l -le $_level ] && continue - fi - - # determine appender layout - _tmpLayout=`echo $__log4shAppenderLayouts |awk "{print \\$$_myIndex}"` - case $_tmpLayout in - $__LOG4SH_LAYOUT_SIMPLE|$__LOG4SH_LAYOUT_HTML) - _thisLayout="$_tag - $_msg" - ;; - $__LOG4SH_LAYOUT_PATTERN) - _tmpPattern=`_appender_getPatternAtIndex $_myIndex` - _thisLayout=`_log4sh_parsePattern "$_tmpPattern" $_tag "$_msg"` - ;; - esac - - # log to appender - _appenderType=`echo $__log4shAppenderTypes |awk "{print \\$$_myIndex}"` - case $_appenderType in - $__LOG4SH_APPENDER_CONSOLE) - echo "$_thisLayout" - ;; - *) - _appenderFile=`echo $__log4shAppenderFiles |awk "{print \\$$_myIndex}"` - if [ "$_appenderFile" = "STDERR" ]; then - echo "$_thisLayout" >&2 - elif [ "$_appenderFile" != "-" ]; then - echo "$_thisLayout" >>$_appenderFile - fi - ;; - esac - done - - unset _tag _msg - unset _appenderFile _appenderType _myIndex _nextIndex _l _level - unset _thisLayout _tmpLayout _tmpLevel _tmpPattern -} - -# -# This is a helper function for log function in the ALL priority mode. -# -# @param string message to be logged -# -logger_all() -{ - log ALL "$1" -} - -# -# This is a helper function for log function in the DEBUG priority mode. -# -# @param string message to be logged -# -logger_debug() -{ - log DEBUG "$1" -} - -# -# This is a helper function for log function in the INFO priority mode. -# -# @param string message to be logged -# -logger_info() -{ - log INFO "$1" -} - -# -# This is a helper function for log function in the WARN priority mode. -# -# @param string message to be logged -# -logger_warn() -{ - log WARN "$1" -} - -# -# This is a helper function for log function in the ERROR priority mode. -# -# @param string message to be logged -# -logger_error() -{ - log ERROR "$1" -} - -# -# This is a helper function for log function in the FATAL priority mode. -# -# @param string message to be logged -# -logger_fatal() -{ - log FATAL "$1" -} - -# -# main -# - -# load the properties file -if [ -n "$LOG4SH_CONFIGURATION" -a -r "$LOG4SH_CONFIGURATION" ]; then - log4sh_readProperties $LOG4SH_CONFIGURATION -elif [ -z "$LOG4SH_CONFIGURATION" -a -r "$__LOG4SH_CONFIGURATION" ]; then - log4sh_readProperties $__LOG4SH_CONFIGURATION -else - if [ "$LOG4SH_CONFIGURATION" != "none" ]; then - echo "log4sh:WARN No appenders could be found." >&2 - echo "log4sh:WARN Please initalize the log4sh system properly." >&2 - fi - logger_setLevel ERROR - logger_addAppender stdout - appender_setAppenderType stdout ConsoleAppender -fi - -# treat unset variables as an error when substituting (disable) -set +u - diff --git a/1.2/src/test/test-log4sh b/1.2/src/test/test-log4sh deleted file mode 100755 index 9360c1e..0000000 --- a/1.2/src/test/test-log4sh +++ /dev/null @@ -1,130 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# -# The spiffy comments were shamelessly pulled from the lf5 examples from log4j. -# -# * Thu Sep 01 2005 -# - ported the {get|push|pull}ThreadName functions from 1.2.7 -# -# * Mon Jun 20 2005 -# - added testing for syslog. need to tail /var/log/messages or wherever these -# will pop out at! -# - -# load log4sh -if [ -r log4sh ]; then - LOG4SH_CONFIGURATION="none" . ./log4sh -else - echo "error: could not load (log4sh)" - exit 1 -fi - -# -# setup the initial logging environment -# - -# set the default logging level to INFO -logger_setLevel INFO - -# add a file appender at the DEBUG level with the default layout -logger_addAppender mySimple -appender_setAppenderType mySimple FileAppender -appender_setAppenderFile mySimple log4sh-simple.log -appender_setLevel mySimple DEBUG - -# add another file appender at the default level, but with a Pattern layout -logger_addAppenderWithPattern myPattern '%d [%p] (%F) - %m%n' -appender_setAppenderType myPattern FileAppender -appender_setAppenderFile myPattern log4sh-pattern.log - -# -# do some logging -# - -# log some at the DEBUG level -logger_debug "Hello, my name is Homer Simpson." -logger_debug "Hello, my name is Lisa Simpson." -logger_debug "Hello, my name is Marge Simpson." -logger_debug "Hello, my name is Bart Simpson." -logger_debug "Hello, my name is Maggie Simpson." - -# and add a new FileAppender to STDERR -logger_addAppender mySTDERR -appender_setAppenderType mySTDERR FileAppender -appender_setAppenderFile mySTDERR STDERR - -# log some at the INFO level -logger_info "We are the Simpsons!" -logger_info "Mmmmmm .... Chocolate." -logger_info "Homer likes chocolate" -logger_info "Doh!" -logger_info "We are the Simpsons!" - -# close the default ConsoleAppender -appender_close stdout - -# log some at the WARN level -logger_warn "Bart: I am through with working! Working is for chumps!\ - Homer: Son, I'm proud of you. I was twice your age before\ - I figured that out." -logger_warn "Mmm...forbidden donut." -logger_warn "D'oh! A deer! A female deer!" -logger_warn "Truly, yours is a butt that won't quit.\ - - Bart, writing as Woodrow to Ms. Krabappel." - -# set the level of the mySTDERR appender to OFF -appender_setLevel mySTDERR OFF - -# log some at the ERROR level -logger_error "Dear Baby, Welcome to Dumpsville. Population: you." -logger_error "Mr. Hutz, are you aware you're not wearing pants?" - -# set the mySTDERR level to DEBUG -appender_setLevel mySTDERR DEBUG - -# log some at the FATAL level -logger_fatal "Eep." -logger_fatal "Mmm...forbidden donut." -logger_fatal "D'oh! A deer! A female deer!" -logger_fatal "Mmmmmm .... Chocolate." - -# various setting changes -appender_setLayout mySTDERR PatternLayout -logger_info "test of the default pattern layout" - -appender_setPattern mySTDERR '%d [%F] %p - %m%n' -logger_info "test of setting a pattern layout" - -appender_setPattern mySTDERR '%d %p - %m%n' -logger_info "test of setting a pattern layout again" - -appender_setPattern mySimple '%d [%F] %p - %m' -logger_info "setting a pattern for a simple layout logger. should not change the pattern of the simple logger as it is still set to a simple layout." - -# manually set the value of the filename flag -logger_setFilename "myFilename" -appender_setPattern myPattern '%d [%F] %p - %m%n' -logger_info "setting a new pattern for a patterned layout file logger" - -appender_setPattern myPattern '%d [%f] %p - %m%n' -logger_info "setting a pattern for a patterned layout file logger, using an invalid character conversion." - -appender_setPattern myPattern '%d %p - %m%n' -logger_info "setting the pattern for the patterned layout file logger back to a reasonable value." - -# test the *ThreadName functions -appender_setPattern mySTDERR '%p [%F:%t]: %m%n' -logger_info "setting a pattern layout for STDERR that uses the thread name conversion character. the thread name isn't set yet, so it should be the default value ('main' as of this writing)..." -logger_setThreadName myThread -logger_info "the thread name is now set to the name of this script, so it should show up in output now" -logger_info "will now 'push' a new thread 'myNewThread' on the thread name stack..." -logger_pushThreadName "myNewThread" -logger_info "checking to see if the thread name changed. did it?" -thread=`logger_getThreadName` -logger_info "just 'got' the thread name of '$thread'. does it match what is shown over on the left?" -logger_popThreadName -logger_info "I just popped the topmost thread name. the previous thread name should be shown again. is it?" -logger_popThreadName -logger_info "I just popped again. the thread name should not have changed as we were already at the topmost thread name. there should have been a log4sh warning too." diff --git a/1.2/src/test/test-properties b/1.2/src/test/test-properties deleted file mode 100755 index 10e0467..0000000 --- a/1.2/src/test/test-properties +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# - -log_msg() -{ - logger_debug "(my debug message) $1" - logger_info "(my info message) $1" - logger_error "(my error message) $1" - logger_warn "(my warn message) $1" - logger_fatal "(my fatal message) $1" -} - -#set -x - -# load log4sh -if [ -r log4sh ]; then - . ./log4sh -else - echo "error: could not load (log4sh)" - exit 1 -fi - -log_msg "log4sh now loaded" - diff --git a/1.3/Makefile b/1.3/Makefile deleted file mode 100644 index 36e586d..0000000 --- a/1.3/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# $Id$ - - -DOCBOOK_SRC_DIR=$(PWD)/src/docbook -EXAMPLES_SRC_DIR=$(PWD)/src/examples -SHELL_SRC_DIR=$(PWD)/src/shell -TEST_SRC_DIR=$(PWD)/src/test - -BIN_DIR=$(PWD)/bin -BUILD_DIR=$(PWD)/build -DIST_DIR=$(PWD)/dist -DOCBOOK_BUILD_DIR=$(BUILD_DIR)/docbook -LIB_DIR=$(PWD)/lib -TEST_DIR=$(PWD)/test - -HTML_XSL=$(PWD)/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl - -all: build docs - -build: build-prep - cp -p $(SHELL_SRC_DIR)/log4sh $(BUILD_DIR) - -build-clean: - rm -fr $(BUILD_DIR) - -build-prep: - @mkdir -p $(BUILD_DIR) - -docs: docs-transform-shelldoc docs-transform-docbook - -docs-prep: - @mkdir -p $(DOCBOOK_BUILD_DIR) - @echo "Preparing documentation for parsing" - @isoDate=`date "+%Y-%m-%d"`; \ - find $(DOCBOOK_SRC_DIR) -name "*.xml" |\ - while read f; do \ - bn=`basename $$f`; \ - sed -e "s/@@ISO_DATE@@/$$isoDate/g" $$f >$(DOCBOOK_BUILD_DIR)/$$bn; \ - done - -docs-extract-shelldoc: docs-prep - @echo "Extracting the ShellDoc" - @$(BIN_DIR)/extractDocs.pl $(SHELL_SRC_DIR)/log4sh >$(BUILD_DIR)/log4sh_shelldoc.xml - -docs-transform-shelldoc: docs-prep docs-extract-shelldoc - @echo "Parsing the extracted ShellDoc" - @xsltproc $(PWD)/src/resources/shelldoc.xslt $(BUILD_DIR)/log4sh_shelldoc.xml >$(DOCBOOK_BUILD_DIR)/functions.xml - -docs-transform-docbook: docs-prep - @echo "Parsing the documentation with DocBook" - @xsltproc $(HTML_XSL) $(DOCBOOK_BUILD_DIR)/log4sh.xml >$(BUILD_DIR)/log4sh.html - -test: test-prep - @echo ------------------------------------------------------------------------------- - @echo "testing log4sh from an initial properties configuration" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/test-prop-config ) - @echo ------------------------------------------------------------------------------- - @echo "testing log4sh via runtime configuration" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/test-runtime-config ) - @echo ------------------------------------------------------------------------------- - @echo "executing log4sh unit tests" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/run-test-suite ) - -test-clean: - rm -fr $(TEST_DIR) - -test-prep: build test-clean - @mkdir -p $(TEST_DIR) - cp -p $(EXAMPLES_SRC_DIR)/hello_world $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/test* $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/run-test-suite $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/*.data $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/*.properties $(TEST_DIR) - cp -p $(LIB_DIR)/shunit/shunit $(TEST_DIR) - cp -p $(BUILD_DIR)/log4sh $(TEST_DIR) - -dist: build docs - @mkdir $(DIST_DIR) - cp -p $(BUILD_DIR)/log4sh $(DIST_DIR) - cp -p $(BUILD_DIR)/log4sh.html $(DIST_DIR) - -clean: build-clean test-clean - -distclean: clean - rm -fr $(DIST_DIR) diff --git a/1.3/doc/CHANGES-1.3.txt b/1.3/doc/CHANGES-1.3.txt deleted file mode 100644 index dda2766..0000000 --- a/1.3/doc/CHANGES-1.3.txt +++ /dev/null @@ -1,368 +0,0 @@ -Changes with 1.3.8 (1.4.0) - -[kwd] removed unset variable checks for parameters passed to functions for -those functions that already check beforehand for enough parameters being -passed - -[kwd] fixed the reading of a command alternative from a config file (credits to -Mickaël Canévet) - -[kwd] fix for sending mail via the SMTPAppender -- a Subject with spaces in it -did not work (credits to Mickaël Canévet) - -[kwd] added an SMTPAppender unit test - -[kwd] removed the internal _appender_smtp_getToByIndex() and -_appender_smtp_getSubjectByIndex() functions - -[kwd] the 'mail' command is now a supported command alternative - -[kwd] the log4sh_setAlternative() function now supports an optional flag that -indicates the command should be searched using the runtime path - -[kwd] fixed bug where an unset was attempting to unset the value of a variable -rather than the variable itself - -[kwd] brought appender_getLevel() up to standard - - -Changes with 1.3.7 - -[kwd] added more unit tests - -[kwd] bug# 1611574; fixed problem causing 'unbound variable' errors - -[kwd] the default /bin/sh shell on my notebook is now dash (I'm running Ubuntu -Edgy currently), so adding that to the list of supported shells. - -[kwd] fixed error checking for appender_syslog_setFacility() function. the -shell canceled things before the error checking could detect why. - -[kwd] bug# 1614338; fixed issue with the SyslogAppender not logging properly. -(credits to Rob Holland for pointing this out) - -[kwd] added deprecated syslog facility name 'security' for better compatibility - -[kwd] using the deprecated syslog level names ('panic', 'error', and 'warn') -for better compatibility - -[kwd] added missing syslog host functionality, although it still doesn't work -because the 'logger' command doesn't support sending to a remote host. must -find a different means for remote hosts. netcat maybe? - -[kwd] added an include file for the unit test functions so there is less code -duplication in the unit tests themselves. - -[kwd] fixed bug where the SMTP subject was not being set properly. (Credits to -Mickaël Canévet for pointing this out) - -[kwd] added initial ability to specify paths for command alternates. currently, -only nc (netcat) is supported to enable remote syslog logging. - -[kwd] remote syslog logging now works. enable using log4sh_setAlternative() for -the 'nc' (netcat) command. - -[kwd] the RollingFileAppender now works - -[kwd] added a log4sh_enableStrictBehavior() function that forces stricter -compliance with log4j - -[kwd] added a testMultipleAppender unit test. found that pdksh doesn't actually work with multiple appenders :-( - -[kwd] fix a bug which caused the pdksh shell to not work properly - -[kwd] added additional random number generator to _log4sh_mktempDir() function. -it uses /dev/urandom if present. - --- Changes with shUnit 1.0.2 - -[kwd] fixed problem where some of the unit test functions were reportingerrors -like '/bin/sh: Can't open setUp' - -[kwd] flushed out the remaining assert and fail functions that are present in -JUnit - -[kwd] if an interrupt is received (e.g. Ctrl-C), a unit test report up until -the point of interrupt is now generated - - -Changes with 1.3.6 - -[kwd] did some major code reorganization to group common code groups together - -[kwd] renamed the _log4sh_level2tag() and _log4sh_tag2level() functions to -_level_toLevel() and _level_toInt() correspondingly. they were very badly -named, and were a reminant of the very early log4sh code base. - -[kwd] reworked the internal log4sh debugging. had problems debugging why ksh -wasn't working properly, and decided that the log4sh debugging needed to be -improved to help me find the problems easier. - -[kwd] again, forgot to test with ksh (argh!). have added testing of several -shells to the run-test-suite script to be sure I don't forget them again. - -[kwd] fixed a bug when trying to restore old trap signal handlers. had a bad -regex and was missing some "'" chars - -[kwd] fixed the problems with ksh where having a function redefine itself and -then reload itself at runtime was causing infinite loops - -[kwd] renamed the logger_readProperties() function to logger_doConfigure() -to closer match log4j - -[kwd] added an appender_activateOptions() function that should be called after -any changes to an appenders configuration are changed. this is something that -is present in log4j 1.2, and will be required in log4j 1.3. - -[kwd] removed the appender_syslog_getFacilityByIndex() and -appender_syslog_getFacilityByName() functions - -[kwd] added code to fully implement the '%r' conversion character under all -supported shells. - -[kwd] improved all unit tests so they will work under the standard Solaris -shell [/bin/sh] - -[kwd] reworked the trap handler so it works under all supported shells - -[kwd] added workaround for the set builtin as its default behavior is different -between Bourne based shells and ksh. - - -Changes with 1.3.5 - -[kwd] implemented passing data to logger_*() functions via pipes. this was -implemented once before, but it somehow got lost. - -[kwd] added dynamic caching of the appenders as function calls to reduce the -amount of work needed for each logger_*() function call. done to increase -performance, especially under cygwin and on slower cpus. unfortunately, it -seems that I have added enough other stuff to the script that it is now even -slower under cygwin, despite reducing the work needed to happen. - -[kwd] added functionality so that filenames specified for FileAppenders in the -properties file can contain shell variables that will be evaluated at runtime -(e.g. 'log4sh.appender.log.File = ${TMPDIR}/output.log') - -[kwd] fixed bug where the IFS was not being correctly set back after a logging -statement was called - -[kwd] now saves the current set of shell options stored in $- and restores them -after log4sh is sourced into memory - -[kwd] fixed bug where newlines in a message caused parsing problems. (credits -to Tim Kordick for pointing this out) - -[kwd] implemented sending messages to log4sh via pipes (e.g. -'ls -l |logger_info') - -[kwd] fixed bug (thanks to the new unit test framework) where a pattern of just -a '%d' would return nothing instead of the date - -[kwd] developed a shUnit unit test framework similar to JUnit. I didn't like -what I found on Internet, so I rolled my own. finding bugs with it already! - -[kwd] added conditional declaration of the SECONDS variable in case it is -missing from the shell implementation being used (e.g. under Bourne shell) - - -Changes with 1.3.4 - -[kwd] added support for a LOG4SH_CONFIG_PREFIX variable. if this variable is -set before log4sh is loaded, then the default prefix (normally 'log4sh') will -be overridden. added so that log4j.properties files can be read with no -changes necessary. (e.g. "LOG4SH_CONFIG_PREFIX='log4j'") - -[kwd] changed the handling of the LOG4SH_CONFIGURATION property to make the -implementation a bit cleaner - -[kwd] reworked the test scripts so that there is a test-prop-config script that -sets up a logging environment from a log4sh.properties file, and a -test-runtime-config script that sets up the exact same environment, but at -runtime. they both call a test-common script so that they should give nearly -exactly the same output. - -[kwd] fixed bug that caused '\' chars in the logging message to cause problems - -[kwd] added a log4sh_cleanup() function that scripts can call. normally log4sh -will be cleaned up using a trap handler, but if an external script overrides -the trap handler, it won't work. this gives scripts the ability to manually -invoke the cleanup. - -[kwd] fixed bug that caused '&' characters in the logging message to be -replaced with '%m'. - -[kwd] updated comments in the examples to match what the examples are actually -showing. (thanks to Stephan Hegel for pointing out the mismatch) - -[kwd] fixed bug that caused only the first conversion character in a -PatternLayout to be replaced. (credits to Aaron Rodden for the patch) - -[kwd] worked on the PatternLayout 'd' conversion character. it now supports -giving a date specifier (e.g. %d{ISODATE}), but whatever is specified is -ignored. it was done to better support log4j properties files that are -converted. - -[kwd] the '%' PatternLayout conversion character is now supported. when two -'%%' chars are given in a pattern, they are replaced with a single '%' char in -the output. - -[kwd} added support for the %X PatternLayout conversion character. (credits to -Aaron Rodden for the patch) - - -Changes with 1.3.3 - -[kwd] improved the _log4sh_mktempDir function some more. the random temporary -directories generated under the standard Solaris shell were not all that random -(as pointed out by Gordon Pedersen). the function now supports the system -mktemp function (if it exists), but falls back to the shell $RANDOM value (if -it works), and finally it will do a mix of the date divided by the current -process id. this should make the semi-random value suffiently difficult enough -to easily guess. - -[kwd] replacing some more sed commands with expr equivalents - -[kwd] fixed a situation where changing the default value of the IFS variable -once log4sh was loaded would cause log4sh to have problems with for loops - -[kwd] added trap code to automatically remove the temporary directory upon exit -of the script. did this so that if the outside script is killled, the -temporary directory is still cleaned up. - -[kwd] with the addition of a trap handler, the log4sh handler overwrites any -previously defined handler. added code to execute the previous handler as well -so that log4sh plays nicely with scripts that trap the EXIT or TERM signals as -well. - -[kwd] added the ability to debug log4sh itself by declaring a LOG4SH_DEBUG -variable - -[kwd] found a major oops bug when configuring log4sh using a properties file. -If there were more than two appenders declared with the log4sh.rootLogger -option, or if they were not separated with exactily ', ' (comma space), they -were [mostly] ignored. basically, it didn't work right. brown bag here! -(thanks to Gordon Pedersen for indirectly finding this one) - -[kwd] added appender_exists function to check for the existance of an appender. -some things were being done with the assumption that the appender existed, but -it was never checked. starting to check now. - -[kwd] applied a user supplied patch that allows the SyslogAppender to use the -different facilities and levels, and to write the name of the script and pid as -well to make the syslog output more standard. (credits to Aaron Rodden) - -[kwd] after looking through some log4j code, I realized that if an invalid -Syslog facility is given, log4j defaults to the 'user' facility. log4sh does -now too. - -[kwd] spaced now before and after the '=' char in the log4sh.properties file -(e.g. "log4sh.appender.F = FileAppender") - - -Changes with 1.3.2 - -[kwd] removed the last reminants of the old array implementation that was used -for the __log4shAppenders variable. the new implementation is now used -consistently throughout. - -[kwd] fixed bug in the popThreadName function. the current thread name was -being filled with the wrong value. - -[kwd] added the (deprecated) commands appender_setAppenderFile() and -appender_setSyslogFacility() back to be backwards compatible with the 1.2 -series - -[kwd] increased performance in the log() function (credits to Omner Calhoun) - -[kwd] fixed bug in the log4sh_readProperties() function that broke it under -Solaris (credits to Steve Etchelecu) - -[kwd] begin putting function documentation in the log4sh code as pseudo-XML -like data. next, I wrote an extractor to parse out the XML into a separate -file. that file gets run through an XSLT, and is now inserted as function -documentation into the docbook documentation during build time. - -[kwd] docbook source now split into individual chapter files to support the -dynamic inclusion of the function reference chapter - -[kwd] finished the shelldoc documentation - -[kwd] read through the documentation and made some updates - -[kwd] replaced depraced function calls in the test programs with the current -versions - - -Changes with 1.3.1 - -[kwd] added a __LOG4SH_VERSION variable - -[kwd] implemented a more secure method for using temporary files. if the -TMPDIR variable is set, it is honored. the method is based on info from -http://www.linuxsecurity.com/content/view/115462/151/. - -[kwd] prefixed all the new array functions with _log4sh. didn't think about it -for the last release. oops. - -[kwd] replaced many 'awk' statements with 'cut' statements. resulted in about -10% faster performance while testing with the test-log4sh unit test script. - -[kwd] added a TRACE debug level. log4j-1.2.12 added this, so I did too. -actually, just renamed my ALL debug level to TRACE, so nothing *really* -changed. - -[kwd] renamed the file, smtp, and syslog functions to make future fuction -additions easier - -[kwd] reordered and regrouped the functions according to what they are for - -[kwd] stripped the setting and unsetting of temporary variables from many -functions where they are simple enough to be understand without them - -[kwd] abstracted several array gets into functions to allow for future -underlying array implementation changes - -[kwd] replaced nearly all usages of the old array system with the new system - -[kwd] fixed *many* reported bugs (credits to Omner Calhoun) - -[kwd] the various logging commands now support multiple arguments (very much -like the echo command). as a result, the input no longer needs to be -surrounded by quotes. (credits to Omner Calhoun) - -[kwd] realized that while internally, practically all of the get* functions use -index numbers, there is the need to use the appender name as well. added a -appender_syslog_getFacilityByName function (as an example) and renamed the old -function to appender_syslog_getFacilityByIndex. must continue this work in the -future. - -[kwd] begin implementing a type of documentation in the code... will extract -the documentation at build time from the code which will be used to build API -documentation. wrote a extractDocs.pl script to do the documentation -extraction. it's written in perl, I know, but log4sh is still in shell! - -[kwd] changed the functionality of the code in several places so that internal -shell commands are used instead of forking off an external command. (credits -to Omner Calhoun) - -[kwd] I'm sure there are others that were forgotten - - -Changes with 1.3.0 - -[kwd] implemented a Syslog appender for logging via syslog by using the logger -command. currently limited to the localhost - -[kwd] ported the new {get|push|pop}ThreadName functions from 1.2.7 - -[kwd] implemented a SMTP appender. the appender is still in development. -(credits to Mickael Canevet) - -[kwd] implemented a new way to handle the string arrays. the old method worked -just fine, except for when the data contained space characters. this new -method handles spaces as well (which are needed for the SMTP appender -subjects). - - -$Revision$ diff --git a/1.3/doc/LGPL-2.1 b/1.3/doc/LGPL-2.1 deleted file mode 100644 index b1e3f5a..0000000 --- a/1.3/doc/LGPL-2.1 +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/1.3/doc/README.txt b/1.3/doc/README.txt deleted file mode 100644 index 2417538..0000000 --- a/1.3/doc/README.txt +++ /dev/null @@ -1,172 +0,0 @@ -#------------------------------------------------------------------------------ -# SourceForge -# - -This project is stored on SourceForge as http://sf.net/projects/log4sh. The -source code can be accessed using the following information. - -* Subversion -$ svn co https://log4sh.svn.sourceforge.net/svnroot/log4sh/trunk log4sh - -Subversion may also be browsed via a web browser at -http://svn.sourceforge.net/log4sh - -#------------------------------------------------------------------------------ -# Making a release -# - -For these steps, it is assumed we are working with release 1.3.6. - -Steps: -* run the unit tests -* write release notes -* update version -* finish changelog -* check all the code in -* tag the release -* export the release -* create tarball -* md5sum the tarball -* update website -* post to SourceForge and Freshmeat - -RUN THE UNIT TESTS - -Run make with the 'test-prep' option to create the test/ directory. Change -there and run the tests. Record the output into the -website/testresults// directory so that they can be posted to the -website. Repeate this for each of the supported OSes. - -$ make test-prep -... -$ cd test -$ ./run-test-suite 2>&1 |tee .../testresults/1.3.7/Linux-Ubuntu_Edgy-6.10.txt -... - -WRITE RELEASE NOTES - -Again, pretty self explainatory. Use one of the release notes from a previous -release as an example. - -To get the versions of the various shells, do the following: -Cygwin - bash: $ bash --version - ksh: actually pdksh - pdksh: look in the downloaded Cygwin directory -Linux - bash: $ bash --version - dash: look at installed version - ksh: $ ksh --version - pdksh: $ strings /bin/pdksh |grep 'PD KSH' - zsh: $ zsh --version -Solaris 10 - sh: not possible - bash: $ bash --version - ksh: $ strings /usr/bin/ksh |grep 'Version' - -UPDATE VERSION - -Edit the log4sh source code, and change the version number in the comment, as -well as in the __LOG4SH_VERSION variable. Next, edit the src/docbook/log4sh.xml -file, edit the version in the element, and make sure there is a -revision section for this release. - -FINISH DOCUMENTATION - -Make sure that any remaning changes get put into the CHANGES.txt file. - -Finish writing the RELEASE_NOTES.txt. Once it is finished, run it through the -'fmt' command to make it pretty. - -$ fmt -w 80 RELEASE_NOTES-1.3.6.txt >RELEASE_NOTES-1.3.6.txt.new -$ mv RELEASE_NOTES-1.3.6.txt.new RELEASE_NOTES-1.3.6.txt - -We want to have an up-to-date version of the documentation in the release, so -we'd better build it. - -$ pwd -.../log4sh/source/1.3 -$ make docs -... -$ cp -p build/log4sh.html doc -$ svn ci -m "" doc/log4sh.html - -CHECK IN ALL THE CODE - -This step is pretty self-explainatory - -TAG THE RELEASE - -$ pwd -.../log4sh/source -$ ls -1.2 1.3 -$ svn cp -m "Release 1.3.6" \ -1.3 https://log4sh.svn.sourceforge.net/svnroot/log4sh/tags/source/1.3.6 - -EXPORT THE RELEASE - -$ pwd -.../log4sh/builds -$ svn export \ -https://svn.sourceforge.net/svnroot/log4sh/tags/source/1.3.6 log4sh-1.3.6 - -CREATE TARBALL - -$ tar cfz ../releases/log4sh-1.3.6.tgz log4sh-1.3.6 - -MD5SUM THE TARBALL - -$ cd ../releases -$ md5sum log4sh-1.3.6.tgz >log4sh-1.3.6.tgz.md5 - -UPDATE WEBSITE - -Again, pretty self-explainatory. - -Once that is done, make sure to tag the website so we can go back in time if -needed. - -$ pwd -.../log4sh -$ ls -source website -$ svn cp -m "Release 1.3.7" \ -website https://log4sh.svn.sourceforge.net/svnroot/log4sh/tags/website/20060916 - -Now, copy the website into place - -$ rsync -aP --delete --exclude '.svn' website/ sf.net:www/projects/log4sh - -POST TO SOURCEFORGE AND FRESHMEAT - -http://sourceforge.net/projects/log4sh/ -http://freshmeat.net/ - -#------------------------------------------------------------------------------ -# Testing a release -# - -To test a release, shUnit unit tests are included. Prepare the test -environment, and then you can run the tests. Hopefully all of the tests will -pass with a 100% success rate. - -$ make test-prep -$ cd test -$ ./run-test-suite - -#------------------------------------------------------------------------------ -# Related documentation -# - -JUnit - http://www.junit.org -log4j - http://logging.apache.org -Introduction to the Syslog Protocol - http://www.monitorware.com/Common/en/Articles/syslog-described.php -The BSD syslog Protocol - http://www.ietf.org/rfc/rfc3164.txt - - -$Revision$ diff --git a/1.3/doc/RELEASE_NOTES-1.3.6.txt b/1.3/doc/RELEASE_NOTES-1.3.6.txt deleted file mode 100644 index d075ec7..0000000 --- a/1.3/doc/RELEASE_NOTES-1.3.6.txt +++ /dev/null @@ -1,120 +0,0 @@ -RELEASE NOTES FOR 1.3.6 - -The previous release was somewhat of a brown-bag release. Running log4sh -through the unit tests provided (something that was completely new for -the 1.3.5 release) indicated that it worked great under Linux with Bash -and under Solaris with the standard Bourne shell. Unfortunately, it was -not tested under ksh for either Linux or Solaris. After testing with ksh -was done, it was discovered that many of the new internal changes did not -work whatsoever with ksh, and were often times causing segmentation faults, -something quite uncommon with a shell script. - -This release is meant to fix the problems with the last release. log4sh has -been fixed to work with the unit tests, and the unit tests themselves have -been cleaned up and the sub-shells removed as log4sh now supports having -its configuration reset programmatically. - -TESTED PLATFORMS - -Cygwin – bash 3.1.17(6); pdksh 5.2.4 - -Linux – bash 3.00.16(1), 3.1.17(1); ksh 1993-12-28 - -Solaris 10 U2 – /bin/sh; bash 3.00.16(1); ksh M-11/16/88i - -NEW FEATURES - -A log4sh_doConfigure() function was added. (Actually, the -log4shReadProperties() function was renamed). This function can be used to read -a configuration file at runtime. It does *not* reset the current configuration, -so one must first call the log4sh_resetConfiguration() function to do that. - -A log4sh_resetConfiguration() function was added. This function will completely -reset the configuration of log4sh to an clean state. No appenders are defined, -and logging statements will have absolutely no effect. - -A appender_activateOptoins() function was added. This was done to closer -duplicate the functionality of log4j. This function can be optionally -called to activate an appender after any changes have been made to it -programmatically. This function call will be required in a future release -of log4sh. - -An additional internal log4sh debug variable can be set so that all log4sh -debug output will be written to a file. If the LOG4SH_DEBUG_FILE variable is -set, the internal log4sh debug output will be written to that file instead -of STDERR (assuming of course one of the other log4sh internal debugging -variables has been defined – see the Changes and Enhancements). - -A appender_file_setMaxBackupIndex() stub function was added. - -CHANGES AND ENHANCEMENTS - -As of this release, all source code is now stored under Subversion rather -than CVS. - -Continued cleanup of the code. As with the previous releases, even more -variables are accessed using the ${varname} format rather than just -$varname. More internal variables are being renamed to prevent variable -name clashes. Variables cannot be declared local under Bourne shell which -results in all variables local to a function being inherently global in -scope. Variable clashes ensue. - -The internal log4sh debugging has been reworked. If one of the following -environment variables is set at the time log4sh is sourced, log4sh will be -put into the appropriate debugging mode. The variables are LOG4SH_TRACE, -LOG4SH_DEBUG, and LOG4SH_INFO. Any non-empty string value will enable the -appropriate debugging level. Internally, putting log4sh into debugging mode -now handles the output centrally (which can easily be changed) so that log4sh -debugging statements are shorter and cleaner. - -The _log4sh_mktempDir() function was cleaned up a tiny bit to make it easier -to cut-and-paste this nice function to other shell scripts. - -The _log4sh_level2tag() and _log4sh_tag2level() functions were renamed to -_logger_level_toInt() and _logger_level_toLevel() respectively to better -match the log4j method names. - -The appender_syslog_getFacilityByIndex() and -appender_syslog_getFacilityByName() functions were removed as they should -never have been present. - -Many of the functions were rearranged to bring common functions closer -together in the code base. - -The PatternLayout '%r' conversion character now works properly under all -shells. - -Unit tests are now used to verify correct functionality on all platforms. - -DEPRECATED FEATURES - -The log4sh_readProperties() function was deprecated. It was renamed to -log4sh_doConfigure() to better match the log4j method names. - -The logger_addAppenderWithPattern() function was deprecated. It is not -present in log4j, and was only a helper function. - -BUG FIXES - -The trap restoring code did not work properly as a regex was poorly -written. Any traps set before log4sh is sourced should now properly be called. - -The 1.3.5 release did not work at all with ksh. This has been fixed. It now -passes all unit tests. - -The 1.3.5 release hardly worked under Cygwin. This has been fixed. It now -passes all unit tests. - -The trap handling was changed slightly to work better under Cygwin. - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris shell [/bin/sh] or under Cygwin with ksh [/bin/ksh]. - -The RollingFileAppender and DailyRollingFileAppender appenders do not roll -their files. - -Trap handling is not yet 100% fool-proof. - -Performance is prohibitively slow under Cygwin diff --git a/1.3/doc/RELEASE_NOTES-1.3.7.txt b/1.3/doc/RELEASE_NOTES-1.3.7.txt deleted file mode 100644 index 063d2cf..0000000 --- a/1.3/doc/RELEASE_NOTES-1.3.7.txt +++ /dev/null @@ -1,100 +0,0 @@ -RELEASE NOTES FOR 1.3.7 - -This release of log4sh continues to fill out the planned functionality of the -1.3 series. It adds some more unit tests, as well as fixes some bugs reported -by users. - - -TESTED PLATFORMS - -Cygwin -+ bash 3.2.9(10) -+ pdksh 5.2.14 - -Linux -+ bash 3.1.17(1) -+ dash 0.5.3 -+ ksh 1993-12-28 -+ pdksh 5.2.14 -+ zsh 4.3.2 (does not work) - -Solaris 8 U3 (x86) -+ /bin/sh -+ bash 2.03.0(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (sparc) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (x86) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - - -NEW FEATURES - -Added dash to the list of supported shells. - -Logging to remote hosts via syslog now supported. This requires setting 'nc' -alternative command to point to nc (netcat) as the command is not present by -default on most systems. - -The RollingFileAppender now works properly. Files are rotated based upon a -maximum file size, and the number of backup files can be limited with a maximum -backup index. - - -CHANGES AND ENHANCEMENTS - -There seems to be slowly growing interest in log4sh, so the time has come to -start tracking some bugs more officially in the bug tracking of SourceForge. -The few bugs that were reported for this release have been entered into the -tracking system for the sake of posterity. - -Additional unit tests: -+ testMultipleAppenders -+ testSyslogAppender - - -BUG FIXES - -There were some small bugs reported by users with the SMTPAppender and -SyslogAppender that were fixed. - -There were as well a tiny issue with the dash shell that required some source -rearrangement. The dash shell also did not like the dummy functions used in -shUnit, so they had to be slightly altered. - -The subject was not being set properly in the SMTPAppender. - -The pdksh shell now works properly. - -Bug# 1611574 -- 'unbound variable' error - -Bug# 1614338 -- SyslogAppender not logging - - -DEPRECATED FEATURES - -The logger_pushThreadName() and logger_popThreadName() functions have been -deprecated. They are not part of the standard log4j, and their usefulness is -quite limited seeing as shell does not support threads. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.3/doc/RELEASE_NOTES-1.4.0.txt b/1.3/doc/RELEASE_NOTES-1.4.0.txt deleted file mode 100644 index 759149e..0000000 --- a/1.3/doc/RELEASE_NOTES-1.4.0.txt +++ /dev/null @@ -1,79 +0,0 @@ -RELEASE NOTES FOR 1.4.0 - -This release of log4sh fixes some bugs that were reported by users. There is no new functionality included. - - -TESTED PLATFORMS - -Cygwin -? bash 3.2.9(10) -? pdksh 5.2.14 - -Linux -? bash 3.1.17(1) -? dash 0.5.3 -? ksh 1993-12-28 -? pdksh 5.2.14 -? zsh 4.3.2 (does not work) - -Mac OS X 1.4.8 (Darwin 8.8) -+ bash 2.05b.0(1) -+ ksh 1993-12-28 - -Solaris 8 U3 (x86) -? /bin/sh -? bash 2.03.0(1) -? ksh M-11/16/88i - -Solaris 10 U2 (sparc) -? /bin/sh -? bash 3.00.16(1) -? ksh M-11/16/88i - -Solaris 10 U2 (x86) -? /bin/sh -? bash 3.00.16(1) -? ksh M-11/16/88i - - -NEW FEATURES - -The 'mail' command can now be configured as an alternative command using -log4sh_setAlternative(). - - -CHANGES AND ENHANCEMENTS - -The log4sh_doConfigure() function now calls log4sh_resetConfiguration() before -loading a new configuration. - -Additional unit tests: -+ testSMTPAppender - - -BUG FIXES - -Alternative commands configured in a config file caused errors when read. - -The SMTPAppender did not send mail properly when the Subject contained spaces. - - -DEPRECATED FEATURES - -None. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.3/doc/TODO.txt b/1.3/doc/TODO.txt deleted file mode 100644 index f0882a3..0000000 --- a/1.3/doc/TODO.txt +++ /dev/null @@ -1,68 +0,0 @@ -# $Id$ - -- document the SMTPAppender - -- implement line number conversion character (where possible) - -- look into traps. exit codes seem to be lost - -- enable passing the configuration filename on the source line instead of - requiring the LOG4SH_CONFIGURATION variable - -- DatedFileAppender -DatedFileAppender works in the same manner as the Tomcat FileLogger. Contrary -to DailyRollingFileAppender shipping with log4j, log file names generated by -DatedFileAppender always contain today's date. While this distinction seems -minor, it means you can reliably copy, compress, remove or manipulate a day's -log file shortly after midnight. With the DailyRollingFileAppender, a day's log -file is not renamed until the first message is logged some time after midnight. - -- the logger command is now wrapped in a ( exec ) wrapper in case it isn't - there. an error should be thrown at least the first time it was attempted to - be used. same goes for mail and trap. - -- implement file descriptor functions allocFD and freeFD and replace the hard - coded FD usage in the log4sh_readProperties and _appender_source functions - -- validate that the return_test shell test works under cygwin and solaris. if - so, remove the "unset" stuff before returns as they aren't needed - -- make logger level's case insensitive?? - -- add more error checking on the appender_*set* functions. see smtp_setSubject - -- try a `wc -l` in the _log4sh_getArrayLength function - -- resolve absolute filename -D=`dirname "$relpath"` -B=`basename "$relpath"` -abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B" - -- swap stdout and stderr -cmd 3>&1 1>&2 2>&3 - -- filter stdout and stderror -( ( cmd | ... process stdout ) 3>&1 1>&2 2>&3 ) | \ - ... process stderr 3>&1 1>&2 2>&3 - -- save stdout, stderr, and both to three files -((./program 2>&1 1>&3 | tee ~/err.txt) 3>&1 1>&2 | tee ~/out.txt) > ~/mix.txt 2>&1 - -- read from tcp port 13 (date/time) -read d < /dev/tcp/127.0.0.1/13 -echo $d - -* python like list indexing (see p31 in _Dive Into Python_) ->>> li -['a', 'b', 'new', 'mpilgrim', 'z', 'example', 'new', 'two', 'elements'] ->>> li.index("example") -5 ->>> li.index("new") -2 ->>> li.index("c") -x not in list ->>> "c" in li -False - -- research fanout - writing to multiple locations -http://linuxgazette.net/122/TWDT.html#smith diff --git a/1.3/doc/contributors.txt b/1.3/doc/contributors.txt deleted file mode 100644 index 1320a0f..0000000 --- a/1.3/doc/contributors.txt +++ /dev/null @@ -1,13 +0,0 @@ -The following people have contributed in some way or another to log4sh. - -Aaron Rodden -Aaron Walker -Dan Johansson -Kate Ward -Mickaël Canévet -Omner Calhoun -Rob Holland -Steve Etchelecu -Tim Kordick - -$Revision$ diff --git a/1.3/doc/log4sh.html b/1.3/doc/log4sh.html deleted file mode 100644 index 5762582..0000000 --- a/1.3/doc/log4sh.html +++ /dev/null @@ -1,771 +0,0 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>log4sh

log4sh version 1.3.7

Kate Ward


-            
-          

2007-01-01

Revision History
Revision 1.3.72006-12-28kwd
Revision 1.3.62006-09-16kwd
Revision 1.3.52006-08-19kwd
Revision 1.3.42006-03-25kwd
Revision 1.3.32006-02-11kwd
Revision 1.3.22006-01-18kwd
Revision 1.3.02005-08-15kwd
Revision 1.2.62005-02-01kwd
Revision 1.2.42004-12-28kwd

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


Chapter 1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used.

Tested Operating Systems

  • Cygwin

  • Linux

  • Solaris 8+

Verified Shells

  • BSD Shell (dash)

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

  • Korn Shell (ksh)

  • Public Domain Korn Shell (pdksh) -- partial functionality

See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested.

1. Credits / Contributors

A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool.

2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

Chapter 2. Quickstart

First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests.

Prepare your environment.

-$ make test-prep
-$ cd test
-

Example 2.1. Hello, World!

Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts.

Run the Hello World test.

-$ ./hello_world
-1 [main] INFO shell  - Hello, world!
-

You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not!

The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from ERROR to INFO, and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh.


Example 2.2. Properties Configuration Test

In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code.

Run the properties configuration test.

-$ ./test-prop-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code.


Example 2.3. Runtime Configuration Test

This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime.

Run the runtime configuration test.

-$ ./test-runtime-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed.


Chapter 3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code into the shell script

  3. configure log4sh in code (optional)

  4. call logging statements

-

1. Preconfigure log4sh (optional)

To preconfigure log4sh, create a properties file (see the Properties File later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the Configure log4sh in code section later in this chapter.

2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 3.1. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 3.2. Hello, world (using properties file)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 3.3. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to INFO and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

3. Configure log4sh in code

If log4sh was not preconfigured, the default configuration will be equivalent the config shown below.

Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'.

-log4sh.rootLogger=ERROR, stdout
-log4sh.appender.stdout=ConsoleAppender
-log4sh.appender.stdout.layout=PatternLayout
-log4sh.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 3.4. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set the global logging level to INFO
-logger_setLevel INFO
-
-# add and configure a FileAppender that outputs to STDERR, and activate the
-# configuration
-logger_addAppender stderr
-appender_setType stderr FileAppender
-appender_file_setFile stderr STDERR
-appender_activateOptions stderr
-
-# say Hello to the world
-logger_info 'Hello, world'
-

4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter.

Example 3.5. Standard method of logging a message

logger_info 'message to log'

There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info).

Example 3.6. Alternate method of logging a message

echo 'message to log' |logger_info

Chapter 4. Configuration

1. Properties File

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 4.1. Recommended minimum log4sh.properties file

-  log4sh.rootLogger=INFO, stdout
-  log4sh.appender.stdout=ConsoleAppender
-  

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

1.1. Root Logger

(future)

1.2. Levels

Table 4.1. Logging Levels (from most output to least)

LevelDefinition
TRACEThe TRACE level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

1.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 4.2. Sample appender names

myAppender - good


1.3.1. Types

An appender can be set to one of several different types.

Example 4.3. Setting an appender type

-    log4sh.appender.A1=FileAppender
-    

Table 4.2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial; logs written, but not rotated
RollingFileAppenderoutput sent to a file that rolls over by sizepartial; works, but nees improvement
SMTPAppenderoutput sent via emailparital; works, but needs improvement
SyslogAppenderoutput sent to a remote syslog daemonpartial; only localhost supported

1.3.2. Options

An appender can take several different options.

Example 4.4. Setting an appender option

-    log4sh.appender.A1.File=output.log
-    

Table 4.3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

1.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 4.5. Setting an appender's layout

-    log4sh.appender.A1.layout=PatternLayout
-    

Table 4.4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 4.6. Setting an appender's layout pattern

-    log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-    

Table 4.5. Pattern Options

OptionDefinitionSupported?
cUsed to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'.partial (fixed)
d -

Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, %d{HH:mm:ss,SSS}, or %d{ISODATE}. The specifier is allowed only for compatibility with log4j properties files.

-

The default format of the date returned is equavilant to the output of the Unix date command with a format of +%Y-%m-%d %H:%M:%S.

-
yes
F -

Used to output the file name where the logging request was issued.

-

The default value is equavilent basename $0.

-
yes
LThis option is for compatibility with log4j properties files.no (ignored)
mUsed to output the script supplied message associated with the logging event.yes
nThis option is for compatibility with log4j properties files.no (ignored)
pUsed to output the priority of the logging event.yes
rUsed to output the number of seconds elapsed since the start of the script until the creation of the logging event.yes
t -

Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i

-

The default value is 'main'.

-
yes
xThis option is for compatibility with log4j properties files.no (ignored)
XUsed to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The X conversion character must be followed by an environment variable name placed between braces, as in %X{clientNumber} where clientNumber is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output.no (ignored)
%The sequence %% outputs a single percent sign.yes

2. Environment Variables

There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh.

Here is the full list of supported variables.

Table 4.6. log4sh environment variables

VariableUsage
LOG4SH_CONFIGURATION -

This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration.

-

Example 4.7. LOG4SH_CONFIGURATION variable

LOG4SH_CONFIGURATION='/path/to/log4j.properties'

-
LOG4SH_CONFIG_PREFIX -

This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read.

-

Example 4.8. LOG4SH_CONFIG_PREFIX variable

LOG4SH_CONFIG_PREFIX='log4j'

-

Chapter 5. Advanced Usage

This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood.

1. Environment Variables

There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below.

Table 5.1. log4sh Environment Variables

VariableDefaultDescription
LOG4SH_ALTERNATIVE_NCnoneProvide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc
LOG4SH_CONFIGURATIONnoneProvide log4sh with the absolute path to the log4sh properties file.
LOG4SH_CONFIG_PREFIXlog4shDefine the expected prefix to use for parsing the properties file -- e.g. log4j
LOG4SH_DEBUGnoneEnable internal log4sh debug output. Set to any non-empty value.
LOG4SH_DEBUG_FILEnoneDefine a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log
LOG4SH_INFOnoneEnable internal log4sh info output. Set to any non-empty value.
LOG4SH_TRACEnoneEnable internal log4sh trace output. Set to any non-empty value.

2. Remote Syslog Logging

Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts.

Choice #1 -- reconfigure the syslogd daemon

One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required.

Choice #2 -- install nc (netcat) command -- recommended

The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect.

The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging.

Example 5.1. Sample log4sh properties file demonstrating remote syslog logging

-#
-# log4sh example: remote syslog logging
-#
-
-# Set the 'nc' alternative command to enable remote syslog logging
-log4sh.alternative.nc = /bin/nc
-
- Set root logger level to INFO and its only appender to mySyslog
-log4sh.rootLogger=INFO, mySyslog
-
-# mySyslog is set to be a SyslogAppender.
-log4sh.appender.mySyslog = SyslogAppender
-log4sh.appender.mySyslog.SyslogHost = somehost
-

Example 5.2. Sample shell script demonstrating remote syslog logging

-#! /bin/sh
-#
-# log4sh example: remote syslog logging
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set alternative 'nc' command
-log4sh_setAlternative nc /bin/nc
-
-# add and configure a SyslogAppender that logs to a remote host
-logger_addAppender mySyslog
-appender_setType mySyslog SyslogAppender
-appender_syslog_setFacility mySyslog local4
-appender_syslog_setHost mySyslog somehost
-appender_activateOptions mySyslog
-
-# say Hello to the world
-logger_info 'Hello, world'
-

3. Automated File Rolling

Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your FileAppender into a RollingFileAppender, you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept.

To limit the maximum size of your log files, you need to set the MaxFileSize appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not.

The default maximum file size is equavilent to 1MiB

Table 5.2. Acceptable file size units

UnitSize in bytesEquivalent sizes
B (bytes)11B
KB1,0001KB = 1000B
KiB (kilobytes)1,0241KiB = 1024B
MB1,000,0001MB = 1000KB = 1000000B
MiB (megabytes)1,048,5761MiB = 1024KiB = 1048576B
GB1,000,000,0001GB = 1000MB = 1000000KB = 1000000000B
GiB (gigabytes)1,073,741,8241GiB = 1024MiB = 1048576KiB = 1073741824B
TB1,000,000,000,0001TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B
TiB (terabytes)1,099,511,627,7761TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B

Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j.

To limit the maximum number of backup files kept, you need to set the MaxBackupIndex appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept.

The default maximum backup index is equavilent to '1 MiB'

Example 5.3. Sample log4sh properties file demonstrating a RollingFileAppender

-#
-# log4sh example: using the RollingFileAppender
-#
-
- Set root logger level to INFO and its only appender to R
-log4sh.rootLogger=INFO, R
-
-# add a RollingFileAppender named R
-log4sh.appender.R = RollingFileAppender
-log4sh.appender.R.File = /path/to/some/file
-log4sh.appender.R.MaxFileSize = 10KB
-log4sh.appender.R.MaxBackupIndex = 1
-

Example 5.4. Sample shell script demonstrating a RollingFileAppender

-#! /bin/sh
-#
-# log4sh example: using the RollingFileAppender
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# add and configure a RollingFileAppender named R
-logger_addAppender R
-appender_setType R RollingFileAppender
-appender_file_setFile R '/path/to/some/file'
-appender_file_setMaxFileSize R 10KB
-appender_file_setMaxBackupIndex R 1
-appender_activateOptions R
-
-# say Hello to the world
-logger_info 'Hello, world'
-

Chapter 6. Function Reference

1. Appender

Table 6.1. Appender

- void - -
- appender_activateOptions - (appender); 
string  appender;
-

- Activate an appender's configuration. This should be called after - reconfiguring an appender via code. It needs only to be called once - before any logging statements are called. This calling of this function - will be required in log4sh 1.4.x. -

-
appender_activateAppender myAppender
-
- void - -
- appender_close - (appender); 
string  appender;
-

Disable any further logging via an appender. Once closed, the - appender can be reopened by setting it to any logging Level (e.g. - INFO).

-
appender_close myAppender
-
- boolean - -
- appender_exists - (appender); 
string  appender;
-

Checks for the existance of a named appender

-
exists=`appender_exists myAppender`
-
- string - -
- appender_getAppenderType - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Gets the Type of an Appender at the given array index -

-
type=`appender_getAppenderType 3`
-
- string - -
- appender_getLayout - (appender); 
string  appender;
-

Gets the Layout of an Appender

-
type=`appender_getLayout myAppender`
-
- string - -
- appender_getLevel - (appender); 
string  appender;
-

Gets the current logging Level of an Appender

-
type=`appender_getLevel myAppender`
-
- string - -
- appender_getPattern - (appender); 
string  appender;
-

Gets the Pattern of an Appender

-
pattern=`appender_getPattern myAppender`
-
- string - -
- appender_getType - (appender); 
string  appender;
-

Gets the Type of an Appender

-
type=`appender_getType myAppender`
-
- void - -
- appender_setAppenderType - (appender,  
 type); 
string  appender;
string  type;
-

- Deprecated as of 1.3.1 -

-

- Sets the Type of an Appender (e.g. FileAppender) -

-
appender_setAppenderType myAppender FileAppender
-
- void - -
- appender_setLayout - (appender,  
 layout); 
string  appender;
string  layout;
-

Sets the Layout of an Appender (e.g. PatternLayout)

-
appender_setLayout myAppender PatternLayout
-
void/boolean -
- appender_setLevel - (appender,  
 level); 
string  appender;
string  level;
-

Sets the Level of an Appender (e.g. INFO)

-
appender_setLevel myAppender INFO
-
void/boolean -
- appender_setPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

Sets the Pattern of an Appender

-
appender_setPattern myAppender '%d %p - %m%n'
-
void/boolean -
- appender_setType - (appender,  
 type); 
string  appender;
string  type;
-

Sets the Type of an Appender (e.g. FileAppender)

-
appender_setType myAppender FileAppender
-

2. FileAppender

Table 6.2. FileAppender

- string - -
- appender_file_getFile - (appender); 
string  appender;
-

Get the filename of a FileAppender

-
appender_file_getFile myAppender
-
integer/boolean - -
- appender_file_getMaxBackupIndex - (appender); 
string  appender;
-

- Returns the value of the MaxBackupIndex option. -

-

Since: 1.3.7

-
appender_file_getMaxBackupIndex myAppender
-
integer/boolean - -
- appender_file_getMaxFileSize - (appender); 
string  appender;
-

- Get the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

Since: 1.3.7

-
maxSize=`appender_file_getMaxBackupSize myAppender`
-
- void - -
- appender_file_setFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Set the filename for a FileAppender (e.g. STDERR or - /var/log/log4sh.log). -

-
appender_file_setFile myAppender STDERR
-
- void - -
- appender_file_setMaxBackupIndex - (appender,  
 index); 
string  appender;
integer  index;
-

Set the maximum number of backup files to keep around.

-

- The MaxBackupIndex option determines - how many backup files are kept before the oldest is erased. This option - takes a positive integer value. If set to zero, then there will be no - backup files and the log file will be truncated when it reaches - MaxFileSize. -

-

Since: 1.3.7

-
appender_file_setMaxBackupIndex myAppender 3
-
void/boolean - -
- appender_file_setMaxFileSize - (appender,  
 size); 
string  appender;
string  size;
-

- Set the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

- In configuration files, the MaxFileSize option takes an - long integer in the range 0 - 2^40. You can specify the value with the - suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. For example, - the value "10KiB" will be interpreted as 10240. -

-

Since: 1.3.7

-
appender_file_setMaxBackupSize myAppender 10KiB
-
- void - -
- appender_setAppenderFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Deprecated as of 1.3.2 -

-

- Set the filename for a FileAppender (e.g. "STDERR" or - "/var/log/log4sh.log") -

-
appender_setAppenderFile myAppender STDERR
-

3. Level

Table 6.3. Level

- integer - -
- logger_level_toInt - (level); 
string  level;
-

Converts an externally used level tag into its integer - equivalent

-
levelInt=`logger_level_toInt WARN`
-
- string - -
- logger_level_toLevel - (val); 
integer  val;
-

Converts an internally used level integer into its external level - equivalent

-
level=`logger_level_toLevel 3`
-

4. Log4sh

Table 6.4. Log4sh

void/boolean - -
- log4sh_enableStrictBehavior - (); 
-

- Enables strict log4j behavior. -

-

Since: 1.3.7

-
log4sh_enableStrictBehavior
-
void/boolean - -
- log4sh_setAlternative - (command,  
 path); 
string  command;
string  path;
-

- Specifies an alternative path for a command. -

-

Since: 1.3.7

-
log4sh_setAlternative nc /bin/nc
-

5. Logger

Table 6.5. Logger

- void - -
- log - (level,  
 message(s)); 
string  level;
string[]  message(s);
-

The base logging command that logs a message to all defined - appenders

-
log DEBUG 'This is a test message'
-
void/boolean -
- logger_addAppender - (appender); 
string  appender;
-

Add and initialize a new appender

-
logger_addAppender $appender
-
- void - -
- logger_addAppenderWithPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

- Deprecated as of 1.3.6 -

-

- Add and initialize a new appender with a specific PatternLayout -

-
logger_addAppenderWithPattern $appender '%d %p - %m%n'
-
- void - -
- logger_debug - (message); 
string[]  message;
-

This is a helper function for logging a message at the DEBUG - priority

-
logger_debug 'This is a debug message'
-
- void - -
- logger_error - (message); 
string[]  message;
-

- This is a helper function for logging a message at the ERROR priority -

-
logger_error 'This is a error message'
-
- void - -
- logger_fatal - (message); 
string[]  message;
-

This is a helper function for logging a message at the FATAL - priority

-
logger_fatal 'This is a fatal message'
-
- string - -
- logger_getFilename - (); 
-

- Get the filename that would be shown when the '%F' conversion character - is used in a PatternLayout. -

-
filename=`logger_getFilename`
-
- string - -
- logger_getLevel - (); 
-

Get the global default logging level (e.g. DEBUG).

-
level=`logger_getLevel`
-
- void - -
- logger_info - (message); 
string[]  message;
-

This is a helper function for logging a message at the INFO - priority

-
logger_info 'This is a info message'
-
- void - -
- logger_setFilename - (filename); 
string  filename;
-

Set the filename to be shown when the '%F' conversion character is - used in a PatternLayout.

-
logger_setFilename 'myScript.sh'
-
- void - -
- logger_setLevel - (level); 
string  level;
-

Sets the global default logging level (e.g. DEBUG).

-
logger_setLevel INFO
-
- void - -
- logger_trace - (message); 
string[]  message;
-

This is a helper function for logging a message at the TRACE - priority

-
logger_trace 'This is a trace message'
-
- void - -
- logger_warn - (message); 
string[]  message;
-

- This is a helper function for logging a message at the WARN priority -

-
logger_warn 'This is a warn message'
-

6. Property

Table 6.6. Property

- void - -
- log4sh_doConfigure - (configFileName); 
string  configFileName;
-

- Read configuration from a file. The existing - configuration is not cleared or reset. If you require a - different behavior, then call the log4sh_resetConfiguration - before calling log4sh_doConfigure. -

-
log4sh_doConfigure myconfig.properties
-
- void - -
- log4sh_readProperties - (configFileName); 
string  configFileName;
-

- Deprecated as of 1.3.6 -

-

- See log4sh_doConfigure. -

-
log4sh_readProperties myconfig.properties
-
- void - -
- log4sh_resetConfiguration - (); 
-

- This function completely resets the log4sh configuration to have no - appenders with a global logging level of ERROR. -

-
log4sh_resetConfiguration
-

7. SMTPAppender

Table 6.7. SMTPAppender

- void - -
- appender_setAppenderRecipient - (appender,  
 email); 
string  appender;
string  email;
-

- Deprecated as of 1.3.1 -

-

- Set the to address for the given appender -

-
appender_smtp_setTo myAppender user@example.com
-
- void/boolean - -
- appender_setAppenderSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

- Deprecated as of 1.3.1 -

-

- Sets the email subject for an SMTP appender -

-
appender_setAppenderSubject myAppender "This is a test"
-
- string - -
- appender_smtp_getSubject - (appender); 
string  appender;
-

Get the email subject for the given appender

-
subject=`appender_smtp_getSubject myAppender`
-
- string - -
- appender_smtp_getTo - (appender); 
string  appender;
-

Get the to address for the given appender

-
email=`appender_smtp_getTo myAppender`
-
- void/boolean - -
- appender_smtp_setSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

Sets the email subject for an SMTP appender

-
appender_smtp_setSubject myAppender "This is a test"
-
- void - -
- appender_smtp_setTo - (appender,  
 email); 
string  appender;
string  email;
-

Set the to address for the given appender

-
appender_smtp_setTo myAppender user@example.com
-

8. SyslogAppender

Table 6.8. SyslogAppender

- string - -
- appender_getSyslogFacility - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Get the syslog facility of the specified appender by index -

-
facility=`appender_getSyslogFacility 3`
-
- void - -
- appender_setSyslogFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

- Deprecated as of 1.3.2 -

-

- Set the syslog facility for the given appender -

-
appender_setSyslogFacility myAppender local4`
-
- void - -
- appender_syslog_getFacility - (appender); 
string  appender;
-

- Get the syslog facility for the given appender. -

-
facility=`appender_syslog_getFacility myAppender`
-
string/boolean - -
- appender_syslog_getHost - (index); 
integer  index;
-

- Get the syslog host of the specified appender. -

-

Since: 1.3.7

-
host=`appender_syslog_getHost myAppender`
-
- void - -
- appender_syslog_setFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

Set the syslog facility for the given appender

-
appender_syslog_setFacility myAppender local4`
-
void/boolean - -
- appender_syslog_setHost - (appender,  
 host); 
string  appender;
string  host;
-

- Set the syslog host for the given appender. Requires that the 'nc' - command alternative has been previously set with the - log4sh_setAlternative() function. -

-

Since: 1.3.7

-
appender_syslog_setHost myAppender localhost
-

9. Thread

Table 6.9. Thread

- string - -
- logger_getThreadName - (); 
-

Gets the current thread name.

-
threadName=`logger_getThreadName`
-
- void - -
- logger_popThreadName - (); 
-

- Deprecated as of 1.3.7 -

-

- Removes the topmost thread name from the stack. The next thread name on - the stack is then placed in the __log4sh_threadName - variable. If the stack is empty, or has only one element left, then a - warning is given that no more thread names can be popped from the stack. -

-
logger_popThreadName
-
- void - -
- logger_pushThreadName - (threadName); 
string  threadName;
-

- Deprecated as of 1.3.7 -

-

- Sets the thread name (eg. the name of the script) and pushes the old on - to a stack for later use. This thread name can be used with the '%t' - conversion character within a PatternLayout. -

-
logger_pushThreadName "myThread"
-
- void - -
- logger_setThreadName - (threadName); 
string  threadName;
-

- Sets the thread name (e.g. the name of the script). This thread name can - be used with the '%t' conversion character within a - PatternLayout. -

-
logger_setThreadName "myThread"
-

10. Trap

Table 6.10. Trap

- void - -
- log4sh_cleanup - (); 
-

This is a cleanup function to remove the temporary directory used by - log4sh. It is provided for scripts who want to do log4sh cleanup work - themselves rather than using the automated cleanup of log4sh that is - invoked upon a normal exit of the script.

-
log4sh_cleanup
-

Chapter 7. Conclusion

The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well.

If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at .

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward.

diff --git a/1.3/doc/style.css b/1.3/doc/style.css deleted file mode 100644 index d3b1628..0000000 --- a/1.3/doc/style.css +++ /dev/null @@ -1,40 +0,0 @@ -/* - style.css - a CSS stylesheet for use with HTML output produced by - tldp-xsl stylesheets. Written by David Horton. -*/ - - -body { - -/* - Style the HMTL tag with a sans-serif font and 6% margin. - A sans-serif font makes documents easier to read when displayed on - a computer screen. Whitespace surrounding the document should - make it easier to read both on screen and on printed paper. The - value of 6% was chosen because it closely approximates a one-half - inch margin on a US letter (8.5" by 11") paper. Since the margin - is expressed as a percentage it should scale well in a web browser - window. -*/ - - font-family: sans-serif; - margin: 6%; -} - - -.programlisting, .screen { - -/* - Style the programlisting and screen classes with a light gray - background and a small bit of space between the object border and - the text inside. The programlisting and screen classes are HTML - representations of the and DocBook tags. -*/ - - background: lightgray; - padding: 5px; -} - - -/* Add any desired customizations below. */ - diff --git a/1.3/lib/shunit/shunit b/1.3/lib/shunit/shunit deleted file mode 100644 index 88cd329..0000000 --- a/1.3/lib/shunit/shunit +++ /dev/null @@ -1,384 +0,0 @@ -# $Id$ -# vim:syntax=sh:sts=2 -# -# shUnit 1.0.2 -# Shell Unit Test Framework -# -# written by Kate Ward -# released under the LGPL -# -# this module implements a unit test framework similar to JUnit -# - -# shell flags for shunit: -# u - treat unset variables as an error when performing parameter expansion -__SHUNIT_SHELL_FLAGS='u' - -# save the current set of shell flags, and then set some for log4sh -__shunit_oldShellFlags="$-" -for _su_shellFlag in `echo "${__SHUNIT_SHELL_FLAGS}" |sed 's/\(.\)/\1 /g'` -do - set -${_su_shellFlag} -done - -# constants - -__SHUNIT_VERSION=1.0.2 - -__SHUNIT_TRUE=0 -__SHUNIT_FALSE=1 - -__SHUNIT_ASSERT_MSG_PREFIX='ASSERT:' - -for _su_const in `set |grep "^__SHUNIT_" |cut -d= -f1`; do - readonly ${_su_const} -done -unset _su_const - -# variables -__shunit_suite='' - -__shunit_testsPassed=0 -__shunit_testsFailed=0 -__shunit_testsTotal=0 - -#------------------------------------------------------------------------------ -# unit test functions -# - -assertEquals() -{ - _su_message='' - if [ $# -eq 3 ]; then - _su_message=$1 - shift - fi - _su_expected=$1 - _su_actual=$2 - - if [ "${_su_expected}" = "${_su_actual}" ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_expected _su_actual -} - -assertNull() -{ - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_value=$1 - - _su_value2=`eval echo "${_su_value}"` - if [ -z "${_su_value2}" ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_value _su_value2 -} - -assertNotNull() -{ - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_value=$1 - - _su_value2=`eval echo "${_su_value}"` - if [ -n "${_su_value2}" ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_value _su_value2 -} - -assertSame() -{ - failNotEquals "$@" -} - -assertNotSame() -{ - assertEquals "$@" -} - -assertTrue() -{ - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_condition=$1 - - ( eval ${_su_condition} ) >/dev/null 2>&1 - if [ $? -eq ${__SHUNIT_TRUE} ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_condition -} - -assertFalse() -{ - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_condition=$1 - - ( eval ${_su_condition} ) >/dev/null 2>&1 - if [ $? -eq ${__SHUNIT_FALSE} ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_condition -} - -fail() -{ - _shunit_testFailed -} - -failNotEquals() -{ - _su_message='' - if [ $# -eq 3 ]; then - _su_message=$1 - shift - fi - _su_expected=$1 - _su_actual=$2 - - if [ "${_su_expected}" != "${_su_actual}" ]; then - _shunit_testPassed - return ${__SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${__SHUNIT_FALSE} - fi - - unset _su_message _su_expected _su_actual -} - -failNotSame() -{ - assertEquals "$@" -} - -failSame() -{ - failNotEquals "$@" -} - -suite_addTest() -{ - _su_func=$1 - - __shunit_suite="${__shunit_suite:+${__shunit_suite} }${_su_func}" - - unset _su_func -} - -#------------------------------------------------------------------------------ -# shUnit functions -# - -_shunit_cleanup() -{ - name=$1 - - case ${name} in - EXIT) signal=0 ;; - INT) signal=2 ;; - TERM) signal=15 ;; - esac - - # do our work - rm -fr "${__shunit_tmpDir}" - - # exit for all non-EXIT signals - if [ ${name} != 'EXIT' ]; then - echo "trapped and now handling the ${name} signal" - _shunit_generateReport - # disable EXIT trap - trap 0 - # add 127 to signal and exit - signal=`expr ${signal} + 127` - exit ${signal} - fi -} - -_shunit_execSuite() -{ - echo '#' - echo '# Performing tests' - echo '#' - for _su_func in ${__shunit_suite}; do - # execute the per-test setup function - setUp - - # execute the test - echo "${_su_func}" - eval ${_su_func} - - # execute the per-test tear-down function - tearDown - done - - unset _su_func -} - -_shunit_functionExists() -{ - _su__func=$1 - type ${_su__func} 2>/dev/null |grep "is a function$" >/dev/null - _su__return=$? - unset _su__func - return ${_su__return} -} - -_shunit_generateReport() -{ - if [ ${__shunit_testsTotal} -gt 0 ]; then - _su__success=`expr ${__shunit_testsPassed} \* 100 / ${__shunit_testsTotal}` - else - _su__success=0 - fi - - cat </dev/null ) && return - - # the standard mktemp didn't work. doing our own. - if [ -n "${RANDOM:-}" ]; then - # $RANDOM works - _su__random=${RANDOM}${RANDOM}${RANDOM}$$ - else - # $RANDOM doesn't work - _su__date=`date '+%Y%m%d%H%M%S'` - _su__random=`expr ${_su__date} / $$` - fi - - _su__tmpDir="${TMPDIR-/tmp}/shunit.${_su__random}" - ( umask 077 && mkdir "${_su__tmpDir}" ) || { - echo 'shUnit:FATAL could not create temporary directory! exiting' >&2 - exit 1 - } - - echo ${_su__tmpDir} - unset _su__date _su__random _su__tmpDir -} - -# this function is here to work around issues in Cygwin -_shunit_mktempFunc() -{ - for _su__func in oneTimeSetUp oneTimeTearDown setUp tearDown suite; do - _su__file="${__shunit_tmpDir}/${_su__func}" - cat <"${_su__file}" -#! /bin/sh -exit 0 -EOF - chmod +x "${_su__file}" - done - - unset _su__file -} - -_shunit_testPassed() -{ - __shunit_testsPassed=`expr ${__shunit_testsPassed} + 1` - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` -} - -_shunit_testFailed() -{ - [ $# -eq 1 ] && _su__msg=$1 - - __shunit_testsFailed=`expr ${__shunit_testsFailed} + 1` - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` - - [ -z "${_su__msg:-}" ] && _su__msg='failed' - echo "${__SHUNIT_ASSERT_MSG_PREFIX} ${_su__msg}" >&2 - unset _su__msg -} - -#------------------------------------------------------------------------------ -# main -# - -# creat temporary storage locatoin -__shunit_tmpDir=`_shunit_mktempDir` - -# setup traps to clean up after ourselves -trap '_shunit_cleanup EXIT' 0 -trap '_shunit_cleanup INT' 2 -trap '_shunit_cleanup TERM' 15 - -# create phantom functions to work around issues with Cygwin -_shunit_mktempFunc -PATH="${__shunit_tmpDir}:${PATH}" - -# execute the oneTimeSetUp function (if it exists) -#_shunit_functionExists oneTimeSetUp && oneTimeSetUp -oneTimeSetUp - -# execute the suite function defined in the parent test script -suite - -# execute the tests -_shunit_execSuite - -# execute the oneTimeTearDown function (if it exists) -oneTimeTearDown - -# generate report -_shunit_generateReport - -# restore the previous set of shell flags -for _shunit_shellFlag in ${__SHUNIT_SHELL_FLAGS}; do - echo ${__shunit_oldShellFlags} |grep ${_shunit_shellFlag} >/dev/null \ - || set +${_shunit_shellFlag} -done -unset _shunit_shellFlag diff --git a/1.3/share/dist/index.txt b/1.3/share/dist/index.txt deleted file mode 100644 index 2a62249..0000000 --- a/1.3/share/dist/index.txt +++ /dev/null @@ -1,10 +0,0 @@ -docbook-xml-4.4.zip - http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip - http://www.oasis-open.org/docbook/xml/4.4/docbook-xml-4.4.zip -docbook-xml-4.5.zip - http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip - -docbook-xsl-1.71.0.tar.bz2 - http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.71.0.tar.bz2?download -docbook-xsl-1.71.1.tar.bz2 - http://downloads.sourceforge.net/docbook/docbook-xsl-1.71.1.tar.bz2?use_mirror=puzzle diff --git a/1.3/share/docbook/Makefile b/1.3/share/docbook/Makefile deleted file mode 100644 index 1a1e77d..0000000 --- a/1.3/share/docbook/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# -# makefile to setup the the docbook support directory -# - -CWD=`pwd` -DIST=$(CWD)/../dist -XML=docbook-xml-4.4.zip -XSLT=docbook-xsl-1.71.1.tar.bz2 - -all: extract-xml extract-xslt - -extract-xml: - if test ! -d xml/4.4; then \ - mkdir -p xml/4.4; \ - unzip -qq $(DIST)/$(XML) -d xml/4.4; \ - fi - -extract-xslt: - if test ! -d docbook-xsl/1.71.1; then \ - mkdir -p docbook-xsl; \ - bzip2 -dc $(DIST)/$(XSLT) |tar xf -; \ - mv docbook-xsl-1.71.1 docbook-xsl/1.71.1; \ - ln -s 1.71.1 docbook-xsl/current; \ - fi - -clean: - rm -fr xml docbook-xsl* diff --git a/1.3/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl b/1.3/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl deleted file mode 100644 index b7a7d43..0000000 --- a/1.3/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - -start - - - - - - - - diff --git a/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl b/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl deleted file mode 100644 index f8cf7b1..0000000 --- a/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -text/css - - - - - - - diff --git a/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl b/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl deleted file mode 100644 index 16994ad..0000000 --- a/1.3/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/1.3/src/docbook/advancedusage.xml b/1.3/src/docbook/advancedusage.xml deleted file mode 100644 index 17d7bd2..0000000 --- a/1.3/src/docbook/advancedusage.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - -Advanced Usage - This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood. - -
Environment Variables - There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below. - - - log4sh Environment Variables - - - - Variable - Default - Description - - - - - LOG4SH_ALTERNATIVE_NC - none - Provide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc - - - LOG4SH_CONFIGURATION - none - Provide log4sh with the absolute path to the log4sh properties file. - - - LOG4SH_CONFIG_PREFIX - - Define the expected prefix to use for parsing the properties file -- e.g. - - - LOG4SH_DEBUG - none - Enable internal log4sh debug output. Set to any non-empty value. - - - LOG4SH_DEBUG_FILE - none - Define a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log - - - LOG4SH_INFO - none - Enable internal log4sh info output. Set to any non-empty value. - - - LOG4SH_TRACE - none - Enable internal log4sh trace output. Set to any non-empty value. - - - -
-
- -
Remote Syslog Logging - Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts. - - Choice #1 -- reconfigure the syslogd daemon - - One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required. - - Choice #2 -- install nc (netcat) command -- recommended - - The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect. - - The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging. - - Sample log4sh properties file demonstrating remote syslog logging - - - - Sample shell script demonstrating remote syslog logging - - -
- -
- Automated File Rolling - - Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your into a , you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept. - - To limit the maximum size of your log files, you need to set the appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not. - - The default maximum file size is equavilent to 1MiB - - - Acceptable file size units - - - - Unit - Size in bytes - Equivalent sizes - - - - - B (bytes) - 1 - 1B - - - KB - 1,000 - 1KB = 1000B - - - KiB (kilobytes) - 1,024 - 1KiB = 1024B - - - MB - 1,000,000 - 1MB = 1000KB = 1000000B - - - MiB (megabytes) - 1,048,576 - 1MiB = 1024KiB = 1048576B - - - GB - 1,000,000,000 - 1GB = 1000MB = 1000000KB = 1000000000B - - - GiB (gigabytes) - 1,073,741,824 - 1GiB = 1024MiB = 1048576KiB = 1073741824B - - - TB - 1,000,000,000,000 - 1TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B - - - TiB (terabytes) - 1,099,511,627,776 - 1TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B - - - -
- - Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j. - - To limit the maximum number of backup files kept, you need to set the appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept. - - The default maximum backup index is equavilent to '1 MiB' - - Sample log4sh properties file demonstrating a RollingFileAppender - - - - Sample shell script demonstrating a RollingFileAppender - - -
-
diff --git a/1.3/src/docbook/build.xml b/1.3/src/docbook/build.xml deleted file mode 100644 index 5cf6ba5..0000000 --- a/1.3/src/docbook/build.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/1.3/src/docbook/conclusion.xml b/1.3/src/docbook/conclusion.xml deleted file mode 100644 index ca2c57b..0000000 --- a/1.3/src/docbook/conclusion.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - -Conclusion - The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well. - - If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at &myEmail;. - - Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward. - diff --git a/1.3/src/docbook/configuration.xml b/1.3/src/docbook/configuration.xml deleted file mode 100644 index 4ced5a4..0000000 --- a/1.3/src/docbook/configuration.xml +++ /dev/null @@ -1,363 +0,0 @@ - - - - - -Configuration - -
Properties File - Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf"). - - A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example. - - Recommended minimum log4sh.properties file - - - - In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender. - -
Root Logger - (future) -
- -
Levels - Logging Levels (from most output to least) - - - - Level - Definition - - - - - &trace; - The &trace; level has the lowest possible rank and is intended to turn on all logging. - - &debug; - The &debug; level designates fine-grained informational events that are most useful to debug an application. - - &info; - The &info; level designates informational messages that highlight the progress of the application at coarse-grained level. - - &warn; - The &warn; level designates potentially harmful situations. - - &error; - The &error; level designates error events that might still allow the application to continue running. - - &fatal; - The &fatal; level designates very severe error events that will presumably lead the application to abort. - - &off; - The &off; level has the highest possible rank and is intended to turn off logging. - - - -
-
- -
Appenders - An appender name can be any alpha-numeric string containing no spaces. - - Sample appender names - myAppender - good - - -
Types - An appender can be set to one of several different types. - - Setting an appender type - - - - Appender Types - - - - Type - Definition - Supported? - - - - - ConsoleAppender - output sent to console (STDOUT) - yes - - - FileAppender - output sent to a file - yes - - - DailyRollingFileAppender - output sent to a file that rolls over daily - partial; logs written, but not rotated - - - RollingFileAppender - output sent to a file that rolls over by size - partial; works, but nees improvement - - - SMTPAppender - output sent via email - parital; works, but needs improvement - - - SyslogAppender - output sent to a remote syslog daemon - partial; only localhost supported - - - -
-
- -
Options - An appender can take several different options. - - Setting an appender option - - - - Appender Options - - - - Option - Definition - Supported? - - - - - DatePattern - configure a pattern for the output filename - no (ignored) - - - File - output filename (special filename of STDERR used for logging to STDERR) - yes - - - MaxBackupIndex - number of old logfiles to keep - no (ignored) - - - MaxFileSize - maximum size of old logfiles - no (ignored) - - - Threshold - logging level of the appender - yes - - - -
-
- -
Layouts - An appender can be configured with various Layouts to customize how the output looks. - - Setting an appender's layout - - - - Layouts - - - - Layout - Definition - Supported? - - - - - HTMLLayout - layout using HTML - no (same as SimpleLayout) - - - SimpleLayout - a simple default layout ('%p - %m') - yes - - - PatternLayout - a patterned layout (default: '%d %p - %m%n') - yes - - - -
- - An layout has many different options to configure how it appears. These are known as patterns. - - Setting an appender's layout pattern - - - - Pattern Options - - - - Option - Definition - Supported? - - - - - - c - Used to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'. - partial (fixed) - - - - d - - Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, , or . The specifier is allowed only for compatibility with log4j properties files. - The default format of the date returned is equavilant to the output of the Unix date command with a format of . - - yes - - - - F - - Used to output the file name where the logging request was issued. - The default value is equavilent basename $0. - - yes - - - - L - This option is for compatibility with log4j properties files. - no (ignored) - - - - m - Used to output the script supplied message associated with the logging event. - yes - - - - n - This option is for compatibility with log4j properties files. - no (ignored) - - - - p - Used to output the priority of the logging event. - yes - - - - r - Used to output the number of seconds elapsed since the start of the script until the creation of the logging event. - yes - - - - t - - Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i - The default value is 'main'. - - yes - - - - x - This option is for compatibility with log4j properties files. - no (ignored) - - - - X - Used to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The conversion character must be followed by an environment variable name placed between braces, as in where is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output. - no (ignored) - - - - % - The sequence outputs a single percent sign. - yes - - - - -
- -
-
-
- -
Environment Variables - There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh. - - Here is the full list of supported variables. - - log4sh environment variables - - - - Variable - Usage - - - - - LOG4SH_CONFIGURATION - - This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration. - - LOG4SH_CONFIGURATION variable - LOG4SH_CONFIGURATION='/path/to/log4j.properties' - - - - - LOG4SH_CONFIG_PREFIX - - This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read. - - LOG4SH_CONFIG_PREFIX variable - LOG4SH_CONFIG_PREFIX='log4j' - - - - - -
-
- -
diff --git a/1.3/src/docbook/functions.xml b/1.3/src/docbook/functions.xml deleted file mode 100644 index c960e55..0000000 --- a/1.3/src/docbook/functions.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Functions - This XML file is a placeholder. It is meant to be overwritten with the dynamically generated XML document that is extracted from the source code. - diff --git a/1.3/src/docbook/introduction.xml b/1.3/src/docbook/introduction.xml deleted file mode 100644 index aaf3154..0000000 --- a/1.3/src/docbook/introduction.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Introduction - Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used. - -
Tested Operating Systems - - Cygwin - Linux - Mac OS X - Solaris 8+ - -
- -
Verified Shells - - BSD Shell (dash) - Bourne Shell (sh) - Bourne Again Shell (bash) - Korn Shell (ksh) - Public Domain Korn Shell (pdksh) -- partial functionality - -
- - See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested. - - -
Credits / Contributors - A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool. -
- - -
Feedback - Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: &myEmail;. -
-
diff --git a/1.3/src/docbook/log4sh.xml b/1.3/src/docbook/log4sh.xml deleted file mode 100644 index 54d2b74..0000000 --- a/1.3/src/docbook/log4sh.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - TRACE"> - DEBUG"> - INFO"> - WARN"> - ERROR"> - FATAL"> - OFF"> -]> - -log4sh - - log4sh version 1.4.0 - - - KateWard - -
- &myEmail; -
-
-
-
- - - &isoDate; - - - - - - - 1.4.0 - 2007-01-05 - kwd - - - - - - log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce. - -
- - &introduction; - &quickstart; - &usage; - &configuration; - &advancedusage; - &functions; - &conclusion; -
diff --git a/1.3/src/docbook/quickstart.xml b/1.3/src/docbook/quickstart.xml deleted file mode 100644 index 42e8504..0000000 --- a/1.3/src/docbook/quickstart.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - -Quickstart - First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests. - - Prepare your environment. - - - - - Hello, World! - Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts. - - Run the Hello World test. - - - - You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not! - - The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from to , and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh. - - - - Properties Configuration Test - In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code. - - Run the properties configuration test. - - - - You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code. - - - - Runtime Configuration Test - This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime. - - Run the runtime configuration test. - - - - You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed. - - - diff --git a/1.3/src/docbook/usage.xml b/1.3/src/docbook/usage.xml deleted file mode 100644 index 454cca2..0000000 --- a/1.3/src/docbook/usage.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - -Usage Guide - The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application. - - - - preconfigure log4sh (properties file) - source the log4sh script code into the shell script - configure log4sh in code (optional) - call logging statements - - - -
Preconfigure log4sh (optional) - To preconfigure log4sh, create a properties file (see the later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the section later in this chapter. -
- -
Source log4sh - To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done. - - - Sourcing external shell code into current program - - - - Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the &info; level to STDOUT. - - - Hello, world (using properties file) - &2 - exit 1 -fi -. $log4shDir/log4sh - -# say Hello to the world -logger_info "Hello, world" -]]> - - - Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from. - - - Hello, world; properties file - - -
- -
Configure log4sh in code - If log4sh was not preconfigured, the default configuration will be equivalent the config shown below. - - Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'. - - - - To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the &info; level. - - - Hello, world (configured in code) - - -
- -
Logging with log4sh - Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an &info; level. - - The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter. - - - Standard method of logging a message - logger_info 'message to log' - - - There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info). - - Alternate method of logging a message - echo 'message to log' |logger_info - -
- -
diff --git a/1.3/src/examples/log4sh.properties.ex3 b/1.3/src/examples/log4sh.properties.ex3 deleted file mode 100644 index 94128ea..0000000 --- a/1.3/src/examples/log4sh.properties.ex3 +++ /dev/null @@ -1,30 +0,0 @@ -# configure the external commands that log4sh uses -log4sh.external.awk = /usr/bin/awk -log4sh.external.logger = /usr/bin/logger -log4sh.external.mail = /home/kward/usr/bin/mail -log4sh.external.sed = /usr/bin/sed - -# set root logger to ERROR, and give it two appenders; stderr and R -log4sh.rootLogger = ERROR, stderr, R, S - -# set the stderr appender to STDERR with the default pattern -log4sh.appender.stderr = FileAppender -log4sh.appender.stderr.File = STDERR -log4sh.appender.stderr.layout = PatternLayout - -# setup the R appender as a file appender at the INFO level with a pattern -log4sh.appender.R = RollingFileAppender -log4sh.appender.R.Threshold = INFO -log4sh.appender.R.File = example.log -log4sh.appender.R.MaxFileSize = 100KB -log4sh.appender.R.MaxBackupIndex = 1 -log4sh.appender.R.layout = PatternLayout -# print the date in ISO 8601 format -log4sh.appender.R.layout.ConversionPattern = %d [%t] %-5p %c - %m%n - -# setup the S appender as a SyslogAppender at the INFO level -log4sh.appender.S = SyslogAppender -log4sh.appender.S.Threshold = DEBUG -log4sh.appender.S.Facility = local4 -log4sh.appender.S.layout = PatternLayout -log4sh.appender.S.layout.ConversionPattern = %d [%t] %-5p %c - %m%n diff --git a/1.3/src/resources/shelldoc.xslt b/1.3/src/resources/shelldoc.xslt deleted file mode 100644 index 3dcb8ff..0000000 --- a/1.3/src/resources/shelldoc.xslt +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - Function Reference - - - -
- <xsl:value-of select="@group"/> - - <xsl:value-of select="@group"/> - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - -
diff --git a/1.3/src/shell/log4sh b/1.3/src/shell/log4sh deleted file mode 100644 index 4c5d7fa..0000000 --- a/1.3/src/shell/log4sh +++ /dev/null @@ -1,3788 +0,0 @@ -# $Id$ -# vim:syntax=sh:sts=2 -# vim:foldmethod=marker:foldmarker=/**,*/ -# -#/** -# -# -# -# log4sh 1.4.0 -# -# http://log4sh.sourceforge.net/ -# -# written by Kate Ward <kate.ward@forestent.com> -# released under the LGPL -# -# this module implements something like the log4j module from the Apache group -# -# notes: -# *) the default appender is a ConsoleAppender named stdout with a level -# of ERROR and layout of SimpleLayout -# *) the appender levels are as follows (decreasing order of output): -# TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF -# -#*/ - -# shell flags for log4sh: -# u - treat unset variables as an error when performing parameter expansion -__LOG4SH_SHELL_FLAGS='u' - -# save the current set of shell flags, and then set some for log4sh -__log4sh_oldShellFlags=$- -for _log4sh_shellFlag in `echo "${__LOG4SH_SHELL_FLAGS}" |sed 's/\(.\)/\1 /g'` -do - set -${_log4sh_shellFlag} -done - -# -# constants -# -__LOG4SH_VERSION='1.4.0' - -__LOG4SH_TRUE=0 -__LOG4SH_FALSE=1 -__LOG4SH_ERROR=2 -__LOG4SH_NULL='~' - -__LOG4SH_APPENDER_FUNC_PREFIX='_log4sh_app_' -__LOG4SH_APPENDER_INCLUDE_EXT='.inc' - -__LOG4SH_TYPE_CONSOLE='ConsoleAppender' -__LOG4SH_TYPE_DAILY_ROLLING_FILE='DailyRollingFileAppender' -__LOG4SH_TYPE_FILE='FileAppender' -__LOG4SH_TYPE_ROLLING_FILE='RollingFileAppender' -__LOG4SH_TYPE_ROLLING_FILE_MAX_BACKUP_INDEX=1 -__LOG4SH_TYPE_ROLLING_FILE_MAX_FILE_SIZE=10485760 -__LOG4SH_TYPE_SMTP='SMTPAppender' -__LOG4SH_TYPE_SYSLOG='SyslogAppender' -__LOG4SH_TYPE_SYSLOG_FACILITY_NAMES=' kern user mail daemon auth security syslog lpr news uucp cron authpriv ftp local0 local1 local2 local3 local4 local5 local6 local7 ' -__LOG4SH_TYPE_SYSLOG_FACILITY='user' - -__LOG4SH_LAYOUT_HTML='HTMLLayout' -__LOG4SH_LAYOUT_SIMPLE='SimpleLayout' -__LOG4SH_LAYOUT_PATTERN='PatternLayout' - -__LOG4SH_LEVEL_TRACE=0 -__LOG4SH_LEVEL_TRACE_STR='TRACE' -__LOG4SH_LEVEL_DEBUG=1 -__LOG4SH_LEVEL_DEBUG_STR='DEBUG' -__LOG4SH_LEVEL_INFO=2 -__LOG4SH_LEVEL_INFO_STR='INFO' -__LOG4SH_LEVEL_WARN=3 -__LOG4SH_LEVEL_WARN_STR='WARN' -__LOG4SH_LEVEL_ERROR=4 -__LOG4SH_LEVEL_ERROR_STR='ERROR' -__LOG4SH_LEVEL_FATAL=5 -__LOG4SH_LEVEL_FATAL_STR='FATAL' -__LOG4SH_LEVEL_OFF=6 -__LOG4SH_LEVEL_OFF_STR='OFF' -__LOG4SH_LEVEL_CLOSED=255 -__LOG4SH_LEVEL_CLOSED_STR='CLOSED' - -__LOG4SH_PATTERN_DEFAULT='%d %p - %m%n' -__LOG4SH_THREAD_DEFAULT='main' - -__LOG4SH_CONFIGURATION="${LOG4SH_CONFIGURATION:-log4sh.properties}" -__LOG4SH_CONFIG_PREFIX="${LOG4SH_CONFIG_PREFIX:-log4sh}" - -# the following IFS is *supposed* to be on two lines!! -__LOG4SH_IFS_ARRAY=" -" -__LOG4SH_IFS_DEFAULT=' ' - -__LOG4SH_SECONDS=`eval "expr \`date '+%H \* 3600 + %M \* 60 + %S'\`"` - -# configure log4sh debugging. set the LOG4SH_INFO environment variable to any -# non-empty value to enable info output, LOG4SH_DEBUG enable debug output, or -# LOG4SH_TRACE to enable trace output. log4sh ERROR and above messages are -# always printed. to send the debug output to a file, set the LOG4SH_DEBUG_FILE -# with the filename you want debug output to be written to. -__LOG4SH_TRACE=${LOG4SH_TRACE:+'_log4sh_trace '} -__LOG4SH_TRACE=${__LOG4SH_TRACE:-':'} -[ -n "${LOG4SH_TRACE:-}" ] && LOG4SH_DEBUG=1 -__LOG4SH_DEBUG=${LOG4SH_DEBUG:+'_log4sh_debug '} -__LOG4SH_DEBUG=${__LOG4SH_DEBUG:-':'} -[ -n "${LOG4SH_DEBUG:-}" ] && LOG4SH_INFO=1 -__LOG4SH_INFO=${LOG4SH_INFO:+'_log4sh_info '} -__LOG4SH_INFO=${__LOG4SH_INFO:-':'} - -# set the constants to readonly -for _log4sh_const in `set |grep "^__LOG4SH_" |cut -d= -f1`; do - readonly ${_log4sh_const} -done -unset _log4sh_const - -# -# internal variables -# - -__log4sh_filename=`basename $0` -__log4sh_tmpDir='' -__log4sh_trapsFile='' - -__log4sh_threadName=${__LOG4SH_THREAD_DEFAULT} -__log4sh_threadStack=${__LOG4SH_THREAD_DEFAULT} - -__log4sh_seconds=0 -__log4sh_secondsLast=0 -__log4sh_secondsWrap=0 - -# workarounds for various commands -__log4sh_wa_strictBehavior=${__LOG4SH_FALSE} -( - # determine if the set builtin needs to be evaluated. if the string is parsed - # into two separate strings (common in ksh), then set needs to be evaled. - str='x{1,2}' - set -- ${str} - test ! "$1" = 'x1' -a ! "${2:-}" = 'x2' -) -__log4sh_wa_setNeedsEval=$? - - -#============================================================================= -# Log4sh -# - -#----------------------------------------------------------------------------- -# internal debugging -# - -#/** -# -# -# void -# -# -# -# -# _log4sh_log -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_log() -{ - _ll__level=$1 - shift - if [ -z "${LOG4SH_DEBUG_FILE:-}" ]; then - echo "log4sh:${_ll__level} $@" >&2 - else - echo "${_ll__level} $@" >>${LOG4SH_DEBUG_FILE} - fi - unset _ll__level -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_trace -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_trace() -{ - _log4sh_log "${__LOG4SH_LEVEL_TRACE_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; - } - -#/** -# -# -# void -# -# -# -# -# _log4sh_debug -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_debug() -{ - _log4sh_log "${__LOG4SH_LEVEL_DEBUG_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_info -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_info() -{ - _log4sh_log "${__LOG4SH_LEVEL_INFO_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_warn -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_warn() -{ - echo "log4sh:${__LOG4SH_LEVEL_WARN_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_WARN_STR}" "$@" -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_error -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_error() -{ - echo "log4sh:${__LOG4SH_LEVEL_ERROR_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_ERROR_STR}" "$@" -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_fatal -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_fatal() -{ - echo "log4sh:${__LOG4SH_LEVEL_FATAL_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_FATAL_STR}" "$@" -} - -#----------------------------------------------------------------------------- -# miscellaneous -# - -#/** -# -# -# string -# -# -# -# -# _log4sh_mktempDir -# -# -# -# -# Creates a secure temporary directory within which temporary files can be -# created. Honors the TMPDIR environment variable if it is -# set. -# -# -# tmpDir=`_log4sh_mktempDir` -# -# -# -#*/ -_log4sh_mktempDir() -{ - _lmd_tmpPrefix='log4sh' - - # try the standard mktemp function - ( exec mktemp -dqt ${_lmd_tmpPrefix}.XXXXXX 2>/dev/null ) && return - - # the standard mktemp didn't work. doing our own. - if [ -n "${RANDOM:-}" ]; then - # $RANDOM works - _lmd_random=${RANDOM}${RANDOM}${RANDOM}$$ - elif [ -r '/dev/urandom' ]; then - _lmd_random=`od -vAn -N4 -tu4 -# -# void -# -# -# -# -# _log4sh_updateSeconds -# -# -# -# -# Set the __log4sh_seconds variable to the number of seconds -# elapsed since the start of the script. -# -# -# _log4sh_updateSeconds` -# -# -# -#*/ -_log4sh_updateSeconds() -{ - if [ -n "${SECONDS:-}" ]; then - __log4sh_seconds=${SECONDS} - else - _lgs__date=`date '+%H \* 3600 + %M \* 60 + %S'` - _lgs__seconds=`eval "expr ${_lgs__date} + ${__log4sh_secondsWrap} \* 86400"` - if [ ${_lgs__seconds} -lt ${__log4sh_secondsLast} ]; then - __log4sh_secondsWrap=`expr ${__log4sh_secondsWrap} + 1` - _lgs__seconds=`expr ${_lgs_seconds} + 86400` - fi - __log4sh_seconds=`expr ${_lgs__seconds} - ${__LOG4SH_SECONDS}` - __log4sh_secondsLast=${__log4sh_seconds} - unset _lgs__date _lgs__seconds - fi -} - -#/** -# -# -# void/boolean -# -# -# -# -# log4sh_enableStrictBehavior -# -# -# -# -# Enables strict log4j behavior. -# -# Since: 1.3.7 -# -# log4sh_enableStrictBehavior -# -# -# -#*/ -log4sh_enableStrictBehavior() -{ - __log4sh_wa_strictBehavior=${__LOG4SH_TRUE} -} - -#/** -# -# -# void/boolean -# -# -# -# -# log4sh_setAlternative -# string command -# string path -# boolean useRuntimePath (optional) -# -# -# -# Specifies an alternative path for a command. -# -# Since: 1.3.7 -# -# log4sh_setAlternative nc /bin/nc -# -# -# -#*/ -log4sh_setAlternative() -{ - if [ $# -lt 2 ]; then - _log4sh_error 'log4sh_setAlternative(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - lsa_cmdName=$1 - lsa_cmdPath=$2 - lsa_useRuntimePath=${3:-} - __log4sh_return=${__LOG4SH_TRUE} - - # check that the alternative command exists and is executable - if [ \ - ! -x "${lsa_cmdPath}" \ - -a ${lsa_useRuntimePath:-${__LOG4SH_FALSE}} -eq ${__LOG4SH_FALSE} \ - ]; then - # the alternative command is not executable - _log4sh_error "unrecognized command alternative '${lsa_cmdName}'" - __log4sh_return=${__LOG4SH_FALSE} - fi - - # check for valid alternative - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - case ${lsa_cmdName} in - mail) ;; - nc) - lsa_cmdVers=`${lsa_cmdPath} --version 2>&1 |head -1` - if echo "${lsa_cmdVers}" |grep '^netcat' >/dev/null; then - # GNU Netcat - __log4sh_alternative_nc_opts='-c' - else - # older netcat (v1.10) - if nc -q 0 2>&1 |grep '^no destination$' >/dev/null 2>&1; then - # supports -q option - __log4sh_alternative_nc_opts='-q 0' - else - # doesn't support the -q option - __log4sh_alternative_nc_opts='' - fi - fi - unset lsa_cmdVers - ;; - *) - # the alternative is not valid - _log4sh_error "unrecognized command alternative '${lsa_cmdName}'" - __log4sh_return=${__LOG4SH_FALSE} - ;; - esac - fi - - # set the alternative - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - eval __log4sh_alternative_${lsa_cmdName}="\${lsa_cmdPath}" - ${__LOG4SH_DEBUG} "alternative '${lsa_cmdName}' command set to '${lsa_cmdPath}'" - fi - - unset lsa_cmdName lsa_cmdPath - return ${__log4sh_return} -} - -#----------------------------------------------------------------------------- -# array handling -# -# note: arrays are '1' based -# - -#/** -# -# -# integer -# -# -# -# -# _log4sh_findArrayElement -# string[] array -# string element -# -# -# Find the position of element in an array -# -# -# pos=`_log4sh_findArrayElement "$array" $element` -# -# -# -# -#*/ -_log4sh_findArrayElement() -{ - __pos=`echo "$1" |awk '$0==e{print NR}' e="$2"` - [ -n "${__pos}" ] && echo "${__pos}" || echo 0 - unset __pos -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_getArrayElement -# string[] array -# integer position -# -# -# Retrieve the element at the given position from an array -# -# element=`_log4sh_getArrayElement "$array" $position` -# -# -# -#*/ -_log4sh_getArrayElement() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - _lgae_array=$1 - _lgae_index=$2 - ${__LOG4SH_TRACE} "_lgae_array='${_lgae_array}' _lgae_index='${_lgae_index}'" - - _lgae_oldIFS=${IFS} IFS=${__LOG4SH_IFS_ARRAY} - if [ ${__log4sh_wa_setNeedsEval} -eq 0 ]; then - set -- junk ${_lgae_array} - else - eval "set -- junk \"${_lgae_array}\"" - _lgae_arraySize=$# - - if [ ${_lgae_arraySize} -le ${__log4shAppenderCount} ]; then - # the evaled set *didn't* work; failing back to original set command and - # disabling the work around. (pdksh) - __log4sh_wa_setNeedsEval=${__LOG4SH_FALSE} - set -- junk ${_lgae_array} - fi - fi - IFS=${_lgae_oldIFS} - - shift ${_lgae_index} - ${__LOG4SH_TRACE} "1='${1:-}' 2='${2:-}' 3='${3:-}' ..." - echo "$1" - - unset _lgae_array _lgae_arraySize _lgae_index _lgae_oldIFS - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# integer -# -# -# -# -# _log4sh_getArrayLength -# string[] array -# -# -# Get the length of an array -# -# length=`_log4sh_getArrayLength "$array"` -# -# -# -#*/ -_log4sh_getArrayLength() -{ - _oldIFS=${IFS} IFS=${__LOG4SH_IFS_ARRAY} - set -- $1 - IFS=${_oldIFS} unset _oldIFS - echo $# -} - -#/** -# -# -# string[] -# -# -# -# -# _log4sh_setArrayElement -# string[] array -# integer position -# string element -# -# -# Place an element at a given location in an array -# -# newArray=`_log4sh_setArrayElement "$array" $position $element` -# -# -# -#*/ -_log4sh_setArrayElement() -{ - echo "$1" |awk '{if(NR==r){print e}else{print $0}}' r=$2 e="$3" -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_peekStack -# string[] array -# -# -# Return the topmost element on a stack without removing the -# element. -# -# element=`_log4sh_peekStack "$array"` -# -# -# -#*/ -_log4sh_peekStack() -{ - echo "$@" |awk '{line=$0}END{print line}' -} - -#/** -# -# -# string[] -# -# -# -# -# _log4sh_popStack -# string[] array -# -# -# Remove the top-most element from a stack. This command takes a -# normal log4sh string array as input, but treats it as though it were a -# stack. -# -# newArray=`_log4sh_popStack "$array"` -# -# -# -#*/ -_log4sh_popStack() -{ - _array=$1 - _length=`_log4sh_getArrayLength "${_array}"` - echo "${_array}" |awk '{if(NR -# -# string -# -# -# -# -# _log4sh_pushStack -# string[] array -# string element -# -# -# Add a new element to the top of a stack. This command takes a normal -# log4sh string array as input, but treats it as though it were a -# stack. -# -# newArray=`_log4sh_pushStack "$array" $element` -# -# -# -#*/ -_log4sh_pushStack() -{ - echo "${1:+$1${__LOG4SH_IFS_ARRAY}}$2" -} - -#============================================================================= -# Appender -# - -#/** -# -# -# void -# -# -# -# -# appender_activateOptions -# string appender -# -# -# -# Activate an appender's configuration. This should be called after -# reconfiguring an appender via code. It needs only to be called once -# before any logging statements are called. This calling of this function -# will be required in log4sh 1.4.x. -# -# -# appender_activateAppender myAppender -# -# -# -#*/ -appender_activateOptions() -{ - _aao_appender=$1 - ${__LOG4SH_APPENDER_FUNC_PREFIX}${_aao_appender}_activateOptions - unset _aao_appender -} - -#/** -# -# -# void -# -# -# -# -# appender_close -# string appender -# -# -# Disable any further logging via an appender. Once closed, the -# appender can be reopened by setting it to any logging Level (e.g. -# INFO). -# -# appender_close myAppender -# -# -# -#*/ -appender_close() -{ - appender_setLevel $1 ${__LOG4SH_LEVEL_CLOSED_STR} -} - -#/** -# -# -# boolean -# -# -# -# -# appender_exists -# string appender -# -# -# Checks for the existance of a named appender -# -# exists=`appender_exists myAppender` -# -# -# -#*/ -appender_exists() -{ - _ae_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - [ "${_ae_index}" -gt 0 ] \ - && _ae_return=${__LOG4SH_TRUE} \ - || _ae_return=${__LOG4SH_FALSE} - unset _ae_index - return ${_ae_return} -} - -#/** -# -# -# string -# -# -# -# -# appender_getLayout -# string appender -# -# -# Gets the Layout of an Appender -# -# type=`appender_getLayout myAppender` -# -# -# -#*/ -appender_getLayout() -{ - _agl_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - _log4sh_getArrayElement "${__log4shAppenderLayouts}" ${_agl_index} - unset _agl_index -} - -#/** -# -# -# void -# -# -# -# -# appender_setLayout -# string appender -# string layout -# -# -# Sets the Layout of an Appender (e.g. PatternLayout) -# -# appender_setLayout myAppender PatternLayout -# -# -# -#*/ -appender_setLayout() -{ - _asl_appender=$1 - _asl_layout=$2 - - case ${_asl_layout} in - ${__LOG4SH_LAYOUT_HTML}|\ - ${__LOG4SH_LAYOUT_SIMPLE}|\ - ${__LOG4SH_LAYOUT_PATTERN}) - : - ;; - *) - _log4sh_error "unknown layout: ${_asl_layout}" - return ${__LOG4SH_FALSE} - ;; - esac - - _asl_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - __log4shAppenderLayouts=`_log4sh_setArrayElement \ - "${__log4shAppenderLayouts}" ${_asl_index} "${_asl_layout}"` - - # resource the appender - _appender_cache ${_asl_appender} - - unset _asl_appender _asl_index _asl_layout - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getLayoutByIndex -# integer index -# -# -# Gets the Layout of an Appender at the given array index -# -# type=`_appender_getLayoutByIndex 3` -# -# -# -#*/ -_appender_getLayoutByIndex() -{ - _log4sh_getArrayElement "${__log4shAppenderLayouts}" $1 -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_getLevel -# string appender -# -# -# Gets the current logging Level of an Appender -# -# type=`appender_getLevel myAppender` -# -# -# -#*/ -appender_getLevel() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_getLevel(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - agl_appender=$1 - - agl_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${agl_appender}` - # TODO: put check for valid index here - agl_level=`_log4sh_getArrayElement \ - "${__log4shAppenderLevels}" ${agl_index}` - __log4sh_return=$? - - echo "${agl_level}" - - unset agl_appender agl_index agl_level - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setLevel -# string appender -# string level -# -# -# Sets the Level of an Appender (e.g. INFO) -# -# appender_setLevel myAppender INFO -# -# -# -#*/ -appender_setLevel() -{ - asl_appender=$1 - asl_level=$2 - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asl_appender}` - __log4shAppenderLevels=`_log4sh_setArrayElement \ - "${__log4shAppenderLevels}" ${_index} "${asl_level}"` - - # resource the appender - _appender_cache ${asl_appender} - - unset asl_appender asl_type _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getLevelByIndex -# integer index -# -# -# Gets the current logging Level of an Appender at the given array -# index -# -# type=`_appender_getLevelByIndex 3` -# -# -# -#*/ -_appender_getLevelByIndex() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - _log4sh_getArrayElement "${__log4shAppenderLevels}" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_getPattern -# string appender -# -# -# Gets the Pattern of an Appender -# -# pattern=`appender_getPattern myAppender` -# -# -# -#*/ -appender_getPattern() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppenderPatterns" $_index - unset _index -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setPattern -# string appender -# string pattern -# -# -# Sets the Pattern of an Appender -# -# appender_setPattern myAppender '%d %p - %m%n' -# -# -# -#*/ -appender_setPattern() -{ - asp_appender=$1 - asp_pattern=$2 - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asp_appender}` - __log4shAppenderPatterns=`_log4sh_setArrayElement \ - "${__log4shAppenderPatterns}" ${_index} "${asp_pattern}"` - - # resource the appender - _appender_cache ${asp_appender} - - unset asp_appender asp_pattern _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getPatternByIndex -# integer index -# -# -# Gets the Pattern of an Appender at the specified array index -# -# pattern=`_appender_getPatternByIndex 3` -# -# -# -#*/ -_appender_getPatternByIndex() -{ - _log4sh_getArrayElement "$__log4shAppenderPatterns" $1 -} - -#/** -# -# -# string -# -# -# -# -# _appender_parsePattern -# string pattern -# string priority -# string message -# -# -# Generate a logging message given a Pattern, priority, and message. -# All dates will be represented as ISO 8601 dates (YYYY-MM-DD -# HH:MM:SS). -# Note: the '%r' character modifier does not work in the -# Solaris /bin/sh shell -# Example: -#
-# -# _appender_parsePattern '%d %p - %m%n' INFO "message to log" -# -#
-#
-#
-#
-#*/ -_appender_parsePattern() -{ - _pattern=$1 - _priority=$2 - _msg=$3 - - _date='' - _doEval=${__LOG4SH_FALSE} - - # determine if various commands must be run - _oldIFS="${IFS}"; IFS='%'; set -- x${_pattern}; IFS="${_oldIFS}" - if [ $# -gt 1 ]; then - # run the date command?? - IFS='d'; set -- ${_pattern}x; IFS="${_oldIFS}" - [ $# -gt 1 ] && _date=`date '+%Y-%m-%d %H:%M:%S'` - - # run the eval command? - IFS='X'; set -- ${_pattern}x; IFS="${_oldIFS}" - [ $# -gt 1 ] && _doEval=${__LOG4SH_TRUE} - fi - unset _oldIFS - - # escape any '\' and '&' chars in the message - _msg=`echo "${_msg}" |sed 's/\\\\/\\\\\\\\/g;s/&/\\\\&/g'` - - # deal with any newlines in the message - _msg=`echo "${_msg}" |tr '\n' ''` - - # parse the pattern - _pattern=`echo "${_pattern}" |sed \ - -e 's/%c/shell/g' \ - -e 's/%d{[^}]*}/%d/g' -e "s/%d/${_date}/g" \ - -e "s/%F/${__log4sh_filename}/g" \ - -e 's/%L//g' \ - -e 's/%n//g' \ - -e "s/%-*[0-9]*p/${_priority}/g" \ - -e "s/%-*[0-9]*r/${__log4sh_seconds}/g" \ - -e "s/%t/${__log4sh_threadName}/g" \ - -e 's/%x//g' \ - -e 's/%X{/$\{/g' \ - -e 's/%%m/%%%m/g' -e 's/%%/%/g' \ - -e "s%m${_msg}" |tr '' '\n'` - if [ ${_doEval} -eq ${__LOG4SH_FALSE} ]; then - echo "${_pattern}" - else - eval "echo \"${_pattern}\"" - fi - - unset _date _doEval _msg _pattern _tag -} - -#/** -# -# -# string -# -# -# -# -# appender_getType -# string appender -# -# -# Gets the Type of an Appender -# -# type=`appender_getType myAppender` -# -# -# -#*/ -appender_getType() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppenderTypes" $_index - unset _index -} - -#/** -# -# -# string -# -# -# -# -# appender_getAppenderType -# integer index -# -# -# Deprecated as of 1.3.1 -# -# Gets the Type of an Appender at the given array index -# -# -# type=`appender_getAppenderType 3` -# -# -# -#*/ -appender_getAppenderType() -{ - _appender_getTypeByIndex "$@" -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setType -# string appender -# string type -# -# -# Sets the Type of an Appender (e.g. FileAppender) -# -# appender_setType myAppender FileAppender -# -# -# -#*/ -appender_setType() -{ - ast_appender=$1 - ast_type=$2 - - # XXX need to verify types - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${ast_appender}` - __log4shAppenderTypes=`_log4sh_setArrayElement \ - "${__log4shAppenderTypes}" ${_index} "${ast_type}"` - - # resource the appender - _appender_cache ${ast_appender} - - unset ast_appender ast_type _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderType -# string appender -# string type -# -# -# Deprecated as of 1.3.1 -# -# Sets the Type of an Appender (e.g. FileAppender) -# -# -# appender_setAppenderType myAppender FileAppender -# -# -# -#*/ -appender_setAppenderType() -{ - appender_setType "$@" -} - -#/** -# -# -# string -# -# -# -# -# _appender_getTypeByIndex -# integer index -# -# -# Gets the Type of an Appender at the given array index -# -# type=`_appender_getTypeByIndex 3` -# -# -# -#*/ -_appender_getTypeByIndex() -{ - _log4sh_getArrayElement "$__log4shAppenderTypes" $1 -} - -#/** -# -# -# void -# -# -# -# -# _appender_cache -# string appender -# -# -# Dynamically creates an appender function in memory that will fully -# instantiate itself when it is called. -# -# _appender_cache myAppender -# -# -# -#*/ -_appender_cache() -{ - _ac__appender=$1 - - _ac__inc="${__log4sh_tmpDir}/${_ac__appender}${__LOG4SH_APPENDER_INCLUDE_EXT}" - - cat >"${_ac__inc}" < -# -# void -# -# -# -# -# _appender_activate -# string appender -# -# -# -# Dynamically regenerates an appender function in memory that is fully -# instantiated for a specific logging task. -# -# -# _appender_activate myAppender -# -# -# -#*/ -_appender_activate() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - ${__LOG4SH_TRACE} "_appender_activate($#)" - _aa_appender=$1 - ${__LOG4SH_TRACE} "_aa_appender='${_aa_appender}'" - - _aa_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${_aa_appender}` - _aa_inc="${__log4sh_tmpDir}/${_aa_appender}${__LOG4SH_APPENDER_INCLUDE_EXT}" - - ### generate function for inclusion - # TODO can we modularize this in the future? - - # send STDOUT to our include file - exec 4>&1 >${_aa_inc} - - # header - cat <&2" - elif [ "${_aa_file}" != "${__LOG4SH_NULL}" ]; then - # do rotation - case ${_aa_type} in - ${__LOG4SH_TYPE_ROLLING_FILE}) - # check whether the max file size has been exceeded - _aa_rotIndex=`appender_file_getMaxBackupIndex ${_aa_appender}` - _aa_rotSize=`appender_file_getMaxFileSize ${_aa_appender}` - cat <>'${_aa_file}'" - else - # the file "${__LOG4SH_NULL}" is closed?? Why did we get here, and why - # did I care when I wrote this bit of code? - : - fi - - unset _aa_file - ;; - - ${__LOG4SH_TYPE_SMTP}) - _aa_smtpTo=`appender_smtp_getTo ${_aa_appender}` - _aa_smtpSubject=`appender_smtp_getSubject ${_aa_appender}` - - cat </dev/null ) - unset _la_tag -EOF - else - # yes -- use netcat - if [ -n "${__log4sh_alternative_nc:-}" ]; then - case ${_aa_facilityName} in - kern) _aa_facilityCode=0 ;; # 0<<3 - user) _aa_facilityCode=8 ;; # 1<<3 - mail) _aa_facilityCode=16 ;; # 2<<3 - daemon) _aa_facilityCode=24 ;; # 3<<3 - auth|security) _aa_facilityCode=32 ;; # 4<<3 - syslog) _aa_facilityCode=40 ;; # 5<<3 - lpr) _aa_facilityCode=48 ;; # 6<<3 - news) _aa_facilityCode=56 ;; # 7<<3 - uucp) _aa_facilityCode=64 ;; # 8<<3 - cron) _aa_facilityCode=72 ;; # 9<<3 - authpriv) _aa_facilityCode=80 ;; # 10<<3 - ftp) _aa_facilityCode=88 ;; # 11<<3 - local0) _aa_facilityCode=128 ;; # 16<<3 - local1) _aa_facilityCode=136 ;; # 17<<3 - local2) _aa_facilityCode=144 ;; # 18<<3 - local3) _aa_facilityCode=152 ;; # 19<<3 - local4) _aa_facilityCode=160 ;; # 20<<3 - local5) _aa_facilityCode=168 ;; # 21<<3 - local6) _aa_facilityCode=176 ;; # 22<<3 - local7) _aa_facilityCode=184 ;; # 23<<3 - esac - - cat <&4 4>&- - - # source the newly created function - ${__LOG4SH_TRACE} 're-sourcing the newly created function' - . "${_aa_inc}" - - unset _aa_appender _aa_inc _aa_layout _aa_pattern _aa_type -} - -#----------------------------------------------------------------------------- -# FileAppender -# - -#/** -# -# -# string -# -# -# -# -# _appender_file_getFileByIndex -# integer index -# -# -# Get the filename of a FileAppender at the given array index -# -# _appender_file_getFileByIndex 3 -# -# -# -#*/ -_appender_file_getFileByIndex() -{ - _log4sh_getArrayElement "${__log4shAppender_file_files}" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_file_getFile -# string appender -# -# -# Get the filename of a FileAppender -# -# appender_file_getFile myAppender -# -# -# -#*/ -appender_file_getFile() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppender_file_files" $_index - unset _index -} - -#/** -# -# -# void -# -# -# -# -# appender_file_setFile -# string appender -# string filename -# -# -# -# Set the filename for a FileAppender (e.g. STDERR or -# /var/log/log4sh.log). -# -# -# appender_file_setFile myAppender STDERR -# -# -# -#*/ -appender_file_setFile() -{ - afsf_appender=$1 - afsf_file=$2 - ${__LOG4SH_TRACE} "afsf_appender='${afsf_appender}' afsf_file='${afsf_file}'" - - if [ -n "${afsf_appender}" -a -n "${afsf_file}" ]; then - # set the file - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${afsf_appender}` - __log4shAppender_file_files=`_log4sh_setArrayElement \ - "${__log4shAppender_file_files}" ${_index} "${afsf_file}"` - _return=$? - - # create the file (if it isn't already) - if [ ${_return} -eq ${__LOG4SH_TRUE} \ - -a ! "${afsf_file}" '=' "${__LOG4SH_NULL}" \ - -a ! "${afsf_file}" '=' 'STDERR' \ - -a ! -f "${afsf_file}" \ - ]; then - touch "${afsf_file}" 2>/dev/null - _result=$? - # determine success of touch command - if [ ${_result} -eq 1 ]; then - _log4sh_error "appender_file_setFile(): could not create file (${afsf_file}); closing appender" - appender_setLevel ${afsf_appender} ${__LOG4SH_LEVEL_CLOSED_STR} - fi - unset _result - fi - else - _log4sh_error 'appender_file_setFile(): missing appender and/or file' - _return=${__LOG4SH_FALSE} - fi - - # resource the appender - _appender_cache ${afsf_appender} - - unset afsf_appender afsf_file _index - return ${_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderFile -# string appender -# string filename -# -# -# Deprecated as of 1.3.2 -# -# Set the filename for a FileAppender (e.g. "STDERR" or -# "/var/log/log4sh.log") -# -# -# appender_setAppenderFile myAppender STDERR -# -# -# -#*/ -appender_setAppenderFile() -{ - appender_file_setFile "$@" -} - -#/** -# -# -# integer/boolean -# -# -# -# -# appender_file_getMaxBackupIndex -# string appender -# -# -# -# Returns the value of the MaxBackupIndex option. -# -# Since: 1.3.7 -# -# appender_file_getMaxBackupIndex myAppender -# -# -# -#*/ -appender_file_getMaxBackupIndex() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_file_getMaxBackupIndex(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - afgmbi_appender=$1 - - afgmbi_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afgmbi_appender}` - # TODO: put check for valid index here - _log4sh_getArrayElement \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" ${afgmbi_index} - __log4sh_return=$? - - unset afgmbi_appender afgmbi_index - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_file_setMaxBackupIndex -# string appender -# integer index -# -# -# Set the maximum number of backup files to keep around. -# -# The MaxBackupIndex option determines -# how many backup files are kept before the oldest is erased. This option -# takes a positive integer value. If set to zero, then there will be no -# backup files and the log file will be truncated when it reaches -# . -# -# Since: 1.3.7 -# -# appender_file_setMaxBackupIndex myAppender 3 -# -# -# -#*/ -appender_file_setMaxBackupIndex() -{ - if [ $# -ne 2 ]; then - _log4sh_error "appender_file_setMaxBackupIndex(): invalid number of parameters ($#)" - return ${__LOG4SH_FALSE} - fi - - afsmbi_appender=$1 - afsmbi_maxIndex=$2 - - # TODO: put check for valid input - - afsmbi_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afsmbi_appender}` - # TODO: put check for valid index here - __log4shAppender_rollingFile_maxBackupIndexes=`_log4sh_setArrayElement \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" ${afsmbi_index} \ - "${afsmbi_maxIndex}"` - __log4sh_return=$? - - # re-source the appender - _appender_cache ${afsmbi_appender} - - unset afsmbi_appender afsmbi_maxIndex afsmbi_index - return ${__log4sh_return} -} - -#/** -# -# -# integer/boolean -# -# -# -# -# appender_file_getMaxFileSize -# string appender -# -# -# -# Get the maximum size that the output file is allowed to reach before -# being rolled over to backup files. -# -# Since: 1.3.7 -# -# maxSize=`appender_file_getMaxBackupSize myAppender` -# -# -# -#*/ -appender_file_getMaxFileSize() -{ - if [ $# -ne 1 ]; then - _log4sh_error "appender_file_getMaxFileSize(): invalid number of parameters ($#)" - return ${__LOG4SH_FALSE} - fi - - afgmfs_appender=$1 - - afgmfs_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afgmfs_appender}` - # TODO: put check for valid index here - _log4sh_getArrayElement \ - "${__log4shAppender_rollingFile_maxFileSizes}" ${afgmfs_index} - __log4sh_return=$? - - unset afgmfs_appender afgmfs_index - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_file_setMaxFileSize -# string appender -# string size -# -# -# -# Set the maximum size that the output file is allowed to reach before -# being rolled over to backup files. -# -# -# In configuration files, the option takes an -# long integer in the range 0 - 2^40. You can specify the value with the -# suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being -# expressed respectively in kilobytes, megabytes or gigabytes. For example, -# the value "10KiB" will be interpreted as 10240. -# -# Since: 1.3.7 -# -# appender_file_setMaxBackupSize myAppender 10KiB -# -# -# -#*/ -appender_file_setMaxFileSize() -{ - if [ $# -ne 2 ]; then - _log4sh_error "appender_file_setMaxFileSize(): invalid number of parameters ($#)" - return ${__LOG4SH_FALSE} - fi - - afsmfs_appender=$1 - afsmfs_size=$2 - __log4sh_return=${__LOG4SH_TRUE} - - # split the file size into parts - afsmfs_value=`expr ${afsmfs_size} : '\([0-9]*\)'` - afsmfs_unit=`expr ${afsmfs_size} : '[0-9]* *\([A-Za-z]\{2,3\}\)'` - - # determine multiplier - if [ ${__log4sh_wa_strictBehavior} -eq ${__LOG4SH_TRUE} ]; then - case "${afsmfs_unit}" in - KB) afsmfs_unit='KiB' ;; - MB) afsmfs_unit='MiB' ;; - GB) afsmfs_unit='GiB' ;; - TB) afsmfs_unit='TiB' ;; - esac - fi - case "${afsmfs_unit}" in - B) afsmfs_mul=1 ;; - KB) afsmfs_mul=1000 ;; - KiB) afsmfs_mul=1024 ;; - MB) afsmfs_mul=1000000 ;; - MiB) afsmfs_mul=1048576 ;; - GB) afsmfs_mul=1000000000 ;; - GiB) afsmfs_mul=1073741824 ;; - TB) afsmfs_mul=1000000000000 ;; - TiB) afsmfs_mul=1099511627776 ;; - '') - _log4sh_warn 'missing file size unit; assuming bytes' - afsmfs_mul=1 - ;; - *) - _log4sh_error "unrecognized file size unit '${afsmfs_unit}'" - __log4sh_return=${__LOG4SH_FALSE} - ;; - esac - - # calculate maximum file size - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - afsmfs_maxFileSize=`(expr ${afsmfs_value} \* ${afsmfs_mul} 2>&1)` - if [ $? -gt 0 ]; then - _log4sh_error "problem calculating maximum file size: '${afsmfs_maxFileSize}'" - __log4sh_return=${__LOG4SH_FALSE} - fi - fi - - # store the maximum file size - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - afsmfs_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afsmfs_appender}` - # TODO: put check for valid index here - __log4shAppender_rollingFile_maxFileSizes=`_log4sh_setArrayElement \ - "${__log4shAppender_rollingFile_maxFileSizes}" ${afsmfs_index} \ - "${afsmfs_maxFileSize}"` - fi - - # re-source the appender - _appender_cache ${afsmfs_appender} - - unset afsmfs_appender afsmfs_size afsmfs_value afsmfs_unit afsmfs_mul \ - afsmfs_maxFileSize afsmfs_index - return ${__log4sh_return} -} - -#----------------------------------------------------------------------------- -# SMTPAppender -# - -#/** -# -# -# string/boolean -# -# -# -# -# appender_smtp_getTo -# string appender -# -# -# Get the to address for the given appender -# -# email=`appender_smtp_getTo myAppender` -# -# -# -#*/ -appender_smtp_getTo() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_smtp_getTo(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgt_appender=$1 - - asgt_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgt_appender}` - # TODO: put check for valid index here - asgt_to=`_log4sh_getArrayElement \ - "${__log4shAppender_smtp_tos}" ${asgt_index}` - __log4sh_return=$? - - [ "${asgt_to}" = "${__LOG4SH_NULL}" ] && asgt_to='' - echo "${asgt_to}" - - unset asgt_appender asgt_index asgt_to - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_smtp_setTo -# string appender -# string email -# -# -# Set the to address for the given appender -# -# appender_smtp_setTo myAppender user@example.com -# -# -# -#*/ -appender_smtp_setTo() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_smtp_setTo(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asst_appender=$1 - asst_email=$2 - - asst_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asst_appender}` - # TODO: put check for valid index here - __log4shAppender_smtp_tos=`_log4sh_setArrayElement \ - "${__log4shAppender_smtp_tos}" ${asst_index} "${asst_email}"` - - # resource the appender - _appender_cache ${asst_appender} - - unset asst_appender asst_email asst_index -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderRecipient -# string appender -# string email -# -# -# Deprecated as of 1.3.1 -# -# Set the to address for the given appender -# -# -# appender_smtp_setTo myAppender user@example.com -# -# -# -#*/ -appender_setAppenderRecipient() -{ - appender_smtp_setTo "$@" -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_smtp_getSubject -# string appender -# -# -# Get the email subject for the given appender -# -# subject=`appender_smtp_getSubject myAppender` -# -# -# -#*/ -appender_smtp_getSubject() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_smtp_getSubject(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgs_appender=$1 - - asgs_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgs_appender}` - # TODO: put check for valid index here - asgs_subject=`_log4sh_getArrayElement \ - "${__log4shAppender_smtp_subjects}" ${asgs_index}` - __log4sh_return=$? - - [ "${asgs_subject}" = "${__LOG4SH_NULL}" ] && asgs_subject='' - echo "${asgs_subject}" - - unset asgs_appender asgs_index asgs_subject - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_smtp_setSubject -# string appender -# string subject -# -# -# Sets the email subject for an SMTP appender -# -# appender_smtp_setSubject myAppender "This is a test" -# -# -# -#*/ -appender_smtp_setSubject() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_smtp_setSubject(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asss_appender=$1 - asss_subject=$2 - - # set the Subject - asss_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asss_appender}` - if [ ${asss_index} -gt 0 ]; then - __log4shAppender_smtp_subjects=`_log4sh_setArrayElement \ - "${__log4shAppender_smtp_subjects}" ${asss_index} "${asss_subject}"` - __log4sh_return=${__LOG4SH_TRUE} - else - _log4sh_error "could not set Subject for appender (${asss_appender})" - __log4sh_return=${__LOG4SH_FALSE} - fi - - # re-source the appender - _appender_cache ${asss_appender} - - unset asss_appender asss_subject asss_index - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderSubject -# string appender -# string subject -# -# -# Deprecated as of 1.3.1 -# -# Sets the email subject for an SMTP appender -# -# -# appender_setAppenderSubject myAppender "This is a test" -# -# -# -#*/ -appender_setAppenderSubject() -{ - appender_smtp_setSubject "$@" -} - -#----------------------------------------------------------------------------- -# SyslogAppender -# - -#/** -# -# -# string -# -# -# -# -# -# _appender_syslog_getFacilityByIndex -# -# integer index -# -# -# Get the syslog facility of the specified appender by index -# -# -# facility=`_appender_syslog_getFacilityByIndex 3` -# -# -# -# -#*/ -_appender_syslog_getFacilityByIndex() -{ - _log4sh_getArrayElement "$__log4shAppender_syslog_facilities" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_getSyslogFacility -# integer index -# -# -# Deprecated as of 1.3.1 -# -# Get the syslog facility of the specified appender by index -# -# -# facility=`appender_getSyslogFacility 3` -# -# -# -#*/ -appender_getSyslogFacility() -{ - _appender_syslog_getFacilityByIndex "$@" -} - -#/** -# -# -# void -# -# -# -# -# appender_syslog_getFacility -# string appender -# -# -# -# Get the syslog facility for the given appender. -# -# -# facility=`appender_syslog_getFacility myAppender` -# -# -# -#*/ -appender_syslog_getFacility() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_syslog_getFacility(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgf_appender=$1 - - asgf_index=`_log4sh_findArrayElement "$__log4shAppenders" ${asgf_appender}` - _log4sh_getArrayElement "${__log4shAppender_syslog_facilities}" ${asgf_index} - - unset asgf_appender asgf_index -} - -#/** -# -# -# void -# -# -# -# -# appender_syslog_setFacility -# string appender -# string facility -# -# -# Set the syslog facility for the given appender -# -# appender_syslog_setFacility myAppender local4` -# -# -# -#*/ -appender_syslog_setFacility() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_syslog_setFacility(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - assf_appender=$1 - assf_facility=$2 - - # check for valid facility - echo "${__LOG4SH_TYPE_SYSLOG_FACILITY_NAMES}" |grep " ${assf_facility} " >/dev/null - if [ $? -ne 0 ]; then - # the facility is not valid - _log4sh_error "[${assf_facility}] is an unknown syslog facility. Defaulting to [user]." - assf_facility='user' - fi - - # set appender facility - assf_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${assf_appender}` - # TODO: put check for valid index here - __log4shAppender_syslog_facilities=`_log4sh_setArrayElement \ - "${__log4shAppender_syslog_facilities}" ${assf_index} "${assf_facility}"` - - # re-source the appender - _appender_cache ${assf_appender} - - unset assf_appender assf_facility assf_index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# appender_setSyslogFacility -# string appender -# string facility -# -# -# Deprecated as of 1.3.2 -# -# Set the syslog facility for the given appender -# -# -# appender_setSyslogFacility myAppender local4` -# -# -# -#*/ -appender_setSyslogFacility() -{ - appender_syslog_setFacility "$@" -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_syslog_getHost -# integer index -# -# -# -# Get the syslog host of the specified appender. -# -# Since: 1.3.7 -# -# host=`appender_syslog_getHost myAppender` -# -# -# -#*/ -appender_syslog_getHost() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_syslog_getHost(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgh_appender=$1 - - asgh_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgh_appender}` - # TODO: put check for valid index here - asgh_host=`_log4sh_getArrayElement \ - "${__log4shAppender_syslog_hosts}" ${asgh_index}` - __log4sh_return=$? - - [ "${asgh_host}" = "${__LOG4SH_NULL}" ] && asgh_host='' - echo "${asgh_host}" - - unset asgh_appender asgh_index asgh_host - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_syslog_setHost -# string appender -# string host -# -# -# -# Set the syslog host for the given appender. Requires that the 'nc' -# command alternative has been previously set with the -# log4sh_setAlternative() function. -# -# Since: 1.3.7 -# -# appender_syslog_setHost myAppender localhost -# -# -# -#*/ -# -# The BSD syslog Protocol -# http://www.ietf.org/rfc/rfc3164.txt -# -appender_syslog_setHost() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_syslog_setHost(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - assh_appender=$1 - assh_host=$2 - - [ -z "${__log4sh_alternative_nc:-}" ] \ - && _log4sh_warn 'the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative().' - - assh_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${assh_appender}` - # TODO: put check for valid index here - __log4shAppender_syslog_hosts=`_log4sh_setArrayElement \ - "${__log4shAppender_syslog_hosts}" ${assh_index} "${assh_host}"` - - # re-source the appender - _appender_cache ${assh_appender} - - unset assh_appender assh_host assh_index - return ${__LOG4SH_TRUE} -} - -#============================================================================= -# Level -# - -#/** -# -# -# string -# -# -# -# -# logger_level_toLevel -# integer val -# -# -# Converts an internally used level integer into its external level -# equivalent -# -# level=`logger_level_toLevel 3` -# -# -# -#*/ -# TODO use arrays instead of case statement ?? -logger_level_toLevel() -{ - _ltl__val=$1 - - _ltl__return=${__LOG4SH_TRUE} - _ltl__level='' - - case ${_ltl__val} in - ${__LOG4SH_LEVEL_TRACE}) _ltl__level=${__LOG4SH_LEVEL_TRACE_STR} ;; - ${__LOG4SH_LEVEL_DEBUG}) _ltl__level=${__LOG4SH_LEVEL_DEBUG_STR} ;; - ${__LOG4SH_LEVEL_INFO}) _ltl__level=${__LOG4SH_LEVEL_INFO_STR} ;; - ${__LOG4SH_LEVEL_WARN}) _ltl__level=${__LOG4SH_LEVEL_WARN_STR} ;; - ${__LOG4SH_LEVEL_ERROR}) _ltl__level=${__LOG4SH_LEVEL_ERROR_STR} ;; - ${__LOG4SH_LEVEL_FATAL}) _ltl__level=${__LOG4SH_LEVEL_FATAL_STR} ;; - ${__LOG4SH_LEVEL_OFF}) _ltl__level=${__LOG4SH_LEVEL_OFF_STR} ;; - ${__LOG4SH_LEVEL_CLOSED}) _ltl__level=${__LOG4SH_LEVEL_CLOSED_STR} ;; - *) _ltl__return=${__LOG4SH_FALSE} ;; - esac - - echo ${_ltl__level} - unset _ltl__val _ltl__level - return ${_ltl__return} -} - -#/** -# -# -# integer -# -# -# -# -# logger_level_toInt -# string level -# -# -# Converts an externally used level tag into its integer -# equivalent -# -# levelInt=`logger_level_toInt WARN` -# -# -# -#*/ -logger_level_toInt() -{ - _lti__level=$1 - - _lti__int=0 - _lti__return=${__LOG4SH_TRUE} - - case ${_lti__level} in - ${__LOG4SH_LEVEL_TRACE_STR}) _lti__int=${__LOG4SH_LEVEL_TRACE} ;; - ${__LOG4SH_LEVEL_DEBUG_STR}) _lti__int=${__LOG4SH_LEVEL_DEBUG} ;; - ${__LOG4SH_LEVEL_INFO_STR}) _lti__int=${__LOG4SH_LEVEL_INFO} ;; - ${__LOG4SH_LEVEL_WARN_STR}) _lti__int=${__LOG4SH_LEVEL_WARN} ;; - ${__LOG4SH_LEVEL_ERROR_STR}) _lti__int=${__LOG4SH_LEVEL_ERROR} ;; - ${__LOG4SH_LEVEL_FATAL_STR}) _lti__int=${__LOG4SH_LEVEL_FATAL} ;; - ${__LOG4SH_LEVEL_OFF_STR}) _lti__int=${__LOG4SH_LEVEL_OFF} ;; - ${__LOG4SH_LEVEL_CLOSED_STR}) _lti__int=${__LOG4SH_LEVEL_CLOSED} ;; - *) _lti__return=${__LOG4SH_FALSE} ;; - esac - - echo ${_lti__int} - unset _lti__int _lti__level - return ${_lti__return} -} - -#============================================================================= -# Logger -# - -#/** -# -# -# void/boolean -# -# -# -# -# logger_addAppender -# string appender -# -# -# Add and initialize a new appender -# -# logger_addAppender $appender -# -# -# -#*/ -logger_addAppender() -{ - laa_appender=$1 - - # FAQ should we be using setter functions here?? for performance, no. - __log4shAppenders=`_log4sh_pushStack "${__log4shAppenders}" $1` - __log4shAppenderCount=`expr ${__log4shAppenderCount} + 1` - __log4shAppenderCounts="${__log4shAppenderCounts} ${__log4shAppenderCount}" - __log4shAppenderLayouts=`_log4sh_pushStack \ - "$__log4shAppenderLayouts" "${__LOG4SH_LAYOUT_SIMPLE}"` - __log4shAppenderLevels=`_log4sh_pushStack \ - "${__log4shAppenderLevels}" "${__LOG4SH_NULL}"` - __log4shAppenderPatterns=`_log4sh_pushStack \ - "${__log4shAppenderPatterns}" "${__LOG4SH_PATTERN_DEFAULT}"` - __log4shAppenderTypes=`_log4sh_pushStack \ - "${__log4shAppenderTypes}" ${__LOG4SH_TYPE_CONSOLE}` - __log4shAppender_file_files=`_log4sh_pushStack \ - "${__log4shAppender_file_files}" ${__LOG4SH_NULL}` - __log4shAppender_rollingFile_maxBackupIndexes=`_log4sh_pushStack \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" \ - ${__LOG4SH_TYPE_ROLLING_FILE_MAX_BACKUP_INDEX}` - __log4shAppender_rollingFile_maxFileSizes=`_log4sh_pushStack \ - "${__log4shAppender_rollingFile_maxFileSizes}" \ - ${__LOG4SH_TYPE_ROLLING_FILE_MAX_FILE_SIZE}` - __log4shAppender_smtp_tos=`_log4sh_pushStack \ - "${__log4shAppender_smtp_tos}" ${__LOG4SH_NULL}` - __log4shAppender_smtp_subjects=`_log4sh_pushStack \ - "${__log4shAppender_smtp_subjects}" ${__LOG4SH_NULL}` - __log4shAppender_syslog_facilities=`_log4sh_pushStack \ - "${__log4shAppender_syslog_facilities}" ${__LOG4SH_TYPE_SYSLOG_FACILITY}` - __log4shAppender_syslog_hosts=`_log4sh_pushStack \ - "${__log4shAppender_syslog_hosts}" "${__LOG4SH_NULL}"` - - _appender_cache ${laa_appender} - - unset laa_appender - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# logger_addAppenderWithPattern -# string appender -# string pattern -# -# -# Deprecated as of 1.3.6 -# -# Add and initialize a new appender with a specific PatternLayout -# -# -# logger_addAppenderWithPattern $appender '%d %p - %m%n' -# -# -# -#*/ -logger_addAppenderWithPattern() -{ - _myAppender=$1 - _myPattern=$2 - - logger_addAppender ${_myAppender} - appender_setLayout ${_myAppender} "${__LOG4SH_LAYOUT_PATTERN}" - appender_setPattern ${_myAppender} "${_myPattern}" - - unset _myAppender _myPattern -} - -#/** -# -# -# string -# -# -# -# -# logger_getFilename -# -# -# -# -# Get the filename that would be shown when the '%F' conversion character -# is used in a PatternLayout. -# -# -# filename=`logger_getFilename` -# -# -# -#*/ -logger_getFilename() -{ - echo "${__log4sh_filename}" -} - -#/** -# -# -# void -# -# -# -# -# logger_setFilename -# string filename -# -# -# Set the filename to be shown when the '%F' conversion character is -# used in a PatternLayout. -# -# logger_setFilename 'myScript.sh' -# -# -# -#*/ -logger_setFilename() -{ - __log4sh_filename=$1 -} - -#/** -# -# -# string -# -# -# -# -# logger_getLevel -# -# -# -# Get the global default logging level (e.g. DEBUG). -# -# level=`logger_getLevel` -# -# -# -#*/ -logger_getLevel() -{ - logger_level_toLevel ${__log4shLevel} -} - -#/** -# -# -# void -# -# -# -# -# logger_setLevel -# string level -# -# -# Sets the global default logging level (e.g. DEBUG). -# -# logger_setLevel INFO -# -# -# -#*/ -logger_setLevel() -{ - _l_level=$1 - - _l_int=`logger_level_toInt ${_l_level}` - if [ $? -eq ${__LOG4SH_TRUE} ]; then - __log4shLevel=${_l_int} - else - _log4sh_error "attempt to set invalid log level '${_l_level}'" - fi - - unset _l_int _l_level -} - -#/** -# -# -# void -# -# -# -# -# log -# string level -# string[] message(s) -# -# -# The base logging command that logs a message to all defined -# appenders -# -# log DEBUG 'This is a test message' -# -# -# -#*/ -log() -{ - _l_level=$1 - shift - # if no message was passed, read it from STDIN - [ $# -ne 0 ] && _l_msg="$@" || _l_msg=`cat` - - _l_levelInt=`logger_level_toInt ${_l_level}` - - # update seconds elapsed - _log4sh_updateSeconds - - _l_oldIFS=${IFS} IFS=${__LOG4SH_IFS_DEFAULT} - for _l_appenderIndex in ${__log4shAppenderCounts}; do - ${__LOG4SH_TRACE} "_l_appenderIndex='${_l_appenderIndex}'" - # determine appender level - _l_appenderLevel=`_appender_getLevelByIndex ${_l_appenderIndex}` - if [ "${_l_appenderLevel}" = "${__LOG4SH_NULL}" ]; then - # continue if requested is level less than general level - [ ! ${__log4shLevel} -le ${_l_levelInt} ] && continue - else - _l_appenderLevelInt=`logger_level_toInt ${_l_appenderLevel}` - # continue if requested level is less than specific appender level - ${__LOG4SH_TRACE} "_l_levelInt='${_l_levelInt}' _l_appenderLevelInt='${_l_appenderLevelInt}'" - [ ! ${_l_appenderLevelInt} -le ${_l_levelInt} ] && continue - fi - - # execute dynamic appender function - _l_appenderName=`_log4sh_getArrayElement \ - "${__log4shAppenders}" ${_l_appenderIndex}` - ${__LOG4SH_APPENDER_FUNC_PREFIX}${_l_appenderName}_append ${_l_level} "${_l_msg}" - done - IFS=${_l_oldIFS} - - unset _l_msg _l_oldIFS _l_level _l_levelInt - unset _l_appenderIndex _l_appenderLevel _l_appenderLevelInt _l_appenderName -} - -#/** -# -# -# void -# -# -# -# -# logger_trace -# string[] message -# -# -# This is a helper function for logging a message at the TRACE -# priority -# -# logger_trace 'This is a trace message' -# -# -# -#*/ -logger_trace() -{ - log ${__LOG4SH_LEVEL_TRACE_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_debug -# string[] message -# -# -# This is a helper function for logging a message at the DEBUG -# priority -# -# logger_debug 'This is a debug message' -# -# -# -#*/ -logger_debug() -{ - log ${__LOG4SH_LEVEL_DEBUG_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_info -# string[] message -# -# -# This is a helper function for logging a message at the INFO -# priority -# -# logger_info 'This is a info message' -# -# -# -#*/ -logger_info() -{ - log ${__LOG4SH_LEVEL_INFO_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_warn -# string[] message -# -# -# -# This is a helper function for logging a message at the WARN priority -# -# -# logger_warn 'This is a warn message' -# -# -# -#*/ -logger_warn() -{ - log ${__LOG4SH_LEVEL_WARN_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_error -# string[] message -# -# -# -# This is a helper function for logging a message at the ERROR priority -# -# -# logger_error 'This is a error message' -# -# -# -#*/ -logger_error() -{ - log ${__LOG4SH_LEVEL_ERROR_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_fatal -# string[] message -# -# -# This is a helper function for logging a message at the FATAL -# priority -# -# logger_fatal 'This is a fatal message' -# -# -# -#*/ -logger_fatal() -{ - log ${__LOG4SH_LEVEL_FATAL_STR} "$@" -} - -#============================================================================== -# Property -# - -#/** -# -# -# string -# -# -# -# -# _log4sh_getPropPrefix -# string property -# -# -# Takes a string (eg. "log4sh.appender.stderr.File") and returns the -# prefix of it (everything before the first '.' char). Normally used in -# parsing the log4sh configuration file. -# -# prefix=`_log4sh_getPropPrefix $property"` -# -# -# -#*/ -_log4sh_getPropPrefix() -{ - _oldIFS=${IFS} IFS='.' - set -- $1 - IFS=${_oldIFS} unset _oldIFS - echo $1 -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_stripPropPrefix -# string property -# -# -# Strips the prefix off a property configuration command and returns -# the string. E.g. "log4sh.appender.stderr.File" becomes -# "appender.stderr.File". -# -# newProperty=`_log4sh_stripPropPrefix $property` -# -# -# -#*/ -_log4sh_stripPropPrefix() -{ - expr "$1" : '[^.]*\.\(.*\)' -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_propAlternative -# string property -# string value -# -# -# -# Configures log4sh to use an alternative command. -# -# -# _log4sh_propAlternative property value -# -# -# -#*/ -_log4sh_propAlternative() -{ - _lpa_key=$1 - _lpa_value=$2 - - # strip the leading 'alternative.' - _lpa_alternative=`_log4sh_stripPropPrefix ${_lpa_key}` - - # set the alternative - log4sh_setAlternative ${_lpa_alternative} "${_lpa_value}" - - unset _lpa_key _lpa_value _lpa_alternative -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_propAppender -# string property -# string value -# -# -# Configures log4sh using an appender property configuration statement -# -# _log4sh_propAppender $property $value -# -# -# -#*/ -_log4sh_propAppender() -{ - _lpa_key=$1 - _lpa_value=$2 - - _lpa_appender='' - - # strip the leading 'appender' keyword prefix - _lpa_key=`_log4sh_stripPropPrefix ${_lpa_key}` - - # handle appender definitions - if [ "${_lpa_key}" '=' "`expr \"${_lpa_key}\" : '\([^.]*\)'`" ]; then - _lpa_appender="${_lpa_key}" - else - _lpa_appender=`_log4sh_getPropPrefix $_lpa_key` - fi - - # does the appender exist? - appender_exists ${_lpa_appender} - if [ $? -eq ${__LOG4SH_FALSE} ]; then - _log4sh_error "attempt to configure the non-existant appender (${_lpa_appender})" - unset _lpa_appender _lpa_key _lpa_value - return ${__LOG4SH_ERROR} - fi - - # handle the appender type - if [ "${_lpa_appender}" = "${_lpa_key}" ]; then - case $_lpa_value in - $__LOG4SH_TYPE_CONSOLE) - appender_setType $_lpa_appender $_lpa_value ;; - $__LOG4SH_TYPE_FILE) - appender_setType $_lpa_appender $_lpa_value ;; - $__LOG4SH_TYPE_DAILY_ROLLING_FILE) - appender_setType $_lpa_appender $_lpa_value ;; - $__LOG4SH_TYPE_ROLLING_FILE) - appender_setType $_lpa_appender $_lpa_value ;; - $__LOG4SH_TYPE_SMTP) - appender_setType $_lpa_appender $_lpa_value ;; - $__LOG4SH_TYPE_SYSLOG) - appender_setType $_lpa_appender $_lpa_value ;; - *) - _log4sh_error "appender type ($_lpa_value) unrecognized" ;; - esac - unset _lpa_appender _lpa_key _lpa_value - return ${__LOG4SH_TRUE} - fi - - # handle appender values and methods - _lpa_key=`_log4sh_stripPropPrefix $_lpa_key` - if [ "$_lpa_key" '=' "`expr \"${_lpa_key}\" : '\([^.]*\)'`" ]; then - case $_lpa_key in - # General - Threshold) appender_setLevel $_lpa_appender "$_lpa_value" ;; - layout) appender_setLayout $_lpa_appender "$_lpa_value" ;; - - # FileAppender - DatePattern) ;; # unsupported - File) - _lpa_value=`eval echo "${_lpa_value}"` - appender_file_setFile ${_lpa_appender} "${_lpa_value}" - ;; - MaxBackupIndex) - appender_file_setMaxBackupIndex ${_lpa_appender} "${_lpa_value}" ;; - MaxFileSize) - appender_file_setMaxFileSize ${_lpa_appender} "${_lpa_value}" ;; - - # SMTPAppender - To) appender_smtp_setTo ${_lpa_appender} "${_lpa_value}" ;; - Subject) appender_smtp_setSubject ${_lpa_appender} "${_lpa_value}" ;; - - # SyslogAppender - SyslogHost) appender_syslog_setHost ${_lpa_appender} "${_lpa_value}" ;; - Facility) appender_syslog_setFacility ${_lpa_appender} "${_lpa_value}" ;; - - # catch unrecognized - *) _log4sh_error "appender value/method ($_lpa_key) unrecognized" ;; - esac - unset _lpa_appender _lpa_key _lpa_value - return ${__LOG4SH_TRUE} - fi - - # handle appender layout values and methods - _lpa_key=`_log4sh_stripPropPrefix $_lpa_key` - case $_lpa_key in - ConversionPattern) appender_setPattern $_lpa_appender "$_lpa_value" ;; - *) _log4sh_error "layout value/method ($_lpa_key) unrecognized" ;; - esac - unset _lpa_appender _lpa_key _lpa_value - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_propLogger -# string property -# string value -# -# -# (future) Configures log4sh with a logger configuration -# statement. Sample output: "logger: property value". -# -# result=`_log4sh_propLogger $property $value` -# -# -# -#*/ -_log4sh_propLogger() -{ - _prop=`_log4sh_stripPropPrefix $1` - echo "logger: ${_prop} $2" - unset _prop -} - -# -# configure log4sh with a rootLogger configuration statement -# -# @param _key configuration command -# @param _value configuration value -# -#/** -# -# -# void -# -# -# -# -# _log4sh_propRootLogger -# string rootLogger -# -# -# Configures log4sh with a rootLogger configuration -# statement. It expects a comma separated string similar to the following: -# log4sh.rootLogger=ERROR, stderr, R -# The first option is the default logging level to set for all -# of the following appenders that will be created, and all following options -# are the names of appenders to create. The appender names must be -# unique. -# -# _log4sh_propRootLogger $value -# -# -# -#*/ -_log4sh_propRootLogger() -{ - __lprl_rootLogger=`echo "$@" |sed 's/ *, */,/g'` - __lprl_count=`echo "${__lprl_rootLogger}" |sed 's/,/ /g' |wc -w` - __lprl_index=1 - while [ ${__lprl_index} -le ${__lprl_count} ]; do - __lprl_operand=`echo "${__lprl_rootLogger}" |cut -d, -f${__lprl_index}` - if [ ${__lprl_index} -eq 1 ]; then - logger_setLevel "${__lprl_operand}" - else - appender_exists "${__lprl_operand}" - if [ $? -eq ${__LOG4SH_FALSE} ]; then - logger_addAppender "${__lprl_operand}" - else - _log4sh_error "attempt to add already existing appender of name (${__lprl_operand})" - fi - fi - __lprl_index=`expr ${__lprl_index} + 1` - done - - unset __lprl_count __lprl_index __lprl_operand __lprl_rootLogger -} - -#/** -# -# -# void -# -# -# -# -# log4sh_doConfigure -# string configFileName -# -# -# -# Read configuration from a file. The existing -# configuration is not cleared or reset. If you require a -# different behavior, then call the log4sh_resetConfiguration -# before calling log4sh_doConfigure. -# -# -# log4sh_doConfigure myconfig.properties -# -# -# -#*/ -log4sh_doConfigure() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - ldc_file=$1 - - # prepare the environment for configuration - log4sh_resetConfiguration - - # strip the config prefix and dump output to a temporary file - ldc_tmpFile="${__log4sh_tmpDir}/properties" - ${__LOG4SH_TRACE} "__LOG4SH_CONFIG_PREFIX='${__LOG4SH_CONFIG_PREFIX}'" - grep "^${__LOG4SH_CONFIG_PREFIX}\." "${ldc_file}" >"${ldc_tmpFile}" - - # read the file in. using awk here instead of piping the file into 'while' - # and then reading with 'read' as the pipe causes a fork under the Solaris - # shell which makes it impossible to get the variables passed back to the - # parent script. - exec 3<&0 <"${ldc_tmpFile}" - while read ldc_line; do - ldc_key=`expr "${ldc_line}" : '\([^= ]*\) *=.*'` - ldc_value=`expr "${ldc_line}" : '[^= ]* *= *\(.*\)'` - - # strip the leading 'log4sh.' - ldc_key=`_log4sh_stripPropPrefix ${ldc_key}` - ldc_keyword=`_log4sh_getPropPrefix ${ldc_key}` - case ${ldc_keyword} in - alternative) _log4sh_propAlternative ${ldc_key} "${ldc_value}" ;; - appender) _log4sh_propAppender ${ldc_key} "${ldc_value}" ;; - logger) _log4sh_propLogger ${ldc_key} "${ldc_value}" ;; - rootLogger) _log4sh_propRootLogger "${ldc_value}" ;; - *) _log4sh_error "unrecognized properties keyword (${ldc_keyword})" ;; - esac - done - exec 0<&3 3<&- - - # activate all of the appenders - for ldc_appender in ${__log4shAppenders}; do - ${__LOG4SH_APPENDER_FUNC_PREFIX}${ldc_appender}_activateOptions - done - - # remove the temporary file - rm -f "${ldc_tmpFile}" - - unset ldc_appender ldc_file ldc_tmpFile ldc_line ldc_key ldc_keyword - unset ldc_value -} - -#/** -# -# -# void -# -# -# -# -# log4sh_readProperties -# string configFileName -# -# -# Deprecated as of 1.3.6 -# -# See log4sh_doConfigure. -# -# -# log4sh_readProperties myconfig.properties -# -# -# -#*/ -log4sh_readProperties() -{ - log4sh_doConfiguration "$@" -} - -#/** -# -# -# void -# -# -# -# -# log4sh_resetConfiguration -# -# -# -# -# This function completely resets the log4sh configuration to have no -# appenders with a global logging level of ERROR. -# -# -# log4sh_resetConfiguration -# -# -# -#*/ -# XXX if a configuration is *repeatedly* established via logger_addAppender and -# reset using this command, there is a risk of running out of memory. -log4sh_resetConfiguration() -{ - __log4shAppenders='' - __log4shAppenderCount=0 - __log4shAppenderCounts='' - __log4shAppenderLayouts='' - __log4shAppenderLevels='' - __log4shAppenderPatterns='' - __log4shAppenderTypes='' - __log4shAppender_file_files='' - __log4shAppender_rollingFile_maxBackupIndexes='' - __log4shAppender_rollingFile_maxFileSizes='' - __log4shAppender_smtp_tos='' - __log4shAppender_smtp_subjects='' - __log4shAppender_syslog_facilities='' - __log4shAppender_syslog_hosts='' - - logger_setLevel ERROR -} - -#============================================================================== -# Thread -# - -#/** -# -# -# string -# -# -# -# -# logger_getThreadName -# -# -# -# Gets the current thread name. -# -# threadName=`logger_getThreadName` -# -# -# -#*/ -logger_getThreadName() -{ - echo ${__log4sh_threadName} -} - -#/** -# -# -# void -# -# -# -# -# logger_setThreadName -# string threadName -# -# -# -# Sets the thread name (e.g. the name of the script). This thread name can -# be used with the '%t' conversion character within a -# . -# -# -# logger_setThreadName "myThread" -# -# -# -#*/ -logger_setThreadName() -{ - _thread=$1 - - _length=`_log4sh_getArrayLength "$__log4sh_threadStack"` - __log4sh_threadStack=`_log4sh_setArrayElement "$__log4sh_threadStack" $_length $_thread` - __log4sh_threadName=$_thread - - unset _index _thread -} - -#/** -# -# -# void -# -# -# -# -# logger_pushThreadName -# string threadName -# -# -# Deprecated as of 1.3.7 -# -# Sets the thread name (eg. the name of the script) and pushes the old on -# to a stack for later use. This thread name can be used with the '%t' -# conversion character within a . -# -# -# logger_pushThreadName "myThread" -# -# -# -#*/ -logger_pushThreadName() -{ - __log4sh_threadStack=`_log4sh_pushStack "$__log4sh_threadStack" $1` - __log4sh_threadName=$1 -} - -#/** -# -# -# void -# -# -# -# -# logger_popThreadName -# -# -# -# Deprecated as of 1.3.7 -# -# Removes the topmost thread name from the stack. The next thread name on -# the stack is then placed in the __log4sh_threadName -# variable. If the stack is empty, or has only one element left, then a -# warning is given that no more thread names can be popped from the stack. -# -# -# logger_popThreadName -# -# -# -#*/ -logger_popThreadName() -{ - _length=`_log4sh_getArrayLength "$__log4sh_threadStack"` - if [ $_length -gt 1 ]; then - __log4sh_threadStack=`_log4sh_popStack "$__log4sh_threadStack"` - __log4sh_threadName=`_log4sh_peekStack "$__log4sh_threadStack"` - else - echo 'log4sh:WARN no more thread names available on thread name stack.' >&2 - fi -} - -#============================================================================== -# Trap -# - -#/** -# -# -# void -# -# -# -# -# log4sh_cleanup -# -# -# -# This is a cleanup function to remove the temporary directory used by -# log4sh. It is provided for scripts who want to do log4sh cleanup work -# themselves rather than using the automated cleanup of log4sh that is -# invoked upon a normal exit of the script. -# -# log4sh_cleanup -# -# -# -#*/ -log4sh_cleanup() -{ - _log4sh_cleanup 'EXIT' -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_cleanup -# string signal -# -# -# This is a cleanup function to remove the temporary directory used by -# log4sh. It should only be called by log4sh itself when it is taking -# control of traps. -# If there was a previously defined trap for the given signal, log4sh -# will attempt to call the original trap handler as well so as not to break -# the parent script. -# -# _log4sh_cleanup EXIT -# -# -# -#*/ -_log4sh_cleanup() -{ - _lc__trap=$1 - ${__LOG4SH_INFO} "_log4sh_cleanup(): the ${_lc__trap} signal was caught" - - _lc__restoreTrap=${__LOG4SH_FALSE} - _lc__oldTrap='' - - # match trap to signal value - case "${_lc__trap}" in - EXIT) _lc__signal=0 ;; - INT) _lc__signal=2 ;; - TERM) _lc__signal=15 ;; - esac - - # do we possibly need to restore a previous trap? - if [ -r "${__log4sh_trapsFile}" -a -s "${__log4sh_trapsFile}" ]; then - # yes. figure out what we need to do - if [ `grep "^trap -- " "${__log4sh_trapsFile}" >/dev/null; echo $?` -eq 0 ] - then - # newer trap command - ${__LOG4SH_DEBUG} 'newer POSIX trap command' - _lc__restoreTrap=${__LOG4SH_TRUE} - _lc__oldTrap=`egrep "(${_lc__trap}|${_lc__signal})$" "${__log4sh_trapsFile}" |\ - sed "s/^trap -- '\(.*\)' [A-Z]*$/\1/"` - elif [ `grep "[0-9]*: " "${__log4sh_trapsFile}" >/dev/null; echo $?` -eq 0 ] - then - # older trap command - ${__LOG4SH_DEBUG} 'older style trap command' - _lc__restoreTrap=${__LOG4SH_TRUE} - _lc__oldTrap=`grep "^${_lc__signal}: " "${__log4sh_trapsFile}" |\ - sed 's/^[0-9]*: //'` - else - # unrecognized trap output - _log4sh_error 'unable to restore old traps! unrecognized trap command output' - fi - fi - - # do our work - rm -fr "${__log4sh_tmpDir}" - - # execute the old trap - if [ ${_lc__restoreTrap} -eq ${__LOG4SH_TRUE} -a -n "${_lc__oldTrap}" ]; then - ${__LOG4SH_INFO} 'restoring previous trap of same type' - eval "${_lc__oldTrap}" - fi - - # exit for all non-EXIT signals - if [ "${_lc__trap}" != 'EXIT' ]; then - # disable the EXIT trap - trap 0 - - # add 127 to signal value and exit - _lc__signal=`expr ${_lc__signal} + 127` - exit ${_lc__signal} - fi - - unset _lc__oldTrap _lc__signal _lc__restoreTrap _lc__trap - return -} - - -#============================================================================== -# main -# - -# create a temporary directory -__log4sh_tmpDir=`_log4sh_mktempDir` - -# preserve old trap(s) -__log4sh_trapsFile="${__log4sh_tmpDir}/traps" -trap >"${__log4sh_trapsFile}" - -# configure traps -${__LOG4SH_INFO} 'setting traps' -trap '_log4sh_cleanup EXIT' 0 -trap '_log4sh_cleanup INT' 2 -trap '_log4sh_cleanup TERM' 15 - -# alternative commands -log4sh_setAlternative mail "${LOG4SH_ALTERNATIVE_MAIL:-mail}" ${__LOG4SH_TRUE} -[ -n "${LOG4SH_ALTERNATIVE_NC:-}" ] \ - && log4sh_setAlternative nc "${LOG4SH_ALTERNATIVE_NC}" - -# load the properties file -${__LOG4SH_TRACE} "__LOG4SH_CONFIGURATION='${__LOG4SH_CONFIGURATION}'" -if [ "${__LOG4SH_CONFIGURATION}" != 'none' -a -r "${__LOG4SH_CONFIGURATION}" ] -then - ${__LOG4SH_INFO} 'configuring via properties file' - log4sh_doConfigure "${__LOG4SH_CONFIGURATION}" -else - if [ "${__LOG4SH_CONFIGURATION}" != 'none' ]; then - _log4sh_warn 'No appenders could be found.' - _log4sh_warn 'Please initalize the log4sh system properly.' - fi - ${__LOG4SH_INFO} 'configuring at runtime' - - # prepare the environment for configuration - log4sh_resetConfiguration - - # note: not using the constant variables here (e.g. for ConsoleAppender) so - # that those perusing the code can have a working example - logger_setLevel ${__LOG4SH_LEVEL_ERROR_STR} - logger_addAppender stdout - appender_setType stdout ConsoleAppender ${__LOG4SH_FALSE} - appender_setLayout stdout PatternLayout ${__LOG4SH_FALSE} - appender_setPattern stdout '%-4r [%t] %-5p %c %x - %m%n' -fi - -# restore the previous set of shell flags -for _log4sh_shellFlag in ${__LOG4SH_SHELL_FLAGS}; do - echo ${__log4sh_oldShellFlags} |grep ${_log4sh_shellFlag} >/dev/null \ - || set +${_log4sh_shellFlag} -done -unset _log4sh_shellFlag - -#/** -#
-#*/ diff --git a/1.3/src/test/log4sh.properties b/1.3/src/test/log4sh.properties deleted file mode 100644 index a9ce0b8..0000000 --- a/1.3/src/test/log4sh.properties +++ /dev/null @@ -1,25 +0,0 @@ -# $Id$ - -# set root logger to ERROR, and give it two appenders; stderr and R -log4sh.rootLogger = INFO, mySTDERR, mySimple, myPattern, mySyslog - -# add a file appender at the default level that logs to STDERR -log4sh.appender.mySTDERR = FileAppender -log4sh.appender.mySTDERR.File = STDERR - -# add a file appender at the DEBUG level with the default layout -log4sh.appender.mySimple = FileAppender -log4sh.appender.mySimple.Threshold = DEBUG -log4sh.appender.mySimple.File = log4sh-simple.log - -# add a file appender at the default level with a Pattern layout -log4sh.appender.myPattern = RollingFileAppender -log4sh.appender.myPattern.File = log4sh-pattern.log -log4sh.appender.myPattern.layout = PatternLayout -log4sh.appender.myPattern.layout.ConversionPattern = %d [%p] (%F) - %m%n - -# add a syslog appender at the default level with a facility of local4 -log4sh.appender.mySyslog = SyslogAppender -log4sh.appender.mySyslog.Facility = local4 -log4sh.appender.mySyslog.layout = PatternLayout -log4sh.appender.mySyslog.layout.ConversionPattern = [%p] (%F) - %m diff --git a/1.3/src/test/priorityMatrix.data b/1.3/src/test/priorityMatrix.data deleted file mode 100644 index d61a334..0000000 --- a/1.3/src/test/priorityMatrix.data +++ /dev/null @@ -1,18 +0,0 @@ -# $Id$ -# -# column definitions -# priority -# which priorities should generate a message -# -# note: the default IFS in pure POSIX shells seems to parse only spaces when -# using the 'read' builtin. as such, only spaces are used as separation -# characters below. -# -# priority TRACE DEBUG INFO WARN ERROR FATAL -TRACE 1 1 1 1 1 1 -DEBUG 0 1 1 1 1 1 -INFO 0 0 1 1 1 1 -WARN 0 0 0 1 1 1 -ERROR 0 0 0 0 1 1 -FATAL 0 0 0 0 0 1 -OFF 0 0 0 0 0 0 diff --git a/1.3/src/test/run-test-suite b/1.3/src/test/run-test-suite deleted file mode 100755 index c1257ad..0000000 --- a/1.3/src/test/run-test-suite +++ /dev/null @@ -1,116 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -SHELLS='/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh' -for f in test[A-Z]*; do - [ -x "${f}" ] && TESTS="${TESTS:+${TESTS} }${f}" -done - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -usage() -{ - echo "usage: ${MY_NAME} [-e key=val ...] [-s shell(s)] [-t test(s)]" -} - -# process command line flags -while getopts 'e:hs:t:' opt; do - case ${opt} in - e) - key=`expr "${OPTARG}" : '\([^=]*\)='` - val=`expr "${OPTARG}" : '[^=]*=\(.*\)'` - if [ -z "${key}" -o -z "${val}" ]; then - usage - exit 1 - fi - eval "${key}='${val}'" - export ${key} - env="${env:+${env} }${key}" - ;; - h) usage; exit 0 ;; - s) shells=${OPTARG} ;; - t) tests=${OPTARG} ;; - *) usage; exit 1 ;; - esac -done -shift `expr ${OPTIND} - 1` - -# fill shells and/or tests -shells=${shells:-${SHELLS}} -tests=${tests:-${TESTS}} - -# error checking -if [ -z "${tests}" ]; then - tf_error 'no tests found to run; exiting' - exit 1 -fi - -cat <&1` - exitVal=$? - if [ ${exitVal} -eq 2 ]; then - echo - echo "${version}" - fi - ;; - pdksh) ;; - zsh) ;; - esac - - # execute the tests - for suite in ${tests}; do - suiteName=`expr "${suite}" : 'test\(.*\)'` - echo - echo "--- Executing the '${suiteName}' test suite ---" >&2 - ( exec ${shell} ./${suite}; ) - done -done diff --git a/1.3/src/test/test-common b/1.3/src/test/test-common deleted file mode 100644 index 3ba98fa..0000000 --- a/1.3/src/test/test-common +++ /dev/null @@ -1,163 +0,0 @@ -# $Id$ -# vim:syntax=sh:sw=2:ts=2:expandtab -# -# Author: Kate Ward -# -# The spiffy Simsons comments were shamelessly pulled from the lf5 examples -# from log4j. -# - -# -# setup the initial logging environment -# - -smtpEmail="postmaster@localhost" -syslogFacility="local4" - -# -# do some logging -# - -# log some at the DEBUG level -logger_debug "Hello, my name is Homer Simpson." -logger_debug "Hello, my name is Lisa Simpson." -logger_debug "Hello, my name is Marge Simpson." -logger_debug "Hello, my name is Bart Simpson." -logger_debug "Hello, my name is Maggie Simpson." - -# log some at the INFO level -logger_info "We are the Simpsons!" -logger_info "Mmmmmm .... Chocolate." -logger_info "Homer likes chocolate" -logger_info "Doh!" -logger_info "We are the Simpsons!" - -# log some at the WARN level -logger_warn "Bart: I am through with working! Working is for chumps!\ - Homer: Son, I'm proud of you. I was twice your age before\ - I figured that out." -logger_warn "Mmm...forbidden donut." -logger_warn "D'oh! A deer! A female deer!" -logger_warn "Truly, yours is a butt that won't quit.\ - - Bart, writing as Woodrow to Ms. Krabappel." - -# set the level of the mySTDERR appender to OFF -appender_setLevel mySTDERR OFF - -# log some at the ERROR level -logger_error "Dear Baby, Welcome to Dumpsville. Population: you." -logger_error "Mr. Hutz, are you aware you're not wearing pants?" - -# set the mySTDERR level to DEBUG -appender_setLevel mySTDERR DEBUG - -# log some at the FATAL level -logger_fatal "Eep." -logger_fatal "Mmm...forbidden donut." -logger_fatal "D'oh! A deer! A female deer!" -logger_fatal "Mmmmmm .... Chocolate." - -# various setting changes -appender_setLayout mySTDERR PatternLayout -logger_info "test of the default pattern layout" - -appender_setPattern mySTDERR '%d [%F] %p - %m%n' -logger_info "test of setting a pattern layout" - -appender_setPattern mySTDERR '%d %p - %m%n' -logger_info "test of setting a pattern layout again" - -appender_setPattern mySimple '%d [%F] %p - %m' -logger_info "setting a pattern for a simple layout logger. should not change the pattern of the simple logger as it is still set to a simple layout." - -# manually set the value of the filename flag -logger_setFilename "myFilename" -appender_setPattern myPattern '%d [%F] %p - %m%n' -logger_info "setting a new pattern for a patterned layout file logger" - -appender_setPattern myPattern '%d [%f] %p - %m%n' -logger_info "setting a pattern for a patterned layout file logger, using an invalid character conversion." - -appender_setPattern myPattern '%d %p - %m%n' -logger_info "setting the pattern for the patterned layout file logger back to a reasonable value." - -# close some appenders -logger_info "closing the myFilename appender" -appender_close myFilename - -# test the *ThreadName functions -appender_setPattern mySTDERR '%p [%F:%t]: %m%n' -logger_info "setting a pattern layout for STDERR that uses the thread name conversion character. the thread name isn't set yet, so it should be the default value ('main' as of this writing)..." -logger_setThreadName myThread -logger_info "the thread name is now set to the name of this script, so it should show up in output now" -logger_info "will now 'push' a new thread 'myNewThread' on the thread name stack..." -logger_pushThreadName "myNewThread" -logger_info "checking to see if the thread name changed. did it?" -thread=`logger_getThreadName` -logger_info "just 'got' the thread name of '$thread'. does it match what is shown over on the left?" -logger_pushThreadName "mySecondNewThread" -logger_pushThreadName "myThirdNewThread" -logger_info "just pushed two threads named 'mySecondNewThread' and 'myThirdNewThread'. verify that the later is visible on the left, and that they pop off correctly." -for f in 1 2; do - thread=`logger_getThreadName` - logger_popThreadName - logger_info "popped the thread named '${thread}'" -done -logger_popThreadName -logger_info "I just popped the topmost thread name. the first thread name should be shown again. is it?" -logger_popThreadName -logger_info "I just tried popping again. the thread name should not have changed as we were already at the topmost thread name. there should have been a log4sh warning as well." - -# test the smtp appender -logger_addAppender mySMTP -appender_setAppenderType mySMTP SMTPAppender -appender_setLevel mySMTP FATAL -appender_smtp_setSubject mySMTP "test subject" -appender_smtp_setTo mySMTP $smtpEmail -logger_info "this message *should not* generate an email." -logger_fatal "this message *should* generate an email to '$smtpEmail'." -appender_close mySMTP - -# test the extra syslog appender functions -syslogFacilityResult=`appender_syslog_getFacilityByName mySyslog` -logger_info "just requested the syslog facility for the mySyslog appender. I expected '$syslogFacility' and got '$syslogFacilityResult'. do they match?" -logger_info "closing the mySyslog appender" -appender_close mySyslog - -# test the sending of multiple options to a logger function -logger_info this is a test message without quotes to verify that a logging function can be called without wrapping the message in quotes. - -# testing %X conversion character - MDC (Mapped Diagnostic Context) -logger_info "the next test tests the %X and %% conversion characters" -appender_setPattern mySTDERR '%d %p [%X{percent}%%] - %m%n' -percent=30 -logger_info "got some work done" -percent=75 -logger_info "got some work more done" -percent=100 -logger_info "our work is done" -appender_setPattern mySTDERR '%d %p - %m%n' - -# workaround implementation of separated date and time -logInfo() { mdcD=`date "+%Y-%m-%d"`;mdcT=`date "+%H:%M:%S"`;logger_info "$@"; } - -appender_setPattern mySTDERR '%X{mdcD}|%X{mdcT}|%m%n' -logInfo "MDC test including the date/time" -appender_setPattern mySTDERR '%d %p - %m%n' - -# test proper parsing of the '\' and '&' characters -logger_info "this message should have a backslash character hier >\<" -logger_info "this message should have an andpersand character hier >&<" - -# test grabbing output from some various commands -logger_info "this system's uname: `uname -a`" -logger_info "output of 'ls -l': `ls -l`" - -# test sending things to log4sh via pipes -echo "if this message is seen, then the sending of a message via a pipe works" |logger_info -# try the same 'ls -l' like above, but with a pipe -logger_info "output of 'ls -l' [again] via pipe in next logging statement..." -ls -l |logger_info - -# test the calling of the previous trap handler -logger_info "after this message, you should see a non-log4sh message that a cleanup function was called. if you do, than you know that the trap handler of this test script was called, and that log4sh was able to properly call that handler upon exit." diff --git a/1.3/src/test/test-functions.inc b/1.3/src/test/test-functions.inc deleted file mode 100644 index baff8df..0000000 --- a/1.3/src/test/test-functions.inc +++ /dev/null @@ -1,84 +0,0 @@ -# $Id$ -# vim:syntax=sh:sts=2 - -# -# constants -# - -# configure debugging. set the DEBUG environment variable to any -# non-empty value to enable debug output, or TRACE to enable trace -# output. -TRACE=${TRACE:+'tf_trace '} -[ -n "${TRACE}" ] && DEBUG=1 -[ -z "${TRACE}" ] && TRACE=':' - -DEBUG=${DEBUG:+'tf_debug '} -[ -z "${DEBUG}" ] && DEBUG=':' - -# -# variables -# - -tf_RANDOM=0 - -# -# functions -# - -# message functions -tf_trace() { echo "${MY_NAME}:TRACE $@" >&2; } -tf_debug() { echo "${MY_NAME}:DEBUG $@" >&2; } -tf_info() { echo "${MY_NAME}:INFO $@" >&2; } -tf_warn() { echo "${MY_NAME}:WARN $@" >&2; } -tf_error() { echo "${MY_NAME}:ERROR $@" >&2; } -tf_fatal() { echo "${MY_NAME}:FATAL $@" >&2; } - -# generate a random number -tf_generateRandom() -{ - tfgr_random=${tf_RANDOM} - - while [ "${tfgr_random}" = "${tf_RANDOM}" ]; do - if [ -n "${RANDOM:-}" ]; then - # $RANDOM works - tfgr_random=${RANDOM}${RANDOM}${RANDOM}$$ - elif [ -r '/dev/urandom' ]; then - tfgr_random=`od -vAn -N4 -tu4 -# - -# find myself -whoAmI=`basename $0` -whereAmI=`dirname $0` -whereAmI=`cd "${whereAmI}" 2>/dev/null && pwd || echo "${whereAmI}"` - -#----------------------------------------------------------------------------- -# functions -# - -test_cleanup() -{ - echo '### test script cleanup function called###' -} - -loadLog4sh() -{ - config="$1" - - if [ -r log4sh ]; then - LOG4SH_CONFIGURATION="${config}" . ./log4sh - else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 - fi - logger_trace "whoAmI=${whoAmI} whereAmI=${whereAmI}" -} - -#----------------------------------------------------------------------------- -# pre-configure log4sh -# -# the functions called in this section are meant to exactly reproduce what the -# runtime configuration test script does so that the common tests that are run -# generate the same output. - -configLog4sh() -{ - : -} - -#----------------------------------------------------------------------------- -# main -# - -# setup trap handler. must be done before loading log4sh -trap 'test_cleanup' EXIT - -# load and configure log4sh -loadLog4sh -configLog4sh - -# load and run the common tests -commonTests='test-common' -if [ -r "${commonTests}" ]; then - . ${whereAmI}/${commonTests} -else - logger_fatal "could not load the common tests" - exit 1 -fi diff --git a/1.3/src/test/test-runtime-config b/1.3/src/test/test-runtime-config deleted file mode 100755 index 3ea4de1..0000000 --- a/1.3/src/test/test-runtime-config +++ /dev/null @@ -1,96 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# - -# find myself -whoAmI=`basename $0` -whereAmI=`dirname $0` -whereAmI=`cd "${whereAmI}" 2>/dev/null && pwd || echo "${whereAmI}"` - -#----------------------------------------------------------------------------- -# functions -# - -test_cleanup() -{ - echo '### test script cleanup function called###' -} - -loadLog4sh() -{ - config="$1" - - if [ -r log4sh ]; then - LOG4SH_CONFIGURATION="${config}" . ./log4sh - else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 - fi - logger_trace "whoAmI=${whoAmI} whereAmI=${whereAmI}" -} - -#----------------------------------------------------------------------------- -# pre-configure log4sh -# -# the functions called in this section are meant to exactly reproduce what the -# log4sh.properties does so that the common tests that are run generate the -# same output. -# - -configLog4sh() -{ - # reset the log4sh configuration - log4sh_resetConfiguration - - # setup the default logging level to INFO - logger_setLevel INFO - - # add a file appender at the default level that logs to STDERR - logger_addAppender mySTDERR - appender_setType mySTDERR FileAppender - appender_file_setFile mySTDERR STDERR - appender_activateOptions mySTDERR - - # add a file appender at the DEBUG level with the default layout - logger_addAppender mySimple - appender_setLevel mySimple DEBUG - appender_setType mySimple FileAppender - appender_file_setFile mySimple log4sh-simple.log - appender_activateOptions mySimple - - # add file appender at the default level with a Pattern layout - logger_addAppender myPattern - appender_setType myPattern RollingFileAppender - appender_file_setFile myPattern log4sh-pattern.log - appender_setLayout myPattern PatternLayout - appender_setPattern myPattern '%d [%p] (%F) - %m%n' - appender_activateOptions myPattern - - # add a syslog appender at the default level with a facility of local4 - logger_addAppenderWithPattern mySyslog '[%p] (%F) - %m%n' - appender_setType mySyslog SyslogAppender - appender_syslog_setFacility mySyslog local4 - appender_activateOptions mySyslog -} - -#----------------------------------------------------------------------------- -# main -# - -# setup trap handler. must be done before loading log4sh -trap 'test_cleanup' EXIT - -# load and configure log4sh -loadLog4sh none -configLog4sh - -# load and run the common tests -commonTests='test-common' -if [ -r "${commonTests}" ]; then - . ${whereAmI}/${commonTests} -else - logger_fatal "could not load the common tests" - exit 1 -fi diff --git a/1.3/src/test/testAsciiCharset b/1.3/src/test/testAsciiCharset deleted file mode 100755 index e738c2b..0000000 --- a/1.3/src/test/testAsciiCharset +++ /dev/null @@ -1,55 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -TEST_DATA="${MY_NAME}.data" - -#------------------------------------------------------------------------------ -# suite tests -# - -testAsciiCharset() -{ - # save stdin, and redirect it from a file - exec 9<&0 <"${TEST_DATA}" - while read expected; do - # ignore comment lines or blank lines - echo "${expected}" |egrep -v '^(#|$)' >/dev/null || continue - - actual="`logger_info \"${expected}\"`" - ${DEBUG} echo "expected='${expected}' actual='${actual}'" - assertEquals "'${expected}' != '${actual}'" "${expected}" "${actual}" - done - # restore stdin - exec 0<&9 9<&- -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION="${MY_NAME}.log4sh" . ./log4sh -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testAsciiCharset -} - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit diff --git a/1.3/src/test/testAsciiCharset.data b/1.3/src/test/testAsciiCharset.data deleted file mode 100644 index 48ef51d..0000000 --- a/1.3/src/test/testAsciiCharset.data +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ - -# 20-2F (escaping the leading space) -\ !"#$%&'()*+,-./ - -# 30-3F -0123456789:;<=>? - -# 40-4F -@ABCDEFGHIJKLMNO - -# 50-5F (escaping the backslash) -PQRSTUVWXYZ[\\]^_ - -# 60-6F -`abcdefghijklmno - -# 70-7E (7F is the unprintable DEL char) -pqrstuvwxzy{|}~ diff --git a/1.3/src/test/testAsciiCharset.log4sh b/1.3/src/test/testAsciiCharset.log4sh deleted file mode 100644 index ab50579..0000000 --- a/1.3/src/test/testAsciiCharset.log4sh +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ -log4sh.rootLogger = INFO, mySTDOUT - -log4sh.appender.mySTDOUT = ConsoleAppender -log4sh.appender.mySTDOUT.layout = PatternLayout -log4sh.appender.mySTDOUT.layout.ConversionPattern = %m%n diff --git a/1.3/src/test/testCustomMDCPatterns b/1.3/src/test/testCustomMDCPatterns deleted file mode 100755 index a3868bd..0000000 --- a/1.3/src/test/testCustomMDCPatterns +++ /dev/null @@ -1,148 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -debug() { echo "${MY_NAME}:DEBUG $@" >&2; } -DEBUG=${DEBUG:+'debug '} -[ -z "${DEBUG}" ] && DEBUG=':' -${DEBUG} 'debugging enabled' - -APP_NAME='stdout' - -#------------------------------------------------------------------------------ -# suite tests -# - -testCustomDateMDC() -{ - mdcDateFmt='+%Y.%m.%d' - pattern='%X{mdcDate}' - regex='^[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}' - - # define custom logger_info function - my_logger_info() - { - mdcDate=`date ${mdcDateFmt}` - log INFO "$@" - } - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`my_logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "dateFormat='${mdcDateFmt}' pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testCustomTimeMDC() -{ - mdcTimeFmt='+%H:%M:%S' - pattern='%X{mdcTime}' - regex='^[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - - # define custom logger_info function - my_logger_info() - { - mdcTime=`date ${mdcTimeFmt}` - log INFO "$@" - } - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`my_logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "timeFormat='${mdcTimeFmt}' pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testCustomUserHostMDC() -{ - pattern='%X{USER}@%X{HOSTNAME}' - regex='[A-Za-z0-9]*@[-.A-Za-z0-9]*' - - # set variables (if needed) - if [ -z "${HOSTNAME:-}" ]; then - HOSTNAME=`hostname` - export HOSTNAME - fi - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - resultFile="${__shunit_tmpDir}/result.dat" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration - - # configure log4sh - logger_setLevel INFO - logger_addAppender ${APP_NAME} - appender_setLayout ${APP_NAME} PatternLayout -} - -tearDown() -{ - rm -f "${resultFile}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testCustomDateMDC - suite_addTest testCustomTimeMDC - suite_addTest testCustomUserHostMDC -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testFileAppender b/1.3/src/test/testFileAppender deleted file mode 100755 index e12d408..0000000 --- a/1.3/src/test/testFileAppender +++ /dev/null @@ -1,205 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_ACCESSORS='accessors' -APP_ACCESSORS_FILE='' -APP_ACCESSORS_LOG4SH="${MY_NAME}-${APP_ACCESSORS}.log4sh" - -APP_SIMPLE='mySimple' -APP_SIMPLE_FILE='' -APP_SIMPLE_LOG4SH="${MY_NAME}-${APP_SIMPLE}.log4sh" - -APP_STDERR='mySTDERR' -APP_STDERR_LOG4SH="${MY_NAME}-${APP_STDERR}.log4sh" - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -commonSTDERR() -{ - assert=$1 - msg=$2 - cmd=$3 - - ${DEBUG} "sending a message to ${APP_STDERR}" - result=`eval ${cmd}` - ${DEBUG} "assert='${assert}' cmd='${cmd}' result='${result}'" - eval ${assert} \"${msg}\" \"${result}\" -} - -testSTDERR_runtime() -{ - # runtime configure a STDERR FileAppender - logger_setLevel INFO - logger_addAppender ${APP_STDERR} - appender_setType ${APP_STDERR} FileAppender - appender_file_setFile ${APP_STDERR} STDERR - appender_activateOptions ${APP_STDERR} - - commonSTDERR \ - 'assertNotNull' \ - "${APP_STDERR} runtime FileAppender didn't go to STDERR" \ - "logger_info \'dummy\' 2>&1 >/dev/null" \ - || return - - commonSTDERR \ - 'assertNull' \ - "${APP_STDERR} runtime FileAppender went to STDOUT" \ - "logger_info \'dummy\' 2>/dev/null" \ - || return -} - -testSTDERR_config() -{ - # configure a STDERR FileAppender via config - log4sh_doConfigure "${APP_STDERR_LOG4SH}" - - commonSTDERR \ - 'assertNotNull' \ - "${APP_STDERR} config FileAppender didn't go to STDERR" \ - "logger_info \'dummy\' 2>&1 1>/dev/null" \ - || return - - commonSTDERR \ - 'assertNull' \ - "${APP_STDERR} config FileAppender went to STDOUT" \ - "logger_info \'dummy\' 2>/dev/null" \ - || return -} - -commonSimple() -{ - assert=$1 - msg=$2 - cmd=$3 - - ${DEBUG} "sending a message to ${APP_SIMPLE}" - result=`eval ${cmd}` - ${DEBUG} "assert='${assert}' cmd='${cmd}' result='${result}'" - eval ${assert} \"${msg}\" \"${result}\" -} - -testSimple_runtime() -{ - # runtime configure a simple ConsoleAppender - logger_setLevel INFO - logger_addAppender ${APP_SIMPLE} - appender_setLevel ${APP_SIMPLE} DEBUG - appender_setType ${APP_SIMPLE} FileAppender - appender_file_setFile ${APP_SIMPLE} "${APP_SIMPLE_FILE}" - appender_activateOptions ${APP_SIMPLE} - - commonSimple \ - 'assertNull' \ - "${APP_SIMPLE} config FileAppender went to STDOUT or STDERR" \ - "logger_info \'dummy\' 2>&1" \ - || return - - commonSimple \ - 'assertNotNull' \ - "${APP_SIMPLE} config FileAppender didn't go to file" \ - "logger_info \'dummy\' 2>&1; cat \"${APP_SIMPLE_FILE}\"" \ - || return -} - -testSimple_config() -{ - # configure a simple ConsoleAppender via config - log4sh_doConfigure "${APP_SIMPLE_LOG4SH}" - - commonSimple \ - 'assertNull' \ - "${APP_SIMPLE} runtime FileAppender went to STDOUT or STDERR" \ - "logger_info \'dummy\' 2>&1" \ - || return - - commonSimple \ - 'assertNotNull' \ - "${APP_SIMPLE} runtime FileAppender didn't go to file" \ - "logger_info \'dummy\'; cat ${APP_SIMPLE_FILE}" \ - || return -} - -# test that the filename set in the configuration file is readable -# programatically -testAccessors_getFilename() -{ - # configure log4sh via config - log4sh_doConfigure "${APP_ACCESSORS_LOG4SH}" - - fileName=`appender_file_getFile ${APP_ACCESSORS}` - assertEquals \ - "${APP_ACCESSORS} file '${fileName}' was not '${APP_ACCESSORS_FILE}'" \ - "${fileName}" "${APP_ACCESSORS_FILE}" -} - -# test that setting the filename of an appender actually changes it -testAccessors_setgetFilename() -{ - # configure log4sh via config - log4sh_doConfigure "${APP_ACCESSORS_LOG4SH}" - - newFileName='/var/tmp/accessors.log' - - # the current filename should be what is stored in ${APP_ACCESSORS_FILE}. - # changing it to /var/tmp/accessors.log - appender_file_setFile ${APP_ACCESSORS} "${newFileName}" - - # now, re-reading the file name to verify - fileName=`appender_file_getFile ${APP_ACCESSORS}` - assertEquals \ - "${APP_ACCESSORS} file was not ${newFileName}" \ - "${fileName}" "${newFileName}" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - APP_ACCESSORS_FILE="${__shunit_tmpDir}/myAccessors.out" - APP_SIMPLE_FILE="${__shunit_tmpDir}/mySimple.out" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - rm -f "${APP_ACCESSORS_FILE}" "${APP_SIMPLE_FILE}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testSTDERR_runtime - suite_addTest testSTDERR_config - - suite_addTest testSimple_runtime - suite_addTest testSimple_config - - suite_addTest testAccessors_getFilename - suite_addTest testAccessors_setgetFilename -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testFileAppender-accessors.log4sh b/1.3/src/test/testFileAppender-accessors.log4sh deleted file mode 100644 index 186d64b..0000000 --- a/1.3/src/test/testFileAppender-accessors.log4sh +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -# set root logger to INFO, and give it one appender mySTDERR -log4sh.rootLogger = INFO, accessors - -# add a file appender -log4sh.appender.accessors = FileAppender -log4sh.appender.accessors.File = ${APP_ACCESSORS_FILE} diff --git a/1.3/src/test/testFileAppender-mySTDERR.log4sh b/1.3/src/test/testFileAppender-mySTDERR.log4sh deleted file mode 100644 index 8941be1..0000000 --- a/1.3/src/test/testFileAppender-mySTDERR.log4sh +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ - -log4sh.rootLogger = INFO, mySTDERR - -log4sh.appender.mySTDERR = FileAppender -log4sh.appender.mySTDERR.File = STDERR diff --git a/1.3/src/test/testFileAppender-mySimple.log4sh b/1.3/src/test/testFileAppender-mySimple.log4sh deleted file mode 100644 index 8ebd71f..0000000 --- a/1.3/src/test/testFileAppender-mySimple.log4sh +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -log4sh.rootLogger = INFO, mySimple - -log4sh.appender.mySimple = FileAppender -log4sh.appender.mySimple.Threshold = DEBUG -log4sh.appender.mySimple.File = ${APP_SIMPLE_FILE} diff --git a/1.3/src/test/testMultipleAppenders b/1.3/src/test/testMultipleAppenders deleted file mode 100755 index 2720581..0000000 --- a/1.3/src/test/testMultipleAppenders +++ /dev/null @@ -1,86 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_ONE_NAME="appenderOne" -APP_ONE_FILE="${MY_NAME}-one.log" -APP_TWO_NAME="appenderTwo" -APP_TWO_FILE="${MY_NAME}-two.log" - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testTwoSimilarFileAppenders() -{ - # configure log4sh - logger_setLevel INFO - - # setup first appender - logger_addAppender ${APP_ONE_NAME} - appender_setType ${APP_ONE_NAME} FileAppender - appender_file_setFile ${APP_ONE_NAME} "${APP_ONE_FILE}" - appender_activateOptions ${APP_ONE_NAME} - - # setup second appender - logger_addAppender ${APP_TWO_NAME} - appender_setType ${APP_TWO_NAME} FileAppender - appender_file_setFile ${APP_TWO_NAME} "${APP_TWO_FILE}" - appender_activateOptions ${APP_TWO_NAME} - - # log a message - tf_generateRandom - random=${tf_RANDOM} - logger_info "dummy message ${random}" - - # verify first appender - matched=`tail "${APP_ONE_FILE}" |grep "${random}"` - assertNotNull \ - 'first appender did not properly receive message' \ - "${matched}" - - # verify second appender - matched=`tail "${APP_TWO_FILE}" |grep "${random}"` - assertNotNull \ - 'second appender did not properly receive message' \ - "${matched}" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - log4sh_resetConfiguration -} - -oneTimeTearDown() -{ - rm "${APP_ONE_FILE}" "${APP_TWO_FILE}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testTwoSimilarFileAppenders -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testPatternLayout b/1.3/src/test/testPatternLayout deleted file mode 100755 index 87a9b3a..0000000 --- a/1.3/src/test/testPatternLayout +++ /dev/null @@ -1,253 +0,0 @@ -#! /bin/sh -# $Id$ - -myName=`basename $0` -myPath=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -APP_NAME='stdout' - -#------------------------------------------------------------------------------ -# suite tests -# - -commonPatternAssert() -{ - pattern=$1 - expected=$2 - msg=$3 - - appender_setPattern ${APP_NAME} "${pattern}" - actual=`logger_info 'dummy'` - ${DEBUG} echo "pattern='${pattern}' expected='${expected}' actual='${actual}'" - msg=`eval "echo \"${msg}\""` - assertEquals "${msg}" "${expected}" "${actual}" -} - -testCategoryPattern() -{ - pattern='%c' - expected='shell' - msg="category '%c' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -commonDatePatternAssert() -{ - pattern=$1 - regex=$2 - - appender_setPattern ${APP_NAME} "${pattern}" - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "date pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNull \ - "date pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testDatePattern() -{ - # without conversion specifier (Unix date format '+%Y-%m-%d %H:%M:%S') - pattern='%d' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return - - # ISODATE conversion specifier - pattern='%d{ISODATE}' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return - - # custom conversion specifier - pattern='%d{HH:mm:ss,SSS}' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return -} - -testFileNamePattern() -{ - pattern='%F' - expected="${myName}" - msg="file name '%F' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testLineNumberPattern() -{ - pattern='%L' - expected='' - msg="line number '%L' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testLineSeparatorPattern() -{ - pattern='%n' - expected='' - msg="line separator '%n' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testMessagePattern() -{ - pattern='%m' - expected='dummy' - msg="message '%m' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -commonPriorityPatternAssert() -{ - expected=$2 - msg=$3 - - appender_setPattern ${APP_NAME} "${pattern}" - actual=`logger_info 'dummy'` - ${DEBUG} echo "pattern='${pattern}' expected='${expected}' actual='${actual}'" - msg=`eval echo "${msg}"` - assertEquals "${msg}" "${expected}" "${actual}" -} - -# note: this function using the base log() function rather than the logger_*() -# functions as the functionality is effectively the same -testPriorityPattern() -{ - currPriority=`appender_getLevel ${APP_NAME}` - - pattern='%p' - appender_setPattern ${APP_NAME} "${pattern}" - for priority in TRACE DEBUG INFO WARN ERROR FATAL; do - appender_setLevel ${APP_NAME} ${priority} - result=`log ${priority} 'dummy'` - ${DEBUG} echo "pattern='${pattern}' priority='${priority}' result='${result}'" - assertEquals \ - "priority pattern '${pattern}' failed: the requested priority of '${priority}' does not match the returned priority of '${result}'" \ - "${priority}" "${result}" || break - done - - appender_setLevel ${APP_NAME} ${currPriority} -} - -testRunningTimePattern() -{ - pattern='%r' - regex='^[0-9]*(\.[0-9]*){0,1}$' - - appender_setPattern ${APP_NAME} "${pattern}" - result=`logger_info 'dummy'` - matched=`echo "${result}" |egrep "${regex}"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "running time pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNotNull \ - "running time pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testThreadNamePattern() -{ - pattern='%t' - expected=${__LOG4SH_THREAD_DEFAULT} - msg="thread name '%t' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -# NDC (Nested Diagnostic Context) -testNDCPattern() -{ - pattern='%x' - expected='' - msg="NDC '%x' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -# MDC (Mapped Diagnostic Context) -testMDCPattern() -{ - msg="MDC '\${pattern}' pattern failed: '\${expected}' != '\${actual}'" - - pattern='%X{USER}' - expected=${USER} - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return - - # the %X pattern should not parse unless it has an environment variable name - # enclosed in {} chars following the 'X' - pattern='%X' - expected=${pattern} - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testPercentPattern() -{ - pattern='%%' - expected='%' - msg="percent '\${pattern}' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testDefaultPattern() -{ - # the pattern should be '%d %p - %m%n' - pattern=${__LOG4SH_PATTERN_DEFAULT} - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "default pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNull \ - "default pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION='none' . ./log4sh - logger_setLevel INFO - appender_setLayout ${APP_NAME} PatternLayout -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testCategoryPattern - suite_addTest testDatePattern - suite_addTest testFileNamePattern - suite_addTest testLineNumberPattern - suite_addTest testLineSeparatorPattern - suite_addTest testMessagePattern - suite_addTest testPriorityPattern - suite_addTest testRunningTimePattern - suite_addTest testThreadNamePattern - suite_addTest testNDCPattern - suite_addTest testMDCPattern - suite_addTest testPercentPattern -} - -# need working egrep. the one for Solaris is in /usr/xpg4/bin, so we will add -# that to the path -PATH="/usr/xpg4/bin:${PATH}" - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit diff --git a/1.3/src/test/testPriority b/1.3/src/test/testPriority deleted file mode 100755 index 2a80350..0000000 --- a/1.3/src/test/testPriority +++ /dev/null @@ -1,81 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -APP_NAME='stdout' -TEST_DATA="priorityMatrix.data" - -#------------------------------------------------------------------------------ -# suite tests -# - -testPriorityMatrix() -{ - PRIORITY_NAMES='TRACE DEBUG INFO WARN ERROR FATAL' - PRIORITY_POS='1 2 3 4 5 6' - - # save stdin, and redirect it from a file - exec 9<&0 <"${TEST_DATA}" - while read priority outputs; do - # ignore comment lines or blank lines - echo "${priority}" |egrep -v '^(#|$)' >/dev/null || continue - - ${DEBUG} echo "setting appender priority to '${priority}' priority" - appender_setLevel ${APP_NAME} ${priority} - appender_activateOptions ${APP_NAME} - - # the number of outputs must match the number of priority names and - # positions for this to work - for pos in ${PRIORITY_POS}; do - testPriority=`echo ${PRIORITY_NAMES} |cut -d' ' -f${pos}` - shouldOutput=`echo ${outputs} |cut -d' ' -f${pos}` - - ${DEBUG} echo "generating '${testPriority}' message" - result=`log ${testPriority} 'dummy'` - ${DEBUG} echo "result=${result}" - - if [ ${shouldOutput} -eq 1 ]; then - assertTrue \ - "'${priority}' priority appender did not emit a '${testPriority}' message" \ - "[ -n \"${result}\" ]" - else - assertFalse \ - "'${priority}' priority appender emitted a '${testPriority}' message" \ - "[ -n \"${result}\" ]" - fi - done - done - # restore stdin - exec 0<&9 9<&- -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testPriorityMatrix -} - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit diff --git a/1.3/src/test/testRollingFileAppender b/1.3/src/test/testRollingFileAppender deleted file mode 100755 index 14e5210..0000000 --- a/1.3/src/test/testRollingFileAppender +++ /dev/null @@ -1,516 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` -MY_LOG4SH="${MY_NAME}.log4sh" - -APP_NAME='R' -APP_MAX_FILE_SIZE='10KiB' -APP_MAX_FILE_SIZE_REAL=10240 -APP_MAX_BACKUP_INDEX='1' - -appFile='' -resultFile='' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# custom asserts -# - -assertFileExists() -{ - ${DEBUG} "assertFileExists($@)" - if [ $# -eq 2 ]; then - assertTrue "$1" "[ -f '$2' ]" - else - assertTrue "[ -f '$1' ]" - fi -} - -assertFileNotExists() -{ - ${DEBUG} "assertFileNotExists($@)" - if [ $# -eq 2 ]; then - assertTrue "$1" "[ ! -f '$2' ]" - else - assertTrue "[ ! -f '$1' ]" - fi -} - -#------------------------------------------------------------------------------ -# suite tests -# - -loadLog4sh_runtime() -{ - # add a rolling file appender at the INFO level - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} ${APP_MAX_BACKUP_INDEX} - - # activate the appender - appender_activateOptions ${APP_NAME} -} - -loadLog4sh_config() -{ - # load log4sh configuration - log4sh_doConfigure "${MY_LOG4SH}" -} - -createSizedFile() -{ - file=$1 - size=$2 - - # this could be slow... - ${DEBUG} "creating ${size} byte file..." - if [ ${size} -gt 0 ]; then - result=`dd if=/dev/zero of="${file}" bs=1 count=${size} 2>&1` - if [ $? -ne 0 ]; then - echo "ERROR: had problems creating the '${file}' of ${size} bytes" - return 1 - fi - else - touch "${file}" - fi -} - -testEmptyFile_runtime() -{ testEmptyFile runtime; } -testEmptyFile_config() -{ testEmptyFile config; } -testEmptyFile() -{ - ${DEBUG} 'testing empty file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" 0 \ - || return 1 - - # log a message - logger_error 'dummy message' - - # as we started with a empty file, writing a single logging message should - # not have caused an overrun, nor a rotation - assertFileNotExists \ - "the file rotated, but it shouldn't have" \ - "${appFile}.0" -} - -testOneByteUnderSize_runtime() -{ testOneByteUnderSize runtime; } -testOneByteUnderSize_config() -{ testOneByteUnderSize config; } -testOneByteUnderSize() -{ - ${DEBUG} 'testing one byte under sized file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} - 1` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was just under the limit for doing a rotation, so - # again, no rotation should have occurred - assertFileNotExists \ - "the file rotated, but it shouldn't have" \ - "${appFile}.0" -} - -testExactlyRightSize_runtime() -{ testExactlyRightSize runtime; } -testExactlyRightSize_config() -{ testExactlyRightSize config; } -testExactlyRightSize() -{ - ${DEBUG} 'testing exactly right sized file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was exactly the right size for doing a rotation. a - # rotation should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testOneByteOverSize_runtime() -{ testOneByteOverSize runtime; } -testOneByteOverSize_config() -{ testOneByteOverSize config; } -testOneByteOverSize() -{ - ${DEBUG} 'testing one byte oversize file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} + 1` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was just above the threshold for rotation. a rotation - # should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testOrderOfMagnitudeLarger_runtime() -{ testOrderOfMagnitudeLarger runtime; } -testOrderOfMagnitudeLarger_config() -{ testOrderOfMagnitudeLarger config; } -testOrderOfMagnitudeLarger() -{ - ${DEBUG} 'testing one byte oversize file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} \* 10` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was way above the threshold for rotation. a rotation - # should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testMaxBackupIndexOf2() -{ - ${DEBUG} 'testing a maximum backup index of 2' - - # configure log4sh - log4sh_resetConfiguration - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 2 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 2, there should be only two backups (.0 and .1) - assertFileNotExists \ - 'a backup file with a .2 extension should not exist' \ - "${appFile}.2" - assertFileExists \ - 'a backup file with a .1 extension should exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" - - # - # test with existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.1" - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 2, there should be only two backups (.0 and .1) - assertFileNotExists \ - 'a backup file with a .2 extension should not have been created' \ - "${appFile}.2" - assertFileExists \ - 'a backup file with a .1 extension should exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" -} - -testMaxBackupIndexOf1() -{ - ${DEBUG} 'testing a maximum backup index of 1' - - # configure log4sh - log4sh_resetConfiguration - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 1 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 1, there should be only one backup (.0) - assertFileNotExists \ - 'a backup file with a .1 extension should not exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" - - # - # test with existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 1, there should be only one backup (.0) - assertFileNotExists \ - 'a backup file with a .1 extension should not exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" -} - -testMaxBackupIndexOf0() -{ - ${DEBUG} 'testing a maximum backup index of 0' - - # configure log4sh - log4sh_resetConfiguration - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 0 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 0, there should no backups - assertFileNotExists \ - 'a backup file with a .0 extension should not exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # - # test with existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 0, there should be no backups - assertFileNotExists \ - 'a backup file with a .0 extension should not have been created' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - appFile="${__shunit_tmpDir}/rfa.log" - resultFile="${__shunit_tmpDir}/result.dat" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ${MY_PATH}/log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - rm -f "${appFile}" "${appFile}".* -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testEmptyFile_runtime - suite_addTest testOneByteUnderSize_runtime - suite_addTest testExactlyRightSize_runtime - suite_addTest testOneByteOverSize_runtime - suite_addTest testOrderOfMagnitudeLarger_runtime - - suite_addTest testEmptyFile_config - suite_addTest testOneByteUnderSize_config - suite_addTest testExactlyRightSize_config - suite_addTest testOneByteOverSize_config - suite_addTest testOrderOfMagnitudeLarger_config - - suite_addTest testMaxBackupIndexOf2 - suite_addTest testMaxBackupIndexOf1 - suite_addTest testMaxBackupIndexOf0 -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testRollingFileAppender.log4sh b/1.3/src/test/testRollingFileAppender.log4sh deleted file mode 100644 index 0bfa686..0000000 --- a/1.3/src/test/testRollingFileAppender.log4sh +++ /dev/null @@ -1,11 +0,0 @@ -# set root logger to ERROR, and give it one appenders; R -log4sh.rootLogger = ERROR, R - -# setup the R appender as a rolling file appender at the INFO level -log4sh.appender.R = RollingFileAppender -log4sh.appender.R.Threshold = INFO -log4sh.appender.R.File = ${__shunit_tmpDir:+${__shunit_tmpDir}/}rfa.log -log4sh.appender.R.MaxFileSize = 10KiB -log4sh.appender.R.MaxBackupIndex = 1 -log4sh.appender.R.layout = PatternLayout -log4sh.appender.R.layout.ConversionPattern = %d [%t] %-5p %c - %m%n diff --git a/1.3/src/test/testSMTPAppender b/1.3/src/test/testSMTPAppender deleted file mode 100755 index 9a6695c..0000000 --- a/1.3/src/test/testSMTPAppender +++ /dev/null @@ -1,143 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_NAME='mySMTP' -APP_CONFIG="${MY_NAME}.log4sh" - -TEST_SUBJECT='This is a Subject worth testing' -TEST_TO='some.user@some.host' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testSubjectGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SMTPAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default Subject is empty' - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertNull \ - 'the default SMTP Subject was not empty' \ - "${currSubject}" - - ${DEBUG} 'testing that it is possible to set and get the SMTP Subject' - # TODO: test for the log4sh:ERROR message - appender_smtp_setSubject ${APP_NAME} "${TEST_SUBJECT}" - appender_activateOptions ${APP_NAME} - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertEquals \ - 'the returned SMTP Subject does not match the one that was set' \ - "${currSubject}" "${TEST_SUBJECT}" - - # TODO: test the passing of invalid params - - unset currSubject -} - -testToGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SMTPAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default To is empty' - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertNull \ - 'the default SMTP To was not empty' \ - "${currTo}" - - ${DEBUG} 'testing that it is possible to set and get the SMTP To' - # TODO: test for the log4sh:ERROR message - appender_smtp_setTo ${APP_NAME} "${TEST_TO}" - appender_activateOptions ${APP_NAME} - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertEquals \ - 'the returned SMTP To does not match the one that was set' \ - "${currTo}" "${TEST_TO}" - - # TODO: test the passing of invalid params - - unset currTo -} - -testAppenderSetupFromConfig() -{ - # configure log4sh - log4sh_doConfigure "${APP_CONFIG}" - - ${DEBUG} 'verifying that the appender Type was properly set' - currType=`appender_getType ${APP_NAME}` - ${TRACE} "currType='${currType}'" - assertEquals \ - 'the returned appender type was not SMTPAppender' \ - "${currType}" 'SMTPAppender' - - ${DEBUG} 'verifying that the appender Subject was properly set' - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertEquals \ - 'the returned SMTP Subject does not match what was expected' \ - "${currSubject}" "${TEST_SUBJECT}" - - ${DEBUG} 'verifying that the appender To was properly set' - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertEquals \ - 'the returned SMTP To does not match what was expected' \ - "${currTo}" "${TEST_TO}" - - unset currType currSubject currTo -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - ${TRACE} 'oneTimeSetUp()' - - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - ${TRACE} 'setUp()' - log4sh_resetConfiguration -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - for suite in \ - testSubjectGetterSetter \ - testToGetterSetter \ - testAppenderSetupFromConfig - do - suite_addTest ${suite} - done -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testSMTPAppender.log4sh b/1.3/src/test/testSMTPAppender.log4sh deleted file mode 100644 index cde9440..0000000 --- a/1.3/src/test/testSMTPAppender.log4sh +++ /dev/null @@ -1,10 +0,0 @@ -# $Id$ - -# set root logger to ERROR, and give it one appenders; mySMTP -log4sh.rootLogger = ERROR, mySMTP - -# setup the mySMTP appender as a rolling file appender at the INFO level -log4sh.appender.mySMTP = SMTPAppender -log4sh.appender.mySMTP.Threshold = INFO -log4sh.appender.mySMTP.To = some.user@some.host -log4sh.appender.mySMTP.Subject = This is a Subject worth testing diff --git a/1.3/src/test/testSyslogAppender b/1.3/src/test/testSyslogAppender deleted file mode 100755 index 1836293..0000000 --- a/1.3/src/test/testSyslogAppender +++ /dev/null @@ -1,273 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 -# -# This unit test tests the general logging functionality of Syslog. It sends -# all logging to only a single facility to prevent spamming of system logs -# (something that happens to be a side effect of running this test). This test -# expects that syslog has been configured to write its output to the -# /var/log/log4sh.log logfile so that this file can be parsed. -# -# Sample syslog.conf entries. Note, one should *not* add a '-' char before the -# filename to enable buffering (available only with certain Syslog variants). -# -### Linux (sysklogd) -# local4.* /var/log/log4sh.log -# -### Solaris (syslogd; use tabs for whitespace!) -# local4.debug /var/log/log4sh.log -# -# Possible issues: -# * race conditions waiting for logs to be output via syslog. our backoff might -# be too short for the syslog message to arrive -# * different Syslog variants produce different output. we try to get around -# this by outputing a unique random number to each logging message so each -# message can be tracked individually. -# - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_NAME='mySyslog' -APP_SYSLOG_FACILITY='local4' - -BACKOFF_TIMES='1 2 4' -TAIL_SAMPLE_SIZE=25 -TEST_PRIORITY_DATA='priorityMatrix.data' -TEST_SYSLOG_DATA="${MY_NAME}.data" -TEST_LOGFILE='/var/log/log4sh.log' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testFacilityGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing the setting and getting of the valid syslog facilities' - for facility in `tf_getDataSect facilities "${TEST_SYSLOG_DATA}"`; do - appender_syslog_setFacility ${APP_NAME} "${facility}" - appender_activateOptions ${APP_NAME} - currFacility=`appender_syslog_getFacility ${APP_NAME}` - assertEquals \ - 'the syslog facility does not match the one set' \ - "${facility}" "${currFacility}" - done - - ${DEBUG} 'testing an invalid syslog facility' - testFacility='invalid' - appender_syslog_setFacility ${APP_NAME} "${testFacility}" - appender_activateOptions ${APP_NAME} - currFacility=`appender_syslog_getFacility ${APP_NAME}` - failNotEquals \ - 'the syslog facility does not match the one set' \ - "${testFacility}" "${currFacility}" - - # TODO: test the passing of invalid params - - unset facility currFacility testFacility -} - -testHostGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default syslog host is empty' - currHost=`appender_syslog_getHost ${APP_NAME}` - assertNull \ - 'the default syslog host was not empty' \ - "${currHost}" - - ${DEBUG} 'testing that it is possible to set and get the syslog host' - testHost='localhost' - # TODO: test for the log4sh:ERROR message - appender_syslog_setHost ${APP_NAME} "${testHost}" - appender_activateOptions ${APP_NAME} - currHost=`appender_syslog_getHost ${APP_NAME}` - assertEquals \ - 'the syslog host does not match the one that was set' \ - "${testHost}" "${currHost}" - - # TODO: test the passing of invalid params - - unset currHost testHost -} - -testSyslogLogfilePresent() -{ - # check for logfile presence - assertTrue \ - "unable to read from the test syslog output file (${TEST_LOGFILE})." \ - "[ -r \"${TEST_LOGFILE}\" ]" -} - -testPriorityMatrix() -{ - PRIORITY_NAMES='TRACE DEBUG INFO WARN ERROR FATAL' - PRIORITY_POS='1 2 3 4 5 6' - PRIORITY_DATA="priorityMatrix.data" - - # configure log4sh (appender_activateOptions called later) - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_syslog_setFacility ${APP_NAME} ${APP_SYSLOG_FACILITY} - - # save stdin, and redirect it from a file - exec 9<&0 <"${PRIORITY_DATA}" - while read priority outputs; do - # ignore comment lines or blank lines - echo "${priority}" |egrep -v '^(#|$)' >/dev/null || continue - - echo " testing appender priority '${priority}'" - appender_setLevel ${APP_NAME} ${priority} - appender_activateOptions ${APP_NAME} - - # the number of outputs must match the number of priority names and - # positions for this to work - for pos in ${PRIORITY_POS}; do - testPriority=`echo ${PRIORITY_NAMES} |cut -d' ' -f${pos}` - shouldOutput=`echo ${outputs} |cut -d' ' -f${pos}` - result='' - - ${DEBUG} "generating '${testPriority}' message" - tf_generateRandom - random=${tf_RANDOM} - log ${testPriority} "${MY_NAME} test message - ${random}" - - # skip the actual test if there is no logfile to tail at - if [ ! -r "${TEST_LOGFILE}" ]; then - fail - continue - fi - - # do a timed backoff to wait for the result -- syslog might take a bit - for backoff in ${BACKOFF_TIMES}; do - [ ${backoff} -eq 2 ] \ - && echo " waiting for possible '${testPriority}' message..." - sleep ${backoff} - result=`tail ${tailNumOpt}${TAIL_SAMPLE_SIZE} "${TEST_LOGFILE}" |\ - grep "${random}"` - [ -n "${result}" ] && break - done - ${DEBUG} "result=${result}" - - if [ ${shouldOutput} -eq 1 ]; then - assertNotNull \ - "'${priority}' priority appender did not emit a '${testPriority}' message" \ - "${result}" - else - assertNull \ - "'${priority}' priority appender emitted a '${testPriority}' message" \ - "${result}" - fi - done - done - - # restore stdin - exec 0<&9 9<&- - - unset backoff outputs priority random result shouldOutput testPriority -} - -# -# this test attempts to send a message to a remote syslog host. in this case, -# it is actually the localhost, but when a syslog host is defined, a completely -# different set of logging code is exercised. using the same local4 facility -# like in the priority matrix test, we should still be able to test for the -# presence of a logging message. -# -testRemoteLogging() -{ - # define the netcat alternative command (required!) - log4sh_setAlternative 'nc' "${LOG4SH_ALTERNATIVE_NC:-/bin/nc}" - - # configure log4sh - ${DEBUG} 'configuring log4sh' - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_syslog_setFacility ${APP_NAME} 'local4' - appender_syslog_setHost ${APP_NAME} 'localhost' - appender_activateOptions ${APP_NAME} - - # send a logging message - ${DEBUG} 'generating message' - tf_generateRandom - random=${tf_RANDOM} - logger_error "${MY_NAME} test message - ${random}" - - # skip the actual test if there is no logfile to tail at - if [ ! -r "${TEST_LOGFILE}" ]; then - fail - else - # do a timed backoff to wait for the result -- syslog might take a bit - for backoff in ${BACKOFF_TIMES}; do - [ ${backoff} -eq 2 ] \ - && echo " waiting longer for message..." - sleep ${backoff} - result=`tail ${tailNumOpt}${TAIL_SAMPLE_SIZE} "${TEST_LOGFILE}" |\ - grep "${random}"` - [ -n "${result}" ] && break - done - ${DEBUG} "result=${result}" - - assertNotNull \ - 'did not receive the remotely logged syslog message' \ - "${result}" - fi - - unset backoff random result -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testFacilityGetterSetter - suite_addTest testHostGetterSetter - - suite_addTest testSyslogLogfilePresent - suite_addTest testPriorityMatrix - suite_addTest testRemoteLogging -} - -# check options on tail command -result=`echo '' |tail -n 1 >/dev/null 2>&1` -if [ $? -eq 0 ]; then - # newer tail command - tailNumOpt='-n ' -else - tailNumOpt='-' -fi - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit diff --git a/1.3/src/test/testSyslogAppender.data b/1.3/src/test/testSyslogAppender.data deleted file mode 100644 index e4a5e01..0000000 --- a/1.3/src/test/testSyslogAppender.data +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ - -[facilities] -auth -authpriv -cron -daemon -ftp -kern -lpr -mail -news -security -syslog -user -uucp -local0 -local1 -local2 -local3 -local4 -local5 -local6 -local7 diff --git a/1.4/Makefile b/1.4/Makefile deleted file mode 100644 index e06897a..0000000 --- a/1.4/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# $Id$ - - -DOCBOOK_SRC_DIR=$(PWD)/src/docbook -EXAMPLES_SRC_DIR=$(PWD)/src/examples -SHELL_SRC_DIR=$(PWD)/src/shell -TEST_SRC_DIR=$(PWD)/src/test - -BIN_DIR=$(PWD)/bin -BUILD_DIR=$(PWD)/build -DIST_DIR=$(PWD)/dist -DOCBOOK_BUILD_DIR=$(BUILD_DIR)/docbook -LIB_DIR=$(PWD)/lib -TEST_DIR=$(PWD)/test - -HTML_XSL=$(PWD)/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl - -all: build docs - -build: build-prep - cp -p $(SHELL_SRC_DIR)/log4sh $(BUILD_DIR) - -build-clean: - rm -fr $(BUILD_DIR) - -build-prep: - @mkdir -p $(BUILD_DIR) - -docs: docs-transform-shelldoc docs-transform-docbook - -docs-prep: - @mkdir -p $(DOCBOOK_BUILD_DIR) - @echo "Preparing documentation for parsing" - @isoDate=`date "+%Y-%m-%d"`; \ - find $(DOCBOOK_SRC_DIR) -name "*.xml" |\ - while read f; do \ - bn=`basename $$f`; \ - sed -e "s/@@ISO_DATE@@/$$isoDate/g" $$f >$(DOCBOOK_BUILD_DIR)/$$bn; \ - done - -docs-extract-shelldoc: docs-prep - @echo "Extracting the ShellDoc" - @$(BIN_DIR)/extractDocs.pl $(SHELL_SRC_DIR)/log4sh >$(BUILD_DIR)/log4sh_shelldoc.xml - -docs-transform-shelldoc: docs-prep docs-extract-shelldoc - @echo "Parsing the extracted ShellDoc" - @xsltproc $(PWD)/src/resources/shelldoc.xslt $(BUILD_DIR)/log4sh_shelldoc.xml >$(DOCBOOK_BUILD_DIR)/functions.xml - -docs-transform-docbook: docs-prep - @echo "Parsing the documentation with DocBook" - @xsltproc $(HTML_XSL) $(DOCBOOK_BUILD_DIR)/log4sh.xml >$(BUILD_DIR)/log4sh.html - -test: test-prep - @echo ------------------------------------------------------------------------------- - @echo "testing log4sh from an initial properties configuration" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/test-prop-config ) - @echo ------------------------------------------------------------------------------- - @echo "testing log4sh via runtime configuration" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/test-runtime-config ) - @echo ------------------------------------------------------------------------------- - @echo "executing log4sh unit tests" - ( cd $(TEST_DIR); $(TEST_SRC_DIR)/run-test-suite ) - -test-clean: - rm -fr $(TEST_DIR) - -test-prep: build test-clean - @mkdir -p $(TEST_DIR) - cp -p $(EXAMPLES_SRC_DIR)/hello_world $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/test* $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/run-test-suite $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/*.data $(TEST_DIR) - cp -p $(TEST_SRC_DIR)/*.properties $(TEST_DIR) - cp -p $(LIB_DIR)/sh/shunit2 $(TEST_DIR) - cp -p $(BUILD_DIR)/log4sh $(TEST_DIR) - -dist: build docs - @mkdir $(DIST_DIR) - cp -p $(BUILD_DIR)/log4sh $(DIST_DIR) - cp -p $(BUILD_DIR)/log4sh.html $(DIST_DIR) - -clean: build-clean test-clean - -distclean: clean - rm -fr $(DIST_DIR) diff --git a/1.4/bin/extractDocs.pl b/1.4/bin/extractDocs.pl deleted file mode 100755 index a803526..0000000 --- a/1.4/bin/extractDocs.pl +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/perl -# $Id$ - -if(@ARGV != 1) { - print "usage: $0 sourceFile\n"; - exit; -} - -$sourceFile = $ARGV[0]; - -# -# read in the source file -# -$rslt = open(FILE, $sourceFile) - || die "could not open file ($sourceFile)"; - -$inComment = 0; -while() { - next if /^[^#]/; - s/^# //; - s/^#//; - - if(/^\/\*\*/) { - $inComment = 1; - next; - } - if(/\*\/$/) { - $inComment = 0; - next; - } - - if ($inComment == 1) { print $_ }; - if ($inComment == 0 && /\/\/\*/) { - @line = split /\/\/\*/, $_, 2; - $line[1] =~ s/^ //; - print $line[1]; - } -} - -close(FILE); diff --git a/1.4/doc/BUILD.txt b/1.4/doc/BUILD.txt deleted file mode 100644 index 0856f62..0000000 --- a/1.4/doc/BUILD.txt +++ /dev/null @@ -1,45 +0,0 @@ -# $Id$ - -BUILD DOCUMENTATION - -As log4sh is a shell script, there is no need to build the code. It is already -built. There is a Makefile included that simplifies various things about -environment setup, but nothing more. - - -BUILDING THE DOCBOOK DOCUMENTATION - -To build the documentation, you will need the following installed on your -system: - -o Sun Java JRE 1.3.x (or newer) -o Apache Ant 1.5 (or newer) -o bzip2 -o tar -o unzip - -The documentation is built using XML and XSLT from the DocBook project. The -required files are not included in the log4sh distribution as they are not -normally needed. The necessary archives can be retrieved from the one of the -URLs listed below. Place the files in the share/dist directory. - -docbook-xml-4.3.zip - http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip - http://forestent.com/dist/docbook/docbook-xml-4.3.zip -docbook-xsl-1.67.2.tar.bz2 - http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.67.2.tar.bz2?download - http://forestent.com/dist/docbook/docbook-xsl-1.67.2.tar.bz2 - -Once the archives have copied to the share/dist directory, they can be -extracted into the share/docbook directory. There is a Makefile in that -directory that will automate this task. - -$ cd share/docbook -$ make - -Once the archives are extracted, it can be generated by running ant. Change to -the src/docbook directory, and run ant. The documentation will be generated in -the distributions doc directory. - -$ cd src/docbook -$ ant diff --git a/1.4/doc/CHANGES-1.3.txt b/1.4/doc/CHANGES-1.3.txt deleted file mode 100644 index dda2766..0000000 --- a/1.4/doc/CHANGES-1.3.txt +++ /dev/null @@ -1,368 +0,0 @@ -Changes with 1.3.8 (1.4.0) - -[kwd] removed unset variable checks for parameters passed to functions for -those functions that already check beforehand for enough parameters being -passed - -[kwd] fixed the reading of a command alternative from a config file (credits to -Mickaël Canévet) - -[kwd] fix for sending mail via the SMTPAppender -- a Subject with spaces in it -did not work (credits to Mickaël Canévet) - -[kwd] added an SMTPAppender unit test - -[kwd] removed the internal _appender_smtp_getToByIndex() and -_appender_smtp_getSubjectByIndex() functions - -[kwd] the 'mail' command is now a supported command alternative - -[kwd] the log4sh_setAlternative() function now supports an optional flag that -indicates the command should be searched using the runtime path - -[kwd] fixed bug where an unset was attempting to unset the value of a variable -rather than the variable itself - -[kwd] brought appender_getLevel() up to standard - - -Changes with 1.3.7 - -[kwd] added more unit tests - -[kwd] bug# 1611574; fixed problem causing 'unbound variable' errors - -[kwd] the default /bin/sh shell on my notebook is now dash (I'm running Ubuntu -Edgy currently), so adding that to the list of supported shells. - -[kwd] fixed error checking for appender_syslog_setFacility() function. the -shell canceled things before the error checking could detect why. - -[kwd] bug# 1614338; fixed issue with the SyslogAppender not logging properly. -(credits to Rob Holland for pointing this out) - -[kwd] added deprecated syslog facility name 'security' for better compatibility - -[kwd] using the deprecated syslog level names ('panic', 'error', and 'warn') -for better compatibility - -[kwd] added missing syslog host functionality, although it still doesn't work -because the 'logger' command doesn't support sending to a remote host. must -find a different means for remote hosts. netcat maybe? - -[kwd] added an include file for the unit test functions so there is less code -duplication in the unit tests themselves. - -[kwd] fixed bug where the SMTP subject was not being set properly. (Credits to -Mickaël Canévet for pointing this out) - -[kwd] added initial ability to specify paths for command alternates. currently, -only nc (netcat) is supported to enable remote syslog logging. - -[kwd] remote syslog logging now works. enable using log4sh_setAlternative() for -the 'nc' (netcat) command. - -[kwd] the RollingFileAppender now works - -[kwd] added a log4sh_enableStrictBehavior() function that forces stricter -compliance with log4j - -[kwd] added a testMultipleAppender unit test. found that pdksh doesn't actually work with multiple appenders :-( - -[kwd] fix a bug which caused the pdksh shell to not work properly - -[kwd] added additional random number generator to _log4sh_mktempDir() function. -it uses /dev/urandom if present. - --- Changes with shUnit 1.0.2 - -[kwd] fixed problem where some of the unit test functions were reportingerrors -like '/bin/sh: Can't open setUp' - -[kwd] flushed out the remaining assert and fail functions that are present in -JUnit - -[kwd] if an interrupt is received (e.g. Ctrl-C), a unit test report up until -the point of interrupt is now generated - - -Changes with 1.3.6 - -[kwd] did some major code reorganization to group common code groups together - -[kwd] renamed the _log4sh_level2tag() and _log4sh_tag2level() functions to -_level_toLevel() and _level_toInt() correspondingly. they were very badly -named, and were a reminant of the very early log4sh code base. - -[kwd] reworked the internal log4sh debugging. had problems debugging why ksh -wasn't working properly, and decided that the log4sh debugging needed to be -improved to help me find the problems easier. - -[kwd] again, forgot to test with ksh (argh!). have added testing of several -shells to the run-test-suite script to be sure I don't forget them again. - -[kwd] fixed a bug when trying to restore old trap signal handlers. had a bad -regex and was missing some "'" chars - -[kwd] fixed the problems with ksh where having a function redefine itself and -then reload itself at runtime was causing infinite loops - -[kwd] renamed the logger_readProperties() function to logger_doConfigure() -to closer match log4j - -[kwd] added an appender_activateOptions() function that should be called after -any changes to an appenders configuration are changed. this is something that -is present in log4j 1.2, and will be required in log4j 1.3. - -[kwd] removed the appender_syslog_getFacilityByIndex() and -appender_syslog_getFacilityByName() functions - -[kwd] added code to fully implement the '%r' conversion character under all -supported shells. - -[kwd] improved all unit tests so they will work under the standard Solaris -shell [/bin/sh] - -[kwd] reworked the trap handler so it works under all supported shells - -[kwd] added workaround for the set builtin as its default behavior is different -between Bourne based shells and ksh. - - -Changes with 1.3.5 - -[kwd] implemented passing data to logger_*() functions via pipes. this was -implemented once before, but it somehow got lost. - -[kwd] added dynamic caching of the appenders as function calls to reduce the -amount of work needed for each logger_*() function call. done to increase -performance, especially under cygwin and on slower cpus. unfortunately, it -seems that I have added enough other stuff to the script that it is now even -slower under cygwin, despite reducing the work needed to happen. - -[kwd] added functionality so that filenames specified for FileAppenders in the -properties file can contain shell variables that will be evaluated at runtime -(e.g. 'log4sh.appender.log.File = ${TMPDIR}/output.log') - -[kwd] fixed bug where the IFS was not being correctly set back after a logging -statement was called - -[kwd] now saves the current set of shell options stored in $- and restores them -after log4sh is sourced into memory - -[kwd] fixed bug where newlines in a message caused parsing problems. (credits -to Tim Kordick for pointing this out) - -[kwd] implemented sending messages to log4sh via pipes (e.g. -'ls -l |logger_info') - -[kwd] fixed bug (thanks to the new unit test framework) where a pattern of just -a '%d' would return nothing instead of the date - -[kwd] developed a shUnit unit test framework similar to JUnit. I didn't like -what I found on Internet, so I rolled my own. finding bugs with it already! - -[kwd] added conditional declaration of the SECONDS variable in case it is -missing from the shell implementation being used (e.g. under Bourne shell) - - -Changes with 1.3.4 - -[kwd] added support for a LOG4SH_CONFIG_PREFIX variable. if this variable is -set before log4sh is loaded, then the default prefix (normally 'log4sh') will -be overridden. added so that log4j.properties files can be read with no -changes necessary. (e.g. "LOG4SH_CONFIG_PREFIX='log4j'") - -[kwd] changed the handling of the LOG4SH_CONFIGURATION property to make the -implementation a bit cleaner - -[kwd] reworked the test scripts so that there is a test-prop-config script that -sets up a logging environment from a log4sh.properties file, and a -test-runtime-config script that sets up the exact same environment, but at -runtime. they both call a test-common script so that they should give nearly -exactly the same output. - -[kwd] fixed bug that caused '\' chars in the logging message to cause problems - -[kwd] added a log4sh_cleanup() function that scripts can call. normally log4sh -will be cleaned up using a trap handler, but if an external script overrides -the trap handler, it won't work. this gives scripts the ability to manually -invoke the cleanup. - -[kwd] fixed bug that caused '&' characters in the logging message to be -replaced with '%m'. - -[kwd] updated comments in the examples to match what the examples are actually -showing. (thanks to Stephan Hegel for pointing out the mismatch) - -[kwd] fixed bug that caused only the first conversion character in a -PatternLayout to be replaced. (credits to Aaron Rodden for the patch) - -[kwd] worked on the PatternLayout 'd' conversion character. it now supports -giving a date specifier (e.g. %d{ISODATE}), but whatever is specified is -ignored. it was done to better support log4j properties files that are -converted. - -[kwd] the '%' PatternLayout conversion character is now supported. when two -'%%' chars are given in a pattern, they are replaced with a single '%' char in -the output. - -[kwd} added support for the %X PatternLayout conversion character. (credits to -Aaron Rodden for the patch) - - -Changes with 1.3.3 - -[kwd] improved the _log4sh_mktempDir function some more. the random temporary -directories generated under the standard Solaris shell were not all that random -(as pointed out by Gordon Pedersen). the function now supports the system -mktemp function (if it exists), but falls back to the shell $RANDOM value (if -it works), and finally it will do a mix of the date divided by the current -process id. this should make the semi-random value suffiently difficult enough -to easily guess. - -[kwd] replacing some more sed commands with expr equivalents - -[kwd] fixed a situation where changing the default value of the IFS variable -once log4sh was loaded would cause log4sh to have problems with for loops - -[kwd] added trap code to automatically remove the temporary directory upon exit -of the script. did this so that if the outside script is killled, the -temporary directory is still cleaned up. - -[kwd] with the addition of a trap handler, the log4sh handler overwrites any -previously defined handler. added code to execute the previous handler as well -so that log4sh plays nicely with scripts that trap the EXIT or TERM signals as -well. - -[kwd] added the ability to debug log4sh itself by declaring a LOG4SH_DEBUG -variable - -[kwd] found a major oops bug when configuring log4sh using a properties file. -If there were more than two appenders declared with the log4sh.rootLogger -option, or if they were not separated with exactily ', ' (comma space), they -were [mostly] ignored. basically, it didn't work right. brown bag here! -(thanks to Gordon Pedersen for indirectly finding this one) - -[kwd] added appender_exists function to check for the existance of an appender. -some things were being done with the assumption that the appender existed, but -it was never checked. starting to check now. - -[kwd] applied a user supplied patch that allows the SyslogAppender to use the -different facilities and levels, and to write the name of the script and pid as -well to make the syslog output more standard. (credits to Aaron Rodden) - -[kwd] after looking through some log4j code, I realized that if an invalid -Syslog facility is given, log4j defaults to the 'user' facility. log4sh does -now too. - -[kwd] spaced now before and after the '=' char in the log4sh.properties file -(e.g. "log4sh.appender.F = FileAppender") - - -Changes with 1.3.2 - -[kwd] removed the last reminants of the old array implementation that was used -for the __log4shAppenders variable. the new implementation is now used -consistently throughout. - -[kwd] fixed bug in the popThreadName function. the current thread name was -being filled with the wrong value. - -[kwd] added the (deprecated) commands appender_setAppenderFile() and -appender_setSyslogFacility() back to be backwards compatible with the 1.2 -series - -[kwd] increased performance in the log() function (credits to Omner Calhoun) - -[kwd] fixed bug in the log4sh_readProperties() function that broke it under -Solaris (credits to Steve Etchelecu) - -[kwd] begin putting function documentation in the log4sh code as pseudo-XML -like data. next, I wrote an extractor to parse out the XML into a separate -file. that file gets run through an XSLT, and is now inserted as function -documentation into the docbook documentation during build time. - -[kwd] docbook source now split into individual chapter files to support the -dynamic inclusion of the function reference chapter - -[kwd] finished the shelldoc documentation - -[kwd] read through the documentation and made some updates - -[kwd] replaced depraced function calls in the test programs with the current -versions - - -Changes with 1.3.1 - -[kwd] added a __LOG4SH_VERSION variable - -[kwd] implemented a more secure method for using temporary files. if the -TMPDIR variable is set, it is honored. the method is based on info from -http://www.linuxsecurity.com/content/view/115462/151/. - -[kwd] prefixed all the new array functions with _log4sh. didn't think about it -for the last release. oops. - -[kwd] replaced many 'awk' statements with 'cut' statements. resulted in about -10% faster performance while testing with the test-log4sh unit test script. - -[kwd] added a TRACE debug level. log4j-1.2.12 added this, so I did too. -actually, just renamed my ALL debug level to TRACE, so nothing *really* -changed. - -[kwd] renamed the file, smtp, and syslog functions to make future fuction -additions easier - -[kwd] reordered and regrouped the functions according to what they are for - -[kwd] stripped the setting and unsetting of temporary variables from many -functions where they are simple enough to be understand without them - -[kwd] abstracted several array gets into functions to allow for future -underlying array implementation changes - -[kwd] replaced nearly all usages of the old array system with the new system - -[kwd] fixed *many* reported bugs (credits to Omner Calhoun) - -[kwd] the various logging commands now support multiple arguments (very much -like the echo command). as a result, the input no longer needs to be -surrounded by quotes. (credits to Omner Calhoun) - -[kwd] realized that while internally, practically all of the get* functions use -index numbers, there is the need to use the appender name as well. added a -appender_syslog_getFacilityByName function (as an example) and renamed the old -function to appender_syslog_getFacilityByIndex. must continue this work in the -future. - -[kwd] begin implementing a type of documentation in the code... will extract -the documentation at build time from the code which will be used to build API -documentation. wrote a extractDocs.pl script to do the documentation -extraction. it's written in perl, I know, but log4sh is still in shell! - -[kwd] changed the functionality of the code in several places so that internal -shell commands are used instead of forking off an external command. (credits -to Omner Calhoun) - -[kwd] I'm sure there are others that were forgotten - - -Changes with 1.3.0 - -[kwd] implemented a Syslog appender for logging via syslog by using the logger -command. currently limited to the localhost - -[kwd] ported the new {get|push|pop}ThreadName functions from 1.2.7 - -[kwd] implemented a SMTP appender. the appender is still in development. -(credits to Mickael Canevet) - -[kwd] implemented a new way to handle the string arrays. the old method worked -just fine, except for when the data contained space characters. this new -method handles spaces as well (which are needed for the SMTP appender -subjects). - - -$Revision$ diff --git a/1.4/doc/CHANGES-1.4.txt b/1.4/doc/CHANGES-1.4.txt deleted file mode 100644 index 67b8fda..0000000 --- a/1.4/doc/CHANGES-1.4.txt +++ /dev/null @@ -1,49 +0,0 @@ -CHANGES WITH 1.4.3 - -Unset additional variables that were missed. - -Fixed off-by-one in exit value for scripts exits caught with trap. - - -CHANGES WITH 1.4.2 - -updated shUnit to shUnit2-2.1.1pre - -added support for the fully qualified class name when using a log4j -configuration file. - -fixed some variable use standardization (i.e. wrapping in {} chars) - -fixed bug in log4sh_readProperties() -- it was not calling log4sh_doConfigure() -like it was supposed to. - -added some error checking to log4sh_doConfigure and _log4sh_propAppender() so -that a useful unit test could be written to verify propert log4j compatibility. - -added testPropertyConfig and testLog4jCompatibility unit tests. - -backported the testSyslogAppender unit test from 1.5.0 - -fixed error message in log4sh_setAlternative() when the alternative commmand -not found. it now makes more sense. - - -CHANGES WITH 1.4.1 - -updated shUnit to 1.0.3pre - -removed extra parameters that were being wrongly passed to the appender_setType -and appender_setLayout functions - -fixed the unsetting of variables in several locations - -added missing command alternative for the 'mail' command - -fixed bug when attempting to log a message at an invalid logging level with the -log() function. it should have returned an error, but it didn't. - -fixed bug where the 'B' unit was not recognized for the MaxFileSize of a -RollingFileAppender - - -$Revision$ diff --git a/1.4/doc/DesignDoc-1.3.txt b/1.4/doc/DesignDoc-1.3.txt deleted file mode 100644 index 6cb8f96..0000000 --- a/1.4/doc/DesignDoc-1.3.txt +++ /dev/null @@ -1,40 +0,0 @@ -* static vs dynamic appenders. generate static versions, and source them - -appenders -- need static function that gets called that does the work. -- for example, if the appender writes to a file, it shouldn't need to lookup - the file as it should alread know it -- make all appenders look similar and/or same?? -- save common data in variables in function, or do a 100% static solution? -- would be really good for performance if 100% static (no variables at all) - -levels -- how should it be determined which appenders to call for what level? -- write all appenders in a "appenders.d" dir, and then use hard/soft links to a - level dir (e.g. "debug.d", "info.d", etc)? - -!!! -- careful. using files as storage for the static appender generation, but the - file will be sourced in as a function so that something like funciton - pointers of C can be used :-) -- need templates for the various appenders... templating engine? ugh! -- what work will there be in using the current paradigm of being able to - "change" an appenders type? that will probably need to go away. -- still need a list of appenders for each logging level -- appenders do not need to be executed in same order for each logging level - (meaning a FileAppender might fire before a SyslogAppender at INFO level, but - the reverse might be true at DEBUG level). -- having each Level in it's own list will allow for firing of appenders at - single levels rather than at current and at all above levels (user request. - verify against log4j) -- when a pattern (or anything else such a file name) changes, the function - needs to be re-loaded and re-sourced. optimize if possible. - -# -# Implementation -# - -logger_addAppender FileAppender - - -$Revision$ diff --git a/1.4/doc/FAQ.txt b/1.4/doc/FAQ.txt deleted file mode 100644 index fc582be..0000000 --- a/1.4/doc/FAQ.txt +++ /dev/null @@ -1,48 +0,0 @@ -Q: Why are the variable names in log4sh so strange? There seems to be no rhyme -or reason to them. - -A: Not all shells support the variable scoping that one would expect. All -variables are treated as global variables, which means that if a variable has a -value outside a function call, and then a function call changes the value, the -original value is not returned upon exiting the function. To get around this, -each function must have different variable names so that when one function -calls another, variables are not overwritten. Where things get especially hairy -is when any sort of recursion is needed, and as such, recursion is avoided in -log4sh. The best example of the described behavior is the default Bourne shell -of Solaris. - - -Q: Why are the variables in log4sh not more "shell" like? In other words, why -are they so long? - -A: Two reasons really. The first reason is for readability. log4sh has been -developed over a long period of time (years), and when going back to the code -after any length of time, it is very easy to forget how or why things were done -the way they were. Long descriptive variable names make it much easier to -remember how and why. The second reason is, well, for readability. The hope is -that newbie shell developers (and experienced ones as well) will look at the -code and be able to learn and/or improve upon it. The faster and easier they -can understand the code, the better their understanding and improvements will -be. - - -Q: Why is there strange XML in the comments? There are almost more comments -than code! - -A: Along the same lines of having long variable names, it is for better -understanding. Maintaining spearate documentation for the functions available -in log4sh is difficult, and it tends to be out-of-date with respect to the -code. This way, everything is in one document and there is a much better chance -that the function documentation remains up-to-date. As to why XML is in there --- the documentation for log4sh is written in DocBook so that it is -standardized. The log4sh XML is not pure DocBook as it does not fit the need -well enough, but the log4sh XML is run through XSLT to generate pure DocBook -XML, and thereby it fits in nicely with the rest of the DocBook documentation. - -If you would prefer to see log4sh without the majority of XML comments, a -simple 'grep' might help you out. Try the following: - -$ grep -v '^#' log4sh - - -$Revision$ diff --git a/1.4/doc/LGPL-2.1 b/1.4/doc/LGPL-2.1 deleted file mode 100644 index b1e3f5a..0000000 --- a/1.4/doc/LGPL-2.1 +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/1.4/doc/README.txt b/1.4/doc/README.txt deleted file mode 100644 index 84c9f91..0000000 --- a/1.4/doc/README.txt +++ /dev/null @@ -1,178 +0,0 @@ -#------------------------------------------------------------------------------ -# SourceForge -# - -This project is stored on SourceForge as http://sf.net/projects/log4sh. The -source code can be accessed using the following information. - -* Subversion -$ svn co https://log4sh.svn.sourceforge.net/svnroot/log4sh/trunk log4sh - -Subversion may also be browsed via a web browser at -http://svn.sourceforge.net/log4sh - -#------------------------------------------------------------------------------ -# Making a release -# - -For these steps, it is assumed we are working with release 1.3.6. - -Steps: -* run the unit tests -* write release notes -* update version -* finish changelog -* check all the code in -* tag the release -* export the release -* create tarball -* md5sum the tarball and sign with gpg -* update website -* post to SourceForge and Freshmeat - -RUN THE UNIT TESTS - -Run make with the 'test-prep' option to create the test/ directory. Change -there and run the tests. Record the output into the -website/testresults// directory so that they can be posted to the -website. Repeate this for each of the supported OSes. - -$ make test-prep -... -$ cd test -$ ./run-test-suite 2>&1 |tee .../testresults/1.3.7/Linux-Ubuntu_Edgy-6.10.txt -... - -WRITE RELEASE NOTES - -Again, pretty self explainatory. Use one of the release notes from a previous -release as an example. - -To get the versions of the various shells, do the following: -Cygwin - bash: $ bash --version - ksh: actually pdksh - pdksh: look in the downloaded Cygwin directory -Linux - bash: $ bash --version - dash: look at installed version - ksh: $ ksh --version - pdksh: $ strings /bin/pdksh |grep 'PD KSH' - zsh: $ zsh --version -Solaris 10 - sh: not possible - bash: $ bash --version - ksh: $ strings /usr/bin/ksh |grep 'Version' - -UPDATE VERSION - -Edit the log4sh source code, and change the version number in the comment, as -well as in the __LOG4SH_VERSION variable. Next, edit the src/docbook/log4sh.xml -file, edit the version in the element, and make sure there is a -revision section for this release. - -FINISH DOCUMENTATION - -Make sure that any remaning changes get put into the CHANGES.txt file. - -Finish writing the RELEASE_NOTES.txt. Once it is finished, run it through the -'fmt' command to make it pretty. - -$ fmt -w 80 RELEASE_NOTES-1.3.6.txt >RELEASE_NOTES-1.3.6.txt.new -$ mv RELEASE_NOTES-1.3.6.txt.new RELEASE_NOTES-1.3.6.txt - -We want to have an up-to-date version of the documentation in the release, so -we'd better build it. - -$ pwd -.../log4sh/source/1.3 -$ make docs -... -$ cp -p build/log4sh.html doc -$ svn ci -m "" doc/log4sh.html - -CHECK IN ALL THE CODE - -This step is pretty self-explainatory - -TAG THE RELEASE - -$ pwd -.../log4sh/source -$ ls -1.2 1.3 -$ svn cp -m "Release 1.3.6" \ -1.3 https://log4sh.svn.sourceforge.net/svnroot/log4sh/tags/source/1.3.6 - -EXPORT THE RELEASE - -$ pwd -.../log4sh/builds -$ svn export \ -https://svn.sourceforge.net/svnroot/log4sh/tags/source/1.3.6 log4sh-1.3.6 - -CREATE TARBALL - -$ tar cfz ../releases/log4sh-1.3.6.tgz log4sh-1.3.6 - -MD5SUM THE TARBALL AND SIGN WITH GPG - -$ cd ../releases -$ md5sum log4sh-1.3.6.tgz >log4sh-1.3.6.tgz.md5 -$ gpg --default-key kate.ward@forestent.com --detach-sign log4sh-1.3.6.tgz - -UPDATE WEBSITE - -Again, pretty self-explainatory. - -Once that is done, make sure to tag the website so we can go back in time if -needed. - -$ pwd -.../log4sh -$ ls -source website -$ svn cp -m "Release 1.3.7" \ -website https://log4sh.svn.sourceforge.net/svnroot/log4sh/tags/website/20060916 - -Now, copy the website into place - -$ rsync -aP --delete --exclude '.svn' website/ sf.net:www/projects/log4sh - -POST TO SOURCEFORGE AND FRESHMEAT - -http://sourceforge.net/projects/log4sh/ -http://freshmeat.net/ - -#------------------------------------------------------------------------------ -# Testing a release -# - -To test a release, shUnit unit tests are included. Prepare the test -environment, and then you can run the tests. Hopefully all of the tests will -pass with a 100% success rate. - -$ make test-prep -$ cd test -$ ./run-test-suite - -To determine what release an OS is running, try the following: - -:Mac OS X: $ /usr/bin/sw_vers |grep ProductVersion |cut -f2 -:Linux Ubuntu: $ ( . /etc/lsb-release; echo ${DISTRIB_DESCRIPTION} ${DISTRIB_CODENAME} ) - -#------------------------------------------------------------------------------ -# Related documentation -# - -JUnit - http://www.junit.org -log4j - http://logging.apache.org -Introduction to the Syslog Protocol - http://www.monitorware.com/Common/en/Articles/syslog-described.php -The BSD syslog Protocol - http://www.ietf.org/rfc/rfc3164.txt - - -$Revision$ diff --git a/1.4/doc/RELEASE_NOTES-1.3.6.txt b/1.4/doc/RELEASE_NOTES-1.3.6.txt deleted file mode 100644 index d075ec7..0000000 --- a/1.4/doc/RELEASE_NOTES-1.3.6.txt +++ /dev/null @@ -1,120 +0,0 @@ -RELEASE NOTES FOR 1.3.6 - -The previous release was somewhat of a brown-bag release. Running log4sh -through the unit tests provided (something that was completely new for -the 1.3.5 release) indicated that it worked great under Linux with Bash -and under Solaris with the standard Bourne shell. Unfortunately, it was -not tested under ksh for either Linux or Solaris. After testing with ksh -was done, it was discovered that many of the new internal changes did not -work whatsoever with ksh, and were often times causing segmentation faults, -something quite uncommon with a shell script. - -This release is meant to fix the problems with the last release. log4sh has -been fixed to work with the unit tests, and the unit tests themselves have -been cleaned up and the sub-shells removed as log4sh now supports having -its configuration reset programmatically. - -TESTED PLATFORMS - -Cygwin – bash 3.1.17(6); pdksh 5.2.4 - -Linux – bash 3.00.16(1), 3.1.17(1); ksh 1993-12-28 - -Solaris 10 U2 – /bin/sh; bash 3.00.16(1); ksh M-11/16/88i - -NEW FEATURES - -A log4sh_doConfigure() function was added. (Actually, the -log4shReadProperties() function was renamed). This function can be used to read -a configuration file at runtime. It does *not* reset the current configuration, -so one must first call the log4sh_resetConfiguration() function to do that. - -A log4sh_resetConfiguration() function was added. This function will completely -reset the configuration of log4sh to an clean state. No appenders are defined, -and logging statements will have absolutely no effect. - -A appender_activateOptoins() function was added. This was done to closer -duplicate the functionality of log4j. This function can be optionally -called to activate an appender after any changes have been made to it -programmatically. This function call will be required in a future release -of log4sh. - -An additional internal log4sh debug variable can be set so that all log4sh -debug output will be written to a file. If the LOG4SH_DEBUG_FILE variable is -set, the internal log4sh debug output will be written to that file instead -of STDERR (assuming of course one of the other log4sh internal debugging -variables has been defined – see the Changes and Enhancements). - -A appender_file_setMaxBackupIndex() stub function was added. - -CHANGES AND ENHANCEMENTS - -As of this release, all source code is now stored under Subversion rather -than CVS. - -Continued cleanup of the code. As with the previous releases, even more -variables are accessed using the ${varname} format rather than just -$varname. More internal variables are being renamed to prevent variable -name clashes. Variables cannot be declared local under Bourne shell which -results in all variables local to a function being inherently global in -scope. Variable clashes ensue. - -The internal log4sh debugging has been reworked. If one of the following -environment variables is set at the time log4sh is sourced, log4sh will be -put into the appropriate debugging mode. The variables are LOG4SH_TRACE, -LOG4SH_DEBUG, and LOG4SH_INFO. Any non-empty string value will enable the -appropriate debugging level. Internally, putting log4sh into debugging mode -now handles the output centrally (which can easily be changed) so that log4sh -debugging statements are shorter and cleaner. - -The _log4sh_mktempDir() function was cleaned up a tiny bit to make it easier -to cut-and-paste this nice function to other shell scripts. - -The _log4sh_level2tag() and _log4sh_tag2level() functions were renamed to -_logger_level_toInt() and _logger_level_toLevel() respectively to better -match the log4j method names. - -The appender_syslog_getFacilityByIndex() and -appender_syslog_getFacilityByName() functions were removed as they should -never have been present. - -Many of the functions were rearranged to bring common functions closer -together in the code base. - -The PatternLayout '%r' conversion character now works properly under all -shells. - -Unit tests are now used to verify correct functionality on all platforms. - -DEPRECATED FEATURES - -The log4sh_readProperties() function was deprecated. It was renamed to -log4sh_doConfigure() to better match the log4j method names. - -The logger_addAppenderWithPattern() function was deprecated. It is not -present in log4j, and was only a helper function. - -BUG FIXES - -The trap restoring code did not work properly as a regex was poorly -written. Any traps set before log4sh is sourced should now properly be called. - -The 1.3.5 release did not work at all with ksh. This has been fixed. It now -passes all unit tests. - -The 1.3.5 release hardly worked under Cygwin. This has been fixed. It now -passes all unit tests. - -The trap handling was changed slightly to work better under Cygwin. - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris shell [/bin/sh] or under Cygwin with ksh [/bin/ksh]. - -The RollingFileAppender and DailyRollingFileAppender appenders do not roll -their files. - -Trap handling is not yet 100% fool-proof. - -Performance is prohibitively slow under Cygwin diff --git a/1.4/doc/RELEASE_NOTES-1.3.7.txt b/1.4/doc/RELEASE_NOTES-1.3.7.txt deleted file mode 100644 index 063d2cf..0000000 --- a/1.4/doc/RELEASE_NOTES-1.3.7.txt +++ /dev/null @@ -1,100 +0,0 @@ -RELEASE NOTES FOR 1.3.7 - -This release of log4sh continues to fill out the planned functionality of the -1.3 series. It adds some more unit tests, as well as fixes some bugs reported -by users. - - -TESTED PLATFORMS - -Cygwin -+ bash 3.2.9(10) -+ pdksh 5.2.14 - -Linux -+ bash 3.1.17(1) -+ dash 0.5.3 -+ ksh 1993-12-28 -+ pdksh 5.2.14 -+ zsh 4.3.2 (does not work) - -Solaris 8 U3 (x86) -+ /bin/sh -+ bash 2.03.0(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (sparc) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (x86) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - - -NEW FEATURES - -Added dash to the list of supported shells. - -Logging to remote hosts via syslog now supported. This requires setting 'nc' -alternative command to point to nc (netcat) as the command is not present by -default on most systems. - -The RollingFileAppender now works properly. Files are rotated based upon a -maximum file size, and the number of backup files can be limited with a maximum -backup index. - - -CHANGES AND ENHANCEMENTS - -There seems to be slowly growing interest in log4sh, so the time has come to -start tracking some bugs more officially in the bug tracking of SourceForge. -The few bugs that were reported for this release have been entered into the -tracking system for the sake of posterity. - -Additional unit tests: -+ testMultipleAppenders -+ testSyslogAppender - - -BUG FIXES - -There were some small bugs reported by users with the SMTPAppender and -SyslogAppender that were fixed. - -There were as well a tiny issue with the dash shell that required some source -rearrangement. The dash shell also did not like the dummy functions used in -shUnit, so they had to be slightly altered. - -The subject was not being set properly in the SMTPAppender. - -The pdksh shell now works properly. - -Bug# 1611574 -- 'unbound variable' error - -Bug# 1614338 -- SyslogAppender not logging - - -DEPRECATED FEATURES - -The logger_pushThreadName() and logger_popThreadName() functions have been -deprecated. They are not part of the standard log4j, and their usefulness is -quite limited seeing as shell does not support threads. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.4/doc/RELEASE_NOTES-1.4.0.txt b/1.4/doc/RELEASE_NOTES-1.4.0.txt deleted file mode 100644 index 8e5b2b7..0000000 --- a/1.4/doc/RELEASE_NOTES-1.4.0.txt +++ /dev/null @@ -1,81 +0,0 @@ -RELEASE NOTES FOR 1.4.0 - -This release of log4sh fixes some bugs that were reported by users. There is no new functionality included. - - -TESTED PLATFORMS - -Cygwin -+ bash 3.2.9(10) -+ pdksh 5.2.14 - -Linux -+ bash 3.1.17(1) -+ dash 0.5.3 -+ ksh 1993-12-28 -+ pdksh 5.2.14 -+ zsh 4.3.2 (does not work) - -Mac OS X 1.4.8 (Darwin 8.8) -+ bash 2.05b.0(1) -+ ksh 1993-12-28 - -Solaris 8 U3 (x86) -+ /bin/sh -+ bash 2.03.0(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (sparc) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - -Solaris 10 U2 (x86) -+ /bin/sh -+ bash 3.00.16(1) -+ ksh M-11/16/88i - - -NEW FEATURES - -The 'mail' command can now be configured as an alternative command using -log4sh_setAlternative(). - - -CHANGES AND ENHANCEMENTS - -The log4sh_doConfigure() function now calls log4sh_resetConfiguration() before -loading a new configuration. - -Added Mac OS X 1.4 as a tested platform. - -Additional unit tests: -+ testSMTPAppender - - -BUG FIXES - -Alternative commands configured in a config file caused errors when read. - -The SMTPAppender did not send mail properly when the Subject contained spaces. - - -DEPRECATED FEATURES - -None. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.4/doc/RELEASE_NOTES-1.4.1.txt b/1.4/doc/RELEASE_NOTES-1.4.1.txt deleted file mode 100644 index 64c9138..0000000 --- a/1.4/doc/RELEASE_NOTES-1.4.1.txt +++ /dev/null @@ -1,66 +0,0 @@ -RELEASE NOTES FOR 1.4.1 - -This release of log4sh is primarily a bugfix release. See the CHANGES-1.4.txt -for a full list of changes. - - -TESTED PLATFORMS - -Cygwin -- bash 3.2.15(13) -- pdksh 5.2.14 - -Linux (Ubuntu Feisty 7.04) -- bash 3.2.13(1) -- dash 0.5.3 -- ksh 1993-12-28 -- pdksh 5.2.14 - -Mac OS X 1.4.8 (Darwin 8.8) -- untested - -Solaris 8 U3 (x86) -- untested - -Solaris 10 U2 (sparc) -- untested - -Solaris 10 U2 (x86) -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i - - -NEW FEATURES - -None. - - -CHANGES AND ENHANCEMENTS - -None. - - -BUG FIXES - -Added missing default for the 'mail' command alternative. - -Logging requests at an invalid level now return an error. - - -DEPRECATED FEATURES - -None. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.4/doc/RELEASE_NOTES-1.4.2.txt b/1.4/doc/RELEASE_NOTES-1.4.2.txt deleted file mode 100644 index bd7286c..0000000 --- a/1.4/doc/RELEASE_NOTES-1.4.2.txt +++ /dev/null @@ -1,79 +0,0 @@ -RELEASE NOTES FOR 1.4.2 - -This release of log4sh is primarily a bugfix release. See the CHANGES-1.4.txt -for a full list of changes. - - -TESTED PLATFORMS - -Cygwin -- bash 3.2.15(13) -- pdksh 5.2.14 - -Linux (Ubuntu Dapper 6.06) -- bash 3.1.17(1) -- ksh 1993-12-28 -- pdksh 5.2.14 - -Linux (Ubuntu Feisty 7.04) -- bash 3.2.13(1) -- dash 0.5.3 -- ksh 1993-12-28 -- pdksh 5.2.14 - -Mac OS X 1.4.9 (Darwin 8.9.1) -- bash 2.05b.0(1) -- ksh 1993-12-28 - -Solaris 8 U3 (x86) -- /bin/sh -- bash 2.03.0(1) -- ksh M-11/16/88i - -Solaris 10 U2 (sparc) -- untested - -Solaris 10 U2 (x86) -- /bin/sh -- bash 3.00.16(1) -- ksh M-11/16/88i - - -NEW FEATURES - -None. - - -CHANGES AND ENHANCEMENTS - -Upgraded shUnit to shUnit2-2.1.1pre as it supports skipping and has a needed -bugfix not present in the latest release version. - - -BUG FIXES - -log4j support wasn't working when a fully qualified class name (e.g. -org.apache.logging.PatternLayout) was used. - -The log4sh_readProperties() function was not properly calling -log4sh_doConfigure(). - - -DEPRECATED FEATURES - -None. - - -KNOWN BUGS AND ISSUES - -Passing of the '\' character in an logging message does not work under the -standard Solaris Bourne shell [/bin/sh], under the dash shell [/bin/dash], or -under Cygwin with ksh [/bin/ksh]. - -The DailyRollingFileAppender appender do not roll files. - -Trap handling is not yet absolutely 100% fool-proof. - -Performance is prohibitively slow under Cygwin - -More error checking/reporting needs to be added; this includes validating input -to public functions. diff --git a/1.4/doc/contributors.txt b/1.4/doc/contributors.txt deleted file mode 100644 index 1320a0f..0000000 --- a/1.4/doc/contributors.txt +++ /dev/null @@ -1,13 +0,0 @@ -The following people have contributed in some way or another to log4sh. - -Aaron Rodden -Aaron Walker -Dan Johansson -Kate Ward -Mickaël Canévet -Omner Calhoun -Rob Holland -Steve Etchelecu -Tim Kordick - -$Revision$ diff --git a/1.4/doc/log4sh.html b/1.4/doc/log4sh.html deleted file mode 100644 index eac6192..0000000 --- a/1.4/doc/log4sh.html +++ /dev/null @@ -1,765 +0,0 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>log4sh

log4sh version 1.4.2

Kate Ward


-            
-          

2007-06-02

Revision History
Revision 1.4.22007-06-02kwd
Revision 1.4.12007-05-06kwd
Revision 1.4.02007-01-05kwd

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


Chapter 1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used.

Tested Operating Systems

  • Cygwin

  • Linux

  • Mac OS X

  • Solaris 8+

Verified Shells

  • BSD Shell (dash)

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

  • Korn Shell (ksh)

  • Public Domain Korn Shell (pdksh) -- partial functionality

See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested.

1. Credits / Contributors

A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool.

2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

Chapter 2. Quickstart

First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests.

Prepare your environment.

-$ make test-prep
-$ cd test
-

Example 2.1. Hello, World!

Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts.

Run the Hello World test.

-$ ./hello_world
-1 [main] INFO shell  - Hello, world!
-

You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not!

The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from ERROR to INFO, and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh.


Example 2.2. Properties Configuration Test

In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code.

Run the properties configuration test.

-$ ./test-prop-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code.


Example 2.3. Runtime Configuration Test

This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime.

Run the runtime configuration test.

-$ ./test-runtime-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed.


Chapter 3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code into the shell script

  3. configure log4sh in code (optional)

  4. call logging statements

-

1. Preconfigure log4sh (optional)

To preconfigure log4sh, create a properties file (see the Properties File later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the Configure log4sh in code section later in this chapter.

2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 3.1. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 3.2. Hello, world (using properties file)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 3.3. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to INFO and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

3. Configure log4sh in code

If log4sh was not preconfigured, the default configuration will be equivalent the config shown below.

Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'.

-log4sh.rootLogger=ERROR, stdout
-log4sh.appender.stdout=ConsoleAppender
-log4sh.appender.stdout.layout=PatternLayout
-log4sh.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 3.4. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set the global logging level to INFO
-logger_setLevel INFO
-
-# add and configure a FileAppender that outputs to STDERR, and activate the
-# configuration
-logger_addAppender stderr
-appender_setType stderr FileAppender
-appender_file_setFile stderr STDERR
-appender_activateOptions stderr
-
-# say Hello to the world
-logger_info 'Hello, world'
-

4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter.

Example 3.5. Standard method of logging a message

logger_info 'message to log'

There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info).

Example 3.6. Alternate method of logging a message

echo 'message to log' |logger_info

Chapter 4. Configuration

1. Properties File

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 4.1. Recommended minimum log4sh.properties file

-  log4sh.rootLogger=INFO, stdout
-  log4sh.appender.stdout=ConsoleAppender
-  

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

1.1. Root Logger

(future)

1.2. Levels

Table 4.1. Logging Levels (from most output to least)

LevelDefinition
TRACEThe TRACE level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

1.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 4.2. Sample appender names

myAppender - good


1.3.1. Types

An appender can be set to one of several different types.

Example 4.3. Setting an appender type

-    log4sh.appender.A1=FileAppender
-    

Table 4.2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial; logs written, but not rotated
RollingFileAppenderoutput sent to a file that rolls over by sizepartial; works, but nees improvement
SMTPAppenderoutput sent via emailparital; works, but needs improvement
SyslogAppenderoutput sent to a remote syslog daemonpartial; only localhost supported

1.3.2. Options

An appender can take several different options.

Example 4.4. Setting an appender option

-    log4sh.appender.A1.File=output.log
-    

Table 4.3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

1.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 4.5. Setting an appender's layout

-    log4sh.appender.A1.layout=PatternLayout
-    

Table 4.4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 4.6. Setting an appender's layout pattern

-    log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-    

Table 4.5. Pattern Options

OptionDefinitionSupported?
cUsed to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'.partial (fixed)
d -

Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, %d{HH:mm:ss,SSS}, or %d{ISODATE}. The specifier is allowed only for compatibility with log4j properties files.

-

The default format of the date returned is equavilant to the output of the Unix date command with a format of +%Y-%m-%d %H:%M:%S.

-
yes
F -

Used to output the file name where the logging request was issued.

-

The default value is equavilent basename $0.

-
yes
LThis option is for compatibility with log4j properties files.no (ignored)
mUsed to output the script supplied message associated with the logging event.yes
nThis option is for compatibility with log4j properties files.no (ignored)
pUsed to output the priority of the logging event.yes
rUsed to output the number of seconds elapsed since the start of the script until the creation of the logging event.yes
t -

Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i

-

The default value is 'main'.

-
yes
xThis option is for compatibility with log4j properties files.no (ignored)
XUsed to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The X conversion character must be followed by an environment variable name placed between braces, as in %X{clientNumber} where clientNumber is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output.no (ignored)
%The sequence %% outputs a single percent sign.yes

2. Environment Variables

There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh.

Here is the full list of supported variables.

Table 4.6. log4sh environment variables

VariableUsage
LOG4SH_CONFIGURATION -

This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration.

-

Example 4.7. LOG4SH_CONFIGURATION variable

LOG4SH_CONFIGURATION='/path/to/log4j.properties'

-
LOG4SH_CONFIG_PREFIX -

This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read.

-

Example 4.8. LOG4SH_CONFIG_PREFIX variable

LOG4SH_CONFIG_PREFIX='log4j'

-

Chapter 5. Advanced Usage

This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood.

1. Environment Variables

There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below.

Table 5.1. log4sh Environment Variables

VariableDefaultDescription
LOG4SH_ALTERNATIVE_NCnoneProvide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc
LOG4SH_CONFIGURATIONnoneProvide log4sh with the absolute path to the log4sh properties file.
LOG4SH_CONFIG_PREFIXlog4shDefine the expected prefix to use for parsing the properties file -- e.g. log4j
LOG4SH_DEBUGnoneEnable internal log4sh debug output. Set to any non-empty value.
LOG4SH_DEBUG_FILEnoneDefine a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log
LOG4SH_INFOnoneEnable internal log4sh info output. Set to any non-empty value.
LOG4SH_TRACEnoneEnable internal log4sh trace output. Set to any non-empty value.

2. Remote Syslog Logging

Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts.

Choice #1 -- reconfigure the syslogd daemon

One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required.

Choice #2 -- install nc (netcat) command -- recommended

The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect.

The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging.

Example 5.1. Sample log4sh properties file demonstrating remote syslog logging

-#
-# log4sh example: remote syslog logging
-#
-
-# Set the 'nc' alternative command to enable remote syslog logging
-log4sh.alternative.nc = /bin/nc
-
- Set root logger level to INFO and its only appender to mySyslog
-log4sh.rootLogger=INFO, mySyslog
-
-# mySyslog is set to be a SyslogAppender.
-log4sh.appender.mySyslog = SyslogAppender
-log4sh.appender.mySyslog.SyslogHost = somehost
-

Example 5.2. Sample shell script demonstrating remote syslog logging

-#! /bin/sh
-#
-# log4sh example: remote syslog logging
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set alternative 'nc' command
-log4sh_setAlternative nc /bin/nc
-
-# add and configure a SyslogAppender that logs to a remote host
-logger_addAppender mySyslog
-appender_setType mySyslog SyslogAppender
-appender_syslog_setFacility mySyslog local4
-appender_syslog_setHost mySyslog somehost
-appender_activateOptions mySyslog
-
-# say Hello to the world
-logger_info 'Hello, world'
-

3. Automated File Rolling

Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your FileAppender into a RollingFileAppender, you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept.

To limit the maximum size of your log files, you need to set the MaxFileSize appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not.

The default maximum file size is equavilent to 1MiB

Table 5.2. Acceptable file size units

UnitSize in bytesEquivalent sizes
B (bytes)11B
KB1,0001KB = 1000B
KiB (kilobytes)1,0241KiB = 1024B
MB1,000,0001MB = 1000KB = 1000000B
MiB (megabytes)1,048,5761MiB = 1024KiB = 1048576B
GB1,000,000,0001GB = 1000MB = 1000000KB = 1000000000B
GiB (gigabytes)1,073,741,8241GiB = 1024MiB = 1048576KiB = 1073741824B
TB1,000,000,000,0001TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B
TiB (terabytes)1,099,511,627,7761TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B

Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j.

To limit the maximum number of backup files kept, you need to set the MaxBackupIndex appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept.

The default maximum backup index is equavilent to '1 MiB'

Example 5.3. Sample log4sh properties file demonstrating a RollingFileAppender

-#
-# log4sh example: using the RollingFileAppender
-#
-
- Set root logger level to INFO and its only appender to R
-log4sh.rootLogger=INFO, R
-
-# add a RollingFileAppender named R
-log4sh.appender.R = RollingFileAppender
-log4sh.appender.R.File = /path/to/some/file
-log4sh.appender.R.MaxFileSize = 10KB
-log4sh.appender.R.MaxBackupIndex = 1
-

Example 5.4. Sample shell script demonstrating a RollingFileAppender

-#! /bin/sh
-#
-# log4sh example: using the RollingFileAppender
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# add and configure a RollingFileAppender named R
-logger_addAppender R
-appender_setType R RollingFileAppender
-appender_file_setFile R '/path/to/some/file'
-appender_file_setMaxFileSize R 10KB
-appender_file_setMaxBackupIndex R 1
-appender_activateOptions R
-
-# say Hello to the world
-logger_info 'Hello, world'
-

Chapter 6. Function Reference

1. Appender

Table 6.1. Appender

- void - -
- appender_activateOptions - (appender); 
string  appender;
-

- Activate an appender's configuration. This should be called after - reconfiguring an appender via code. It needs only to be called once - before any logging statements are called. This calling of this function - will be required in log4sh 1.4.x. -

-
appender_activateAppender myAppender
-
- void - -
- appender_close - (appender); 
string  appender;
-

Disable any further logging via an appender. Once closed, the - appender can be reopened by setting it to any logging Level (e.g. - INFO).

-
appender_close myAppender
-
- boolean - -
- appender_exists - (appender); 
string  appender;
-

Checks for the existance of a named appender

-
exists=`appender_exists myAppender`
-
- string - -
- appender_getAppenderType - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Gets the Type of an Appender at the given array index -

-
type=`appender_getAppenderType 3`
-
- string - -
- appender_getLayout - (appender); 
string  appender;
-

Gets the Layout of an Appender

-
type=`appender_getLayout myAppender`
-
string/boolean - -
- appender_getLevel - (appender); 
string  appender;
-

Gets the current logging Level of an Appender

-
type=`appender_getLevel myAppender`
-
- string - -
- appender_getPattern - (appender); 
string  appender;
-

Gets the Pattern of an Appender

-
pattern=`appender_getPattern myAppender`
-
- string - -
- appender_getType - (appender); 
string  appender;
-

Gets the Type of an Appender

-
type=`appender_getType myAppender`
-
- void - -
- appender_setAppenderType - (appender,  
 type); 
string  appender;
string  type;
-

- Deprecated as of 1.3.1 -

-

- Sets the Type of an Appender (e.g. FileAppender) -

-
appender_setAppenderType myAppender FileAppender
-
- void - -
- appender_setLayout - (appender,  
 layout); 
string  appender;
string  layout;
-

Sets the Layout of an Appender (e.g. PatternLayout)

-
appender_setLayout myAppender PatternLayout
-
void/boolean -
- appender_setLevel - (appender,  
 level); 
string  appender;
string  level;
-

Sets the Level of an Appender (e.g. INFO)

-
appender_setLevel myAppender INFO
-
void/boolean -
- appender_setPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

Sets the Pattern of an Appender

-
appender_setPattern myAppender '%d %p - %m%n'
-
void/boolean -
- appender_setType - (appender,  
 type); 
string  appender;
string  type;
-

Sets the Type of an Appender (e.g. FileAppender)

-
appender_setType myAppender FileAppender
-

2. FileAppender

Table 6.2. FileAppender

- string - -
- appender_file_getFile - (appender); 
string  appender;
-

Get the filename of a FileAppender

-
appender_file_getFile myAppender
-
integer/boolean - -
- appender_file_getMaxBackupIndex - (appender); 
string  appender;
-

- Returns the value of the MaxBackupIndex option. -

-

Since: 1.3.7

-
appender_file_getMaxBackupIndex myAppender
-
integer/boolean - -
- appender_file_getMaxFileSize - (appender); 
string  appender;
-

- Get the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

Since: 1.3.7

-
maxSize=`appender_file_getMaxBackupSize myAppender`
-
- void - -
- appender_file_setFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Set the filename for a FileAppender (e.g. STDERR or - /var/log/log4sh.log). -

-
appender_file_setFile myAppender STDERR
-
- void - -
- appender_file_setMaxBackupIndex - (appender,  
 index); 
string  appender;
integer  index;
-

Set the maximum number of backup files to keep around.

-

- The MaxBackupIndex option determines - how many backup files are kept before the oldest is erased. This option - takes a positive integer value. If set to zero, then there will be no - backup files and the log file will be truncated when it reaches - MaxFileSize. -

-

Since: 1.3.7

-
appender_file_setMaxBackupIndex myAppender 3
-
void/boolean - -
- appender_file_setMaxFileSize - (appender,  
 size); 
string  appender;
string  size;
-

- Set the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

- In configuration files, the MaxFileSize option takes an - long integer in the range 0 - 2^40. You can specify the value with the - suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. For example, - the value "10KiB" will be interpreted as 10240. -

-

Since: 1.3.7

-
appender_file_setMaxBackupSize myAppender 10KiB
-
- void - -
- appender_setAppenderFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Deprecated as of 1.3.2 -

-

- Set the filename for a FileAppender (e.g. "STDERR" or - "/var/log/log4sh.log") -

-
appender_setAppenderFile myAppender STDERR
-

3. Level

Table 6.3. Level

- integer - -
- logger_level_toInt - (level); 
string  level;
-

Converts an externally used level tag into its integer - equivalent

-
levelInt=`logger_level_toInt WARN`
-
- string - -
- logger_level_toLevel - (val); 
integer  val;
-

Converts an internally used level integer into its external level - equivalent

-
level=`logger_level_toLevel 3`
-

4. Log4sh

Table 6.4. Log4sh

void/boolean - -
- log4sh_enableStrictBehavior - (); 
-

- Enables strict log4j behavior. -

-

Since: 1.3.7

-
log4sh_enableStrictBehavior
-
void/boolean - -
- log4sh_setAlternative - (command,  
 path,  
 useRuntimePath); 
string  command;
string  path;
boolean  useRuntimePath;
-

- Specifies an alternative path for a command. -

-

Since: 1.3.7

-
log4sh_setAlternative nc /bin/nc
-

5. Logger

Table 6.5. Logger

- void - -
- log - (level,  
 message(s)); 
string  level;
string[]  message(s);
-

The base logging command that logs a message to all defined - appenders

-
log DEBUG 'This is a test message'
-
void/boolean -
- logger_addAppender - (appender); 
string  appender;
-

Add and initialize a new appender

-
logger_addAppender $appender
-
- void - -
- logger_addAppenderWithPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

- Deprecated as of 1.3.6 -

-

- Add and initialize a new appender with a specific PatternLayout -

-
logger_addAppenderWithPattern $appender '%d %p - %m%n'
-
- void - -
- logger_debug - (message); 
string[]  message;
-

This is a helper function for logging a message at the DEBUG - priority

-
logger_debug 'This is a debug message'
-
- void - -
- logger_error - (message); 
string[]  message;
-

- This is a helper function for logging a message at the ERROR priority -

-
logger_error 'This is a error message'
-
- void - -
- logger_fatal - (message); 
string[]  message;
-

This is a helper function for logging a message at the FATAL - priority

-
logger_fatal 'This is a fatal message'
-
- string - -
- logger_getFilename - (); 
-

- Get the filename that would be shown when the '%F' conversion character - is used in a PatternLayout. -

-
filename=`logger_getFilename`
-
- string - -
- logger_getLevel - (); 
-

Get the global default logging level (e.g. DEBUG).

-
level=`logger_getLevel`
-
- void - -
- logger_info - (message); 
string[]  message;
-

This is a helper function for logging a message at the INFO - priority

-
logger_info 'This is a info message'
-
- void - -
- logger_setFilename - (filename); 
string  filename;
-

Set the filename to be shown when the '%F' conversion character is - used in a PatternLayout.

-
logger_setFilename 'myScript.sh'
-
- void - -
- logger_setLevel - (level); 
string  level;
-

Sets the global default logging level (e.g. DEBUG).

-
logger_setLevel INFO
-
- void - -
- logger_trace - (message); 
string[]  message;
-

This is a helper function for logging a message at the TRACE - priority

-
logger_trace 'This is a trace message'
-
- void - -
- logger_warn - (message); 
string[]  message;
-

- This is a helper function for logging a message at the WARN priority -

-
logger_warn 'This is a warn message'
-

6. Property

Table 6.6. Property

void/boolean - -
- log4sh_doConfigure - (configFileName); 
string  configFileName;
-

- Read configuration from a file. The existing - configuration is not cleared or reset. If you require a - different behavior, then call the log4sh_resetConfiguration - before calling log4sh_doConfigure. -

-
log4sh_doConfigure myconfig.properties
-
- void - -
- log4sh_readProperties - (configFileName); 
string  configFileName;
-

- Deprecated as of 1.3.6 -

-

- See log4sh_doConfigure. -

-
log4sh_readProperties myconfig.properties
-
- void - -
- log4sh_resetConfiguration - (); 
-

- This function completely resets the log4sh configuration to have no - appenders with a global logging level of ERROR. -

-
log4sh_resetConfiguration
-

7. SMTPAppender

Table 6.7. SMTPAppender

- void - -
- appender_setAppenderRecipient - (appender,  
 email); 
string  appender;
string  email;
-

- Deprecated as of 1.3.1 -

-

- Set the to address for the given appender -

-
appender_smtp_setTo myAppender user@example.com
-
- void - -
- appender_setAppenderSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

- Deprecated as of 1.3.1 -

-

- Sets the email subject for an SMTP appender -

-
appender_setAppenderSubject myAppender "This is a test"
-
string/boolean - -
- appender_smtp_getSubject - (appender); 
string  appender;
-

Get the email subject for the given appender

-
subject=`appender_smtp_getSubject myAppender`
-
string/boolean - -
- appender_smtp_getTo - (appender); 
string  appender;
-

Get the to address for the given appender

-
email=`appender_smtp_getTo myAppender`
-
void/boolean - -
- appender_smtp_setSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

Sets the email subject for an SMTP appender

-
appender_smtp_setSubject myAppender "This is a test"
-
void/boolean - -
- appender_smtp_setTo - (appender,  
 email); 
string  appender;
string  email;
-

Set the to address for the given appender

-
appender_smtp_setTo myAppender user@example.com
-

8. SyslogAppender

Table 6.8. SyslogAppender

- string - -
- appender_getSyslogFacility - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Get the syslog facility of the specified appender by index -

-
facility=`appender_getSyslogFacility 3`
-
- void - -
- appender_setSyslogFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

- Deprecated as of 1.3.2 -

-

- Set the syslog facility for the given appender -

-
appender_setSyslogFacility myAppender local4`
-
- void - -
- appender_syslog_getFacility - (appender); 
string  appender;
-

- Get the syslog facility for the given appender. -

-
facility=`appender_syslog_getFacility myAppender`
-
string/boolean - -
- appender_syslog_getHost - (index); 
integer  index;
-

- Get the syslog host of the specified appender. -

-

Since: 1.3.7

-
host=`appender_syslog_getHost myAppender`
-
- void - -
- appender_syslog_setFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

Set the syslog facility for the given appender

-
appender_syslog_setFacility myAppender local4`
-
void/boolean - -
- appender_syslog_setHost - (appender,  
 host); 
string  appender;
string  host;
-

- Set the syslog host for the given appender. Requires that the 'nc' - command alternative has been previously set with the - log4sh_setAlternative() function. -

-

Since: 1.3.7

-
appender_syslog_setHost myAppender localhost
-

9. Thread

Table 6.9. Thread

- string - -
- logger_getThreadName - (); 
-

Gets the current thread name.

-
threadName=`logger_getThreadName`
-
- void - -
- logger_popThreadName - (); 
-

- Deprecated as of 1.3.7 -

-

- Removes the topmost thread name from the stack. The next thread name on - the stack is then placed in the __log4sh_threadName - variable. If the stack is empty, or has only one element left, then a - warning is given that no more thread names can be popped from the stack. -

-
logger_popThreadName
-
- void - -
- logger_pushThreadName - (threadName); 
string  threadName;
-

- Deprecated as of 1.3.7 -

-

- Sets the thread name (eg. the name of the script) and pushes the old on - to a stack for later use. This thread name can be used with the '%t' - conversion character within a PatternLayout. -

-
logger_pushThreadName "myThread"
-
- void - -
- logger_setThreadName - (threadName); 
string  threadName;
-

- Sets the thread name (e.g. the name of the script). This thread name can - be used with the '%t' conversion character within a - PatternLayout. -

-
logger_setThreadName "myThread"
-

10. Trap

Table 6.10. Trap

- void - -
- log4sh_cleanup - (); 
-

This is a cleanup function to remove the temporary directory used by - log4sh. It is provided for scripts who want to do log4sh cleanup work - themselves rather than using the automated cleanup of log4sh that is - invoked upon a normal exit of the script.

-
log4sh_cleanup
-

Chapter 7. Conclusion

The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well.

If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at .

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward.

diff --git a/1.4/doc/style.css b/1.4/doc/style.css deleted file mode 100644 index d3b1628..0000000 --- a/1.4/doc/style.css +++ /dev/null @@ -1,40 +0,0 @@ -/* - style.css - a CSS stylesheet for use with HTML output produced by - tldp-xsl stylesheets. Written by David Horton. -*/ - - -body { - -/* - Style the HMTL tag with a sans-serif font and 6% margin. - A sans-serif font makes documents easier to read when displayed on - a computer screen. Whitespace surrounding the document should - make it easier to read both on screen and on printed paper. The - value of 6% was chosen because it closely approximates a one-half - inch margin on a US letter (8.5" by 11") paper. Since the margin - is expressed as a percentage it should scale well in a web browser - window. -*/ - - font-family: sans-serif; - margin: 6%; -} - - -.programlisting, .screen { - -/* - Style the programlisting and screen classes with a light gray - background and a small bit of space between the object border and - the text inside. The programlisting and screen classes are HTML - representations of the and DocBook tags. -*/ - - background: lightgray; - padding: 5px; -} - - -/* Add any desired customizations below. */ - diff --git a/1.4/lib/sh/shunit2 b/1.4/lib/sh/shunit2 deleted file mode 100644 index 747b2c8..0000000 --- a/1.4/lib/sh/shunit2 +++ /dev/null @@ -1,884 +0,0 @@ -# $Id: shunit2 71 2007-06-02 18:42:46Z sfsetse $ -# vim:syntax=sh:sts=2 -# vim:foldmethod=marker:foldmarker=/**,*/ -# -#/** -# -# -# -# shUnit 2.1.0 -# Shell Unit Test Framework -# -# http://shunit2.sourceforge.net/ -# -# written by Kate Ward <kate.ward@forestent.com> -# released under the LGPL -# -# this module implements a xUnit based unit test framework similar to JUnit -# -#*/ - -# shell flags for shunit: -# u - treat unset variables as an error when performing parameter expansion -__SHUNIT_SHELL_FLAGS='u' - -# save the current set of shell flags, and then set some for ourselves -__shunit_oldShellFlags="$-" -for _shunit_shellFlag in `echo "${__SHUNIT_SHELL_FLAGS}" |sed 's/\(.\)/\1 /g'` -do - set -${_shunit_shellFlag} -done - -# constants - -__SHUNIT_VERSION='2.1.1pre' - -SHUNIT_TRUE=0 -SHUNIT_FALSE=1 - -__SHUNIT_ASSERT_MSG_PREFIX='ASSERT:' - -for _su_const in `set |grep "^__SHUNIT_" |cut -d= -f1`; do - readonly ${_su_const} -done -unset _su_const - -# variables -__shunit_skip=${SHUNIT_FALSE} -__shunit_suite='' - -__shunit_testsPassed=0 -__shunit_testsFailed=0 -__shunit_testsSkipped=0 -__shunit_testsTotal=0 - -#----------------------------------------------------------------------------- -# assert functions -# - -#/** -# -# -# void -# -# -# -# -# assertEquals -# string [message] -# string expected -# string actual -# -# -# Asserts that expected and -# actual are equal to one another. The message is -# optional. -# -# -#*/ -assertEquals() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 3 ]; then - _su_message=$1 - shift - fi - _su_expected=$1 - _su_actual=$2 - - if [ "${_su_expected}" = "${_su_actual}" ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_expected _su_actual -} - -#/** -# -# -# void -# -# -# -# -# assertNull -# string [message] -# string value -# -# -# Asserts that value is null, -# or in shell terms a zero-length string. The message is optional. -# -# -#*/ -assertNull() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_value=$1 - - _su_value2=`eval echo "${_su_value}"` - if [ -z "${_su_value2}" ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_value _su_value2 -} - -#/** -# -# -# void -# -# -# -# -# assertNotNull -# string [message] -# string value -# -# -# Asserts that value is not null, or in shell terms not -# a zero-length string. The message is optional. -# -# -#*/ -assertNotNull() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_value=$1 - - _su_value2=`eval echo "${_su_value}"` - if [ -n "${_su_value2}" ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_value _su_value2 -} - -#/** -# -# -# void -# -# -# -# -# assertSame -# string [message] -# string expected -# string actual -# -# -# This function is functionally equivalent to -# assertEquals. -# -# -#*/ -assertSame() -{ - assertEquals "$@" -} - -#/** -# -# -# void -# -# -# -# -# assertNotSame -# string [message] -# string expected -# string actual -# -# -# Asserts that expected and -# actual are not equal to one another. The message is optional. -# -# -#*/ -assertNotSame() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 3 ]; then - _su_message=$1 - shift - fi - _su_expected=$1 - _su_actual=$2 - - if [ "${_su_expected}" != "${_su_actual}" ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_expected _su_actual -} - -#/** -# -# -# void -# -# -# -# -# assertTrue -# string [message] -# string condition -# -# -# Asserts that a given shell test condition is true. The message is -# optional. -# Testing whether something is true or false is easy enough by using -# the assertEquals/assertNotSame functions. Shell supports much more -# complicated tests though, and a means to support them was needed. As such, -# this function tests that conditions are true or false through evaluation -# rather than just looking for a true or false. -# -# The following test will succeed: assertTrue "[ 34 -gt 23 ]" -# The folloing test will fail with a message: assertTrue "test failed" "[ -r '/non/existant/file' ]" -# -# -# -#*/ -assertTrue() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_condition=$1 - - ( eval ${_su_condition} ) >/dev/null 2>&1 - if [ $? -eq ${SHUNIT_TRUE} ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_condition -} - -#/** -# -# -# void -# -# -# -# -# assertFalse -# string [message] -# string condition -# -# -# Asserts that a given shell test condition is false. The message is -# optional. -# Testing whether something is true or false is easy enough by using -# the assertEquals/assertNotSame functions. Shell supports much more -# complicated tests though, and a means to support them was needed. As such, -# this function tests that conditions are true or false through evaluation -# rather than just looking for a true or false. -# -# The following test will succeed: assertFalse "[ 'apples' = 'oranges' ]" -# The folloing test will fail with a message: assertFalse "test failed" "[ 1 -eq 1 -a 2 -eq 2 ]" -# -# -# -#*/ -assertFalse() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _su_message='' - if [ $# -eq 2 ]; then - _su_message=$1 - shift - fi - _su_condition=$1 - - ( eval ${_su_condition} ) >/dev/null 2>&1 - if [ $? -eq ${SHUNIT_FALSE} ]; then - _shunit_testPassed - return ${SHUNIT_TRUE} - else - _shunit_testFailed "${_su_message}" - return ${SHUNIT_FALSE} - fi - - unset _su_message _su_condition -} - -#----------------------------------------------------------------------------- -# failure functions -# - -#/** -# -# -# void -# -# -# -# -# fail -# string [message] -# -# -# Fails the test immediately, with the optional message. -# -# -#*/ -fail() -{ - _shunit_shouldSkip && return ${SHUNIT_TRUE} - - _shunit_testFailed "${@:-}" -} - -#/** -# -# -# void -# -# -# -# -# failNotEquals -# string [message] -# string expected -# string actual -# -# -# Fails the test if expected and -# actual are not -# equal to one another. The message is optional. -# -# -#*/ -failNotEquals() -{ - assertEquals "$@" -} - -#/** -# -# -# void -# -# -# -# -# failSame -# string [message] -# string expected -# string actual -# -# -# Fails the test if expected and -# actual are equal to one another. The message is -# optional. -# -# -#*/ -failSame() -{ - assertNotSame "$@" -} - -#/** -# -# -# void -# -# -# -# -# failNotSame -# string [message] -# string expected -# string actual -# -# -# Fails the test if expected and -# actual are equal to one another. The message is -# optional. -# -# -#*/ -failNotSame() -{ - assertEquals "$@" -} - -#----------------------------------------------------------------------------- -# skipping functions -# - -#/** -# -# -# void -# -# -# -# -# startSkipping -# -# -# -# This function forces the remaining assert and fail functions to be -# "skipped", i.e. they will have no effect. Each function skipped will be -# recorded so that the total of asserts and fails will not be altered. -# -# -#*/ -startSkipping() -{ - __shunit_skip=${SHUNIT_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# endSkipping -# -# -# -# This function returns calls to the assert and fail functions to their -# default behavior, i.e. they will be called. -# -# -#*/ -endSkipping() -{ - __shunit_skip=${SHUNIT_FALSE} -} - -#/** -# -# -# boolean -# -# -# -# -# isSkipping -# -# -# -# This function returns the state of skipping. -# -# -#*/ -isSkipping() -{ - return ${__shunit_skip} -} - -#----------------------------------------------------------------------------- -# suite functions -# - -#/** -# -# -# void -# -# -# -# -# suite -# -# -# -# This function can be optionally overridden by the user in their test -# suite. -# If this function exists, it will be called when -# shunit2 is sourced. If it does not exist, -# shunit2 will search the parent script for all functions -# beginning with the word test, and they will be added -# dynamically to the test suite. -# -# -#*/ -# Note: see _shunit_mktempFunc() for actual implementation -# suite() { :; } - -#/** -# -# -# void -# -# -# -# -# suite_addTest -# string function -# -# -# This function adds a function name to the list of tests scheduled for -# execution as part of this test suite. This function should only be called -# from within the suite() function. -# -# -#*/ -suite_addTest() -{ - _su_func=$1 - - __shunit_suite="${__shunit_suite:+${__shunit_suite} }${_su_func}" - - unset _su_func -} - -#/** -# -# -# void -# -# -# -# -# oneTimeSetUp -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called once before any tests are -# run. It is useful to prepare a common environment for all tests. -# -# -#*/ -# Note: see _shunit_mktempFunc() for actual implementation -# oneTimeSetUp() { :; } - -#/** -# -# -# void -# -# -# -# -# oneTimeTearDown -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called once after all tests are -# completed. It is useful to clean up the environment after all tests. -# -# -#*/ -# Note: see _shunit_mktempFunc() for actual implementation -# oneTimeTearDown() { :; } - -#/** -# -# -# void -# -# -# -# -# setUp -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called before each test is run. -# It is useful to reset the environment before each test. -# -# -#*/ -# Note: see _shunit_mktempFunc() for actual implementation -# setUp() { :; } - -#/** -# -# -# void -# -# -# -# -# tearDown -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called after each test completes. -# It is useful to clean up the environment after each test. -# -# -#*/ -# Note: see _shunit_mktempFunc() for actual implementation -# tearDown() { :; } - -#------------------------------------------------------------------------------ -# internal shUnit functions -# - -_shunit_cleanup() -{ - name=$1 - - case ${name} in - EXIT) signal=0 ;; - INT) signal=2 ;; - TERM) signal=15 ;; - esac - - # do our work - rm -fr "${__shunit_tmpDir}" - - # exit for all non-EXIT signals - if [ ${name} != 'EXIT' ]; then - echo "trapped and now handling the ${name} signal" >&2 - _shunit_generateReport - # disable EXIT trap - trap 0 - # add 127 to signal and exit - signal=`expr ${signal} + 127` - exit ${signal} - fi -} - -_shunit_execSuite() -{ - echo '#' - echo '# Performing tests' - echo '#' - for _su_func in ${__shunit_suite}; do - # disable skipping - endSkipping - - # execute the per-test setup function - setUp - - # execute the test - echo "${_su_func}" - eval ${_su_func} - - # execute the per-test tear-down function - tearDown - done - - unset _su_func -} - -_shunit_functionExists() -{ - _su__func=$1 - type ${_su__func} 2>/dev/null |grep "is a function$" >/dev/null - _su__return=$? - unset _su__func - return ${_su__return} -} - -_shunit_generateReport() -{ - _su__awk='{printf("%4d %3.0f%%", $1, $1*100/$2)}' - if [ ${__shunit_testsTotal} -gt 0 ]; then - _su__passed=`echo ${__shunit_testsPassed} ${__shunit_testsTotal} |\ - awk "${_su__awk}"` - _su__failed=`echo ${__shunit_testsFailed} ${__shunit_testsTotal} |\ - awk "${_su__awk}"` - _su__skipped=`echo ${__shunit_testsSkipped} ${__shunit_testsTotal} |\ - awk "${_su__awk}"` - _su__total=`echo ${__shunit_testsTotal} 100 |\ - awk '{printf("%4d %3d%%", $1, $2)}'` - else - _su__passed=`echo 0 0 |awk '{printf("%4d %3d%%", $1, $2)}'` - _su__failed=${_su__passed} - _su__skipped=${_su__passed} - _su__total=${_su__passed} - fi - - cat </dev/null ) && return - - # the standard mktemp didn't work. doing our own. - if [ -r '/dev/urandom' ]; then - _su__random=`od -vAn -N4 -tx4 &2 - exit 1 - } - - echo ${_su__tmpDir} - unset _su__date _su__random _su__tmpDir -} - -# this function is here to work around issues in Cygwin -_shunit_mktempFunc() -{ - for _su__func in oneTimeSetUp oneTimeTearDown setUp tearDown suite; do - _su__file="${__shunit_tmpDir}/${_su__func}" - cat <"${_su__file}" -#! /bin/sh -exit 0 -EOF - chmod +x "${_su__file}" - done - - unset _su__file -} - -_shunit_shouldSkip() -{ - [ ${__shunit_skip} -eq ${SHUNIT_FALSE} ] && return ${SHUNIT_FALSE} - _shunit_testSkipped -} - -_shunit_testPassed() -{ - __shunit_testsPassed=`expr ${__shunit_testsPassed} + 1` - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` -} - -_shunit_testFailed() -{ - [ $# -eq 1 ] && _su__msg=$1 - - __shunit_testsFailed=`expr ${__shunit_testsFailed} + 1` - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` - - [ -z "${_su__msg:-}" ] && _su__msg='failed' - echo "${__SHUNIT_ASSERT_MSG_PREFIX} ${_su__msg}" >&2 - unset _su__msg -} - -_shunit_testSkipped() -{ - __shunit_testsSkipped=`expr ${__shunit_testsSkipped} + 1` - __shunit_testsTotal=`expr ${__shunit_testsTotal} + 1` -} - -#------------------------------------------------------------------------------ -# main -# - -# create a temporary storage location -__shunit_tmpDir=`_shunit_mktempDir` - -# setup traps to clean up after ourselves -trap '_shunit_cleanup EXIT' 0 -trap '_shunit_cleanup INT' 2 -trap '_shunit_cleanup TERM' 15 - -# create phantom functions to work around issues with Cygwin -_shunit_mktempFunc -PATH="${__shunit_tmpDir}:${PATH}" - -# execute the oneTimeSetUp function (if it exists) -#_shunit_functionExists oneTimeSetUp && oneTimeSetUp -oneTimeSetUp - -# deprecated: execute the suite function defined in the parent test script -suite - -# if no suite function was defined, dynamically build a list of functions -if [ -z "${__shunit_suite}" ]; then - funcs=`grep "^[ \t]*test[A-Za-z0-9_]* *()" $0 |sed 's/[^A-Za-z0-9_]//g'` - for func in ${funcs}; do - suite_addTest ${func} - done -fi - -# execute the tests -_shunit_execSuite - -# execute the oneTimeTearDown function (if it exists) -oneTimeTearDown - -# generate report -_shunit_generateReport - -# restore the previous set of shell flags -for _shunit_shellFlag in ${__SHUNIT_SHELL_FLAGS}; do - echo ${__shunit_oldShellFlags} |grep ${_shunit_shellFlag} >/dev/null \ - || set +${_shunit_shellFlag} -done -unset _shunit_shellFlag - -#/** -# -#*/ diff --git a/1.4/share/dist/index.txt b/1.4/share/dist/index.txt deleted file mode 100644 index 2a62249..0000000 --- a/1.4/share/dist/index.txt +++ /dev/null @@ -1,10 +0,0 @@ -docbook-xml-4.4.zip - http://www.docbook.org/xml/4.4/docbook-xml-4.4.zip - http://www.oasis-open.org/docbook/xml/4.4/docbook-xml-4.4.zip -docbook-xml-4.5.zip - http://www.docbook.org/xml/4.5/docbook-xml-4.5.zip - -docbook-xsl-1.71.0.tar.bz2 - http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.71.0.tar.bz2?download -docbook-xsl-1.71.1.tar.bz2 - http://downloads.sourceforge.net/docbook/docbook-xsl-1.71.1.tar.bz2?use_mirror=puzzle diff --git a/1.4/share/docbook/Makefile b/1.4/share/docbook/Makefile deleted file mode 100644 index 1a1e77d..0000000 --- a/1.4/share/docbook/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# -# makefile to setup the the docbook support directory -# - -CWD=`pwd` -DIST=$(CWD)/../dist -XML=docbook-xml-4.4.zip -XSLT=docbook-xsl-1.71.1.tar.bz2 - -all: extract-xml extract-xslt - -extract-xml: - if test ! -d xml/4.4; then \ - mkdir -p xml/4.4; \ - unzip -qq $(DIST)/$(XML) -d xml/4.4; \ - fi - -extract-xslt: - if test ! -d docbook-xsl/1.71.1; then \ - mkdir -p docbook-xsl; \ - bzip2 -dc $(DIST)/$(XSLT) |tar xf -; \ - mv docbook-xsl-1.71.1 docbook-xsl/1.71.1; \ - ln -s 1.71.1 docbook-xsl/current; \ - fi - -clean: - rm -fr xml docbook-xsl* diff --git a/1.4/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl b/1.4/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl deleted file mode 100644 index b7a7d43..0000000 --- a/1.4/share/docbook/tldp-xsl/21MAR2004/fo/tldp-print.xsl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - -start - - - - - - - - diff --git a/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl b/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl deleted file mode 100644 index f8cf7b1..0000000 --- a/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-common.xsl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -text/css - - - - - - - diff --git a/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl b/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl deleted file mode 100644 index 16994ad..0000000 --- a/1.4/share/docbook/tldp-xsl/21MAR2004/html/tldp-one-page.xsl +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/1.4/src/docbook/advancedusage.xml b/1.4/src/docbook/advancedusage.xml deleted file mode 100644 index 17d7bd2..0000000 --- a/1.4/src/docbook/advancedusage.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - -Advanced Usage - This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood. - -
Environment Variables - There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below. - - - log4sh Environment Variables - - - - Variable - Default - Description - - - - - LOG4SH_ALTERNATIVE_NC - none - Provide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc - - - LOG4SH_CONFIGURATION - none - Provide log4sh with the absolute path to the log4sh properties file. - - - LOG4SH_CONFIG_PREFIX - - Define the expected prefix to use for parsing the properties file -- e.g. - - - LOG4SH_DEBUG - none - Enable internal log4sh debug output. Set to any non-empty value. - - - LOG4SH_DEBUG_FILE - none - Define a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log - - - LOG4SH_INFO - none - Enable internal log4sh info output. Set to any non-empty value. - - - LOG4SH_TRACE - none - Enable internal log4sh trace output. Set to any non-empty value. - - - -
-
- -
Remote Syslog Logging - Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts. - - Choice #1 -- reconfigure the syslogd daemon - - One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required. - - Choice #2 -- install nc (netcat) command -- recommended - - The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect. - - The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging. - - Sample log4sh properties file demonstrating remote syslog logging - - - - Sample shell script demonstrating remote syslog logging - - -
- -
- Automated File Rolling - - Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your into a , you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept. - - To limit the maximum size of your log files, you need to set the appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not. - - The default maximum file size is equavilent to 1MiB - - - Acceptable file size units - - - - Unit - Size in bytes - Equivalent sizes - - - - - B (bytes) - 1 - 1B - - - KB - 1,000 - 1KB = 1000B - - - KiB (kilobytes) - 1,024 - 1KiB = 1024B - - - MB - 1,000,000 - 1MB = 1000KB = 1000000B - - - MiB (megabytes) - 1,048,576 - 1MiB = 1024KiB = 1048576B - - - GB - 1,000,000,000 - 1GB = 1000MB = 1000000KB = 1000000000B - - - GiB (gigabytes) - 1,073,741,824 - 1GiB = 1024MiB = 1048576KiB = 1073741824B - - - TB - 1,000,000,000,000 - 1TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B - - - TiB (terabytes) - 1,099,511,627,776 - 1TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B - - - -
- - Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j. - - To limit the maximum number of backup files kept, you need to set the appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept. - - The default maximum backup index is equavilent to '1 MiB' - - Sample log4sh properties file demonstrating a RollingFileAppender - - - - Sample shell script demonstrating a RollingFileAppender - - -
-
diff --git a/1.4/src/docbook/build.xml b/1.4/src/docbook/build.xml deleted file mode 100644 index 5cf6ba5..0000000 --- a/1.4/src/docbook/build.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/1.4/src/docbook/conclusion.xml b/1.4/src/docbook/conclusion.xml deleted file mode 100644 index ca2c57b..0000000 --- a/1.4/src/docbook/conclusion.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - -Conclusion - The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well. - - If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at &myEmail;. - - Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward. - diff --git a/1.4/src/docbook/configuration.xml b/1.4/src/docbook/configuration.xml deleted file mode 100644 index 4ced5a4..0000000 --- a/1.4/src/docbook/configuration.xml +++ /dev/null @@ -1,363 +0,0 @@ - - - - - -Configuration - -
Properties File - Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf"). - - A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example. - - Recommended minimum log4sh.properties file - - - - In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender. - -
Root Logger - (future) -
- -
Levels - Logging Levels (from most output to least) - - - - Level - Definition - - - - - &trace; - The &trace; level has the lowest possible rank and is intended to turn on all logging. - - &debug; - The &debug; level designates fine-grained informational events that are most useful to debug an application. - - &info; - The &info; level designates informational messages that highlight the progress of the application at coarse-grained level. - - &warn; - The &warn; level designates potentially harmful situations. - - &error; - The &error; level designates error events that might still allow the application to continue running. - - &fatal; - The &fatal; level designates very severe error events that will presumably lead the application to abort. - - &off; - The &off; level has the highest possible rank and is intended to turn off logging. - - - -
-
- -
Appenders - An appender name can be any alpha-numeric string containing no spaces. - - Sample appender names - myAppender - good - - -
Types - An appender can be set to one of several different types. - - Setting an appender type - - - - Appender Types - - - - Type - Definition - Supported? - - - - - ConsoleAppender - output sent to console (STDOUT) - yes - - - FileAppender - output sent to a file - yes - - - DailyRollingFileAppender - output sent to a file that rolls over daily - partial; logs written, but not rotated - - - RollingFileAppender - output sent to a file that rolls over by size - partial; works, but nees improvement - - - SMTPAppender - output sent via email - parital; works, but needs improvement - - - SyslogAppender - output sent to a remote syslog daemon - partial; only localhost supported - - - -
-
- -
Options - An appender can take several different options. - - Setting an appender option - - - - Appender Options - - - - Option - Definition - Supported? - - - - - DatePattern - configure a pattern for the output filename - no (ignored) - - - File - output filename (special filename of STDERR used for logging to STDERR) - yes - - - MaxBackupIndex - number of old logfiles to keep - no (ignored) - - - MaxFileSize - maximum size of old logfiles - no (ignored) - - - Threshold - logging level of the appender - yes - - - -
-
- -
Layouts - An appender can be configured with various Layouts to customize how the output looks. - - Setting an appender's layout - - - - Layouts - - - - Layout - Definition - Supported? - - - - - HTMLLayout - layout using HTML - no (same as SimpleLayout) - - - SimpleLayout - a simple default layout ('%p - %m') - yes - - - PatternLayout - a patterned layout (default: '%d %p - %m%n') - yes - - - -
- - An layout has many different options to configure how it appears. These are known as patterns. - - Setting an appender's layout pattern - - - - Pattern Options - - - - Option - Definition - Supported? - - - - - - c - Used to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'. - partial (fixed) - - - - d - - Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, , or . The specifier is allowed only for compatibility with log4j properties files. - The default format of the date returned is equavilant to the output of the Unix date command with a format of . - - yes - - - - F - - Used to output the file name where the logging request was issued. - The default value is equavilent basename $0. - - yes - - - - L - This option is for compatibility with log4j properties files. - no (ignored) - - - - m - Used to output the script supplied message associated with the logging event. - yes - - - - n - This option is for compatibility with log4j properties files. - no (ignored) - - - - p - Used to output the priority of the logging event. - yes - - - - r - Used to output the number of seconds elapsed since the start of the script until the creation of the logging event. - yes - - - - t - - Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i - The default value is 'main'. - - yes - - - - x - This option is for compatibility with log4j properties files. - no (ignored) - - - - X - Used to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The conversion character must be followed by an environment variable name placed between braces, as in where is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output. - no (ignored) - - - - % - The sequence outputs a single percent sign. - yes - - - - -
- -
-
-
- -
Environment Variables - There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh. - - Here is the full list of supported variables. - - log4sh environment variables - - - - Variable - Usage - - - - - LOG4SH_CONFIGURATION - - This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration. - - LOG4SH_CONFIGURATION variable - LOG4SH_CONFIGURATION='/path/to/log4j.properties' - - - - - LOG4SH_CONFIG_PREFIX - - This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read. - - LOG4SH_CONFIG_PREFIX variable - LOG4SH_CONFIG_PREFIX='log4j' - - - - - -
-
- -
diff --git a/1.4/src/docbook/functions.xml b/1.4/src/docbook/functions.xml deleted file mode 100644 index c960e55..0000000 --- a/1.4/src/docbook/functions.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Functions - This XML file is a placeholder. It is meant to be overwritten with the dynamically generated XML document that is extracted from the source code. - diff --git a/1.4/src/docbook/introduction.xml b/1.4/src/docbook/introduction.xml deleted file mode 100644 index aaf3154..0000000 --- a/1.4/src/docbook/introduction.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Introduction - Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used. - -
Tested Operating Systems - - Cygwin - Linux - Mac OS X - Solaris 8+ - -
- -
Verified Shells - - BSD Shell (dash) - Bourne Shell (sh) - Bourne Again Shell (bash) - Korn Shell (ksh) - Public Domain Korn Shell (pdksh) -- partial functionality - -
- - See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested. - - -
Credits / Contributors - A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool. -
- - -
Feedback - Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: &myEmail;. -
-
diff --git a/1.4/src/docbook/log4sh.xml b/1.4/src/docbook/log4sh.xml deleted file mode 100644 index d0a2943..0000000 --- a/1.4/src/docbook/log4sh.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - TRACE"> - DEBUG"> - INFO"> - WARN"> - ERROR"> - FATAL"> - OFF"> -]> - -log4sh - - log4sh version 1.4.2 - - - KateWard - -
- &myEmail; -
-
-
-
- - - &isoDate; - - - - - - - 1.4.2 - 2007-06-02 - kwd - - - - 1.4.1 - 2007-05-06 - kwd - - - - 1.4.0 - 2007-01-05 - kwd - - - - - - log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce. - -
- - &introduction; - &quickstart; - &usage; - &configuration; - &advancedusage; - &functions; - &conclusion; -
diff --git a/1.4/src/docbook/quickstart.xml b/1.4/src/docbook/quickstart.xml deleted file mode 100644 index 42e8504..0000000 --- a/1.4/src/docbook/quickstart.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - -Quickstart - First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests. - - Prepare your environment. - - - - - Hello, World! - Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts. - - Run the Hello World test. - - - - You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not! - - The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from to , and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh. - - - - Properties Configuration Test - In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code. - - Run the properties configuration test. - - - - You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code. - - - - Runtime Configuration Test - This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime. - - Run the runtime configuration test. - - - - You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed. - - - diff --git a/1.4/src/docbook/usage.xml b/1.4/src/docbook/usage.xml deleted file mode 100644 index 454cca2..0000000 --- a/1.4/src/docbook/usage.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - -Usage Guide - The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application. - - - - preconfigure log4sh (properties file) - source the log4sh script code into the shell script - configure log4sh in code (optional) - call logging statements - - - -
Preconfigure log4sh (optional) - To preconfigure log4sh, create a properties file (see the later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the section later in this chapter. -
- -
Source log4sh - To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done. - - - Sourcing external shell code into current program - - - - Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the &info; level to STDOUT. - - - Hello, world (using properties file) - &2 - exit 1 -fi -. $log4shDir/log4sh - -# say Hello to the world -logger_info "Hello, world" -]]> - - - Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from. - - - Hello, world; properties file - - -
- -
Configure log4sh in code - If log4sh was not preconfigured, the default configuration will be equivalent the config shown below. - - Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'. - - - - To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the &info; level. - - - Hello, world (configured in code) - - -
- -
Logging with log4sh - Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an &info; level. - - The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter. - - - Standard method of logging a message - logger_info 'message to log' - - - There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info). - - Alternate method of logging a message - echo 'message to log' |logger_info - -
- -
diff --git a/1.4/src/examples/hello_world b/1.4/src/examples/hello_world deleted file mode 100755 index 833ee7b..0000000 --- a/1.4/src/examples/hello_world +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# - -# load log4sh -if [ -r log4sh ]; then - LOG4SH_CONFIGURATION='none' . ./log4sh -else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 -fi - -# change the default message level from ERROR to INFO -logger_setLevel INFO - -# say hello to the world -logger_info "Hello, world!" diff --git a/1.4/src/examples/log4sh.properties.ex1 b/1.4/src/examples/log4sh.properties.ex1 deleted file mode 100644 index e489cf2..0000000 --- a/1.4/src/examples/log4sh.properties.ex1 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to INFO and its only appender to A1 -log4sh.rootLogger = INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1 = ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout = PatternLayout -log4sh.appender.A1.layout.ConversionPattern = %-4r [%t] %-5p %c %x - %m%n diff --git a/1.4/src/examples/log4sh.properties.ex2 b/1.4/src/examples/log4sh.properties.ex2 deleted file mode 100644 index 77795df..0000000 --- a/1.4/src/examples/log4sh.properties.ex2 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to INFO and its only appender to A1 -log4sh.rootLogger = INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1 = ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout = PatternLayout -log4sh.appender.A1.layout.ConversionPattern = %d [%F:%t] %p %c - %m%n diff --git a/1.4/src/resources/shelldoc.xslt b/1.4/src/resources/shelldoc.xslt deleted file mode 100644 index bd25475..0000000 --- a/1.4/src/resources/shelldoc.xslt +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - Function Reference - - - -
- shelldoc-section- - <xsl:value-of select="@group"/> - - shelldoc-function- - <xsl:value-of select="@group"/> - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - -
diff --git a/1.4/src/shell/log4sh b/1.4/src/shell/log4sh deleted file mode 100644 index 3103840..0000000 --- a/1.4/src/shell/log4sh +++ /dev/null @@ -1,3841 +0,0 @@ -# $Id$ -# vim:syntax=sh:sts=2 -# vim:foldmethod=marker:foldmarker=/**,*/ -# -#/** -# -# -# -# log4sh 1.4.3 -# -# http://log4sh.sourceforge.net/ -# -# written by Kate Ward <kate.ward@forestent.com> -# released under the LGPL -# -# this module implements something like the log4j module from the Apache group -# -# notes: -# *) the default appender is a ConsoleAppender named stdout with a level -# of ERROR and layout of SimpleLayout -# *) the appender levels are as follows (decreasing order of output): -# TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF -# -#*/ - -# shell flags for log4sh: -# u - treat unset variables as an error when performing parameter expansion -__LOG4SH_SHELL_FLAGS='u' - -# save the current set of shell flags, and then set some for log4sh -__log4sh_oldShellFlags=$- -for _log4sh_shellFlag in `echo "${__LOG4SH_SHELL_FLAGS}" |sed 's/\(.\)/\1 /g'` -do - set -${_log4sh_shellFlag} -done -unset _log4sh_shellFlag - -# -# constants -# -__LOG4SH_VERSION='1.4.3pre' - -__LOG4SH_TRUE=0 -__LOG4SH_FALSE=1 -__LOG4SH_ERROR=2 -__LOG4SH_NULL='~' - -__LOG4SH_APPENDER_FUNC_PREFIX='_log4sh_app_' -__LOG4SH_APPENDER_INCLUDE_EXT='.inc' - -__LOG4SH_TYPE_CONSOLE='ConsoleAppender' -__LOG4SH_TYPE_DAILY_ROLLING_FILE='DailyRollingFileAppender' -__LOG4SH_TYPE_FILE='FileAppender' -__LOG4SH_TYPE_ROLLING_FILE='RollingFileAppender' -__LOG4SH_TYPE_ROLLING_FILE_MAX_BACKUP_INDEX=1 -__LOG4SH_TYPE_ROLLING_FILE_MAX_FILE_SIZE=10485760 -__LOG4SH_TYPE_SMTP='SMTPAppender' -__LOG4SH_TYPE_SYSLOG='SyslogAppender' -__LOG4SH_TYPE_SYSLOG_FACILITY_NAMES=' kern user mail daemon auth security syslog lpr news uucp cron authpriv ftp local0 local1 local2 local3 local4 local5 local6 local7 ' -__LOG4SH_TYPE_SYSLOG_FACILITY='user' - -__LOG4SH_LAYOUT_HTML='HTMLLayout' -__LOG4SH_LAYOUT_SIMPLE='SimpleLayout' -__LOG4SH_LAYOUT_PATTERN='PatternLayout' - -__LOG4SH_LEVEL_TRACE=0 -__LOG4SH_LEVEL_TRACE_STR='TRACE' -__LOG4SH_LEVEL_DEBUG=1 -__LOG4SH_LEVEL_DEBUG_STR='DEBUG' -__LOG4SH_LEVEL_INFO=2 -__LOG4SH_LEVEL_INFO_STR='INFO' -__LOG4SH_LEVEL_WARN=3 -__LOG4SH_LEVEL_WARN_STR='WARN' -__LOG4SH_LEVEL_ERROR=4 -__LOG4SH_LEVEL_ERROR_STR='ERROR' -__LOG4SH_LEVEL_FATAL=5 -__LOG4SH_LEVEL_FATAL_STR='FATAL' -__LOG4SH_LEVEL_OFF=6 -__LOG4SH_LEVEL_OFF_STR='OFF' -__LOG4SH_LEVEL_CLOSED=255 -__LOG4SH_LEVEL_CLOSED_STR='CLOSED' - -__LOG4SH_PATTERN_DEFAULT='%d %p - %m%n' -__LOG4SH_THREAD_DEFAULT='main' - -__LOG4SH_CONFIGURATION="${LOG4SH_CONFIGURATION:-log4sh.properties}" -__LOG4SH_CONFIG_PREFIX="${LOG4SH_CONFIG_PREFIX:-log4sh}" -__LOG4SH_CONFIG_LOG4J_CP='org.apache.log4j' - -# the following IFS is *supposed* to be on two lines!! -__LOG4SH_IFS_ARRAY=" -" -__LOG4SH_IFS_DEFAULT=' ' - -__LOG4SH_SECONDS=`eval "expr \`date '+%H \* 3600 + %M \* 60 + %S'\`"` - -# configure log4sh debugging. set the LOG4SH_INFO environment variable to any -# non-empty value to enable info output, LOG4SH_DEBUG enable debug output, or -# LOG4SH_TRACE to enable trace output. log4sh ERROR and above messages are -# always printed. to send the debug output to a file, set the LOG4SH_DEBUG_FILE -# with the filename you want debug output to be written to. -__LOG4SH_TRACE=${LOG4SH_TRACE:+'_log4sh_trace '} -__LOG4SH_TRACE=${__LOG4SH_TRACE:-':'} -[ -n "${LOG4SH_TRACE:-}" ] && LOG4SH_DEBUG=1 -__LOG4SH_DEBUG=${LOG4SH_DEBUG:+'_log4sh_debug '} -__LOG4SH_DEBUG=${__LOG4SH_DEBUG:-':'} -[ -n "${LOG4SH_DEBUG:-}" ] && LOG4SH_INFO=1 -__LOG4SH_INFO=${LOG4SH_INFO:+'_log4sh_info '} -__LOG4SH_INFO=${__LOG4SH_INFO:-':'} - -# set the constants to readonly -for _log4sh_const in `set |grep "^__LOG4SH_" |cut -d= -f1`; do - readonly ${_log4sh_const} -done -unset _log4sh_const - -# -# internal variables -# - -__log4sh_filename=`basename $0` -__log4sh_tmpDir='' -__log4sh_trapsFile='' - -__log4sh_alternative_mail='mail' - -__log4sh_threadName=${__LOG4SH_THREAD_DEFAULT} -__log4sh_threadStack=${__LOG4SH_THREAD_DEFAULT} - -__log4sh_seconds=0 -__log4sh_secondsLast=0 -__log4sh_secondsWrap=0 - -# workarounds for various commands -__log4sh_wa_strictBehavior=${__LOG4SH_FALSE} -( - # determine if the set builtin needs to be evaluated. if the string is parsed - # into two separate strings (common in ksh), then set needs to be evaled. - str='x{1,2}' - set -- ${str} - test ! "$1" = 'x1' -a ! "${2:-}" = 'x2' -) -__log4sh_wa_setNeedsEval=$? - - -#============================================================================= -# Log4sh -# - -#----------------------------------------------------------------------------- -# internal debugging -# - -#/** -# -# -# void -# -# -# -# -# _log4sh_log -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_log() -{ - _ll__level=$1 - shift - if [ -z "${LOG4SH_DEBUG_FILE:-}" ]; then - echo "log4sh:${_ll__level} $@" >&2 - else - echo "${_ll__level} $@" >>${LOG4SH_DEBUG_FILE} - fi - unset _ll__level -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_trace -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_trace() -{ - _log4sh_log "${__LOG4SH_LEVEL_TRACE_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; - } - -#/** -# -# -# void -# -# -# -# -# _log4sh_debug -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_debug() -{ - _log4sh_log "${__LOG4SH_LEVEL_DEBUG_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_info -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_info() -{ - _log4sh_log "${__LOG4SH_LEVEL_INFO_STR}" "${BASH_LINENO:+(${BASH_LINENO}) }- $@"; -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_warn -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_warn() -{ - echo "log4sh:${__LOG4SH_LEVEL_WARN_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_WARN_STR}" "$@" -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_error -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_error() -{ - echo "log4sh:${__LOG4SH_LEVEL_ERROR_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_ERROR_STR}" "$@" -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_fatal -# string level -# -# -# -# This is an internal debugging function. It should not be called. -# -# -# _log4sh_log -# -# -# -#*/ -_log4sh_fatal() -{ - echo "log4sh:${__LOG4SH_LEVEL_FATAL_STR} $@" >&2 - [ -n "${LOG4SH_DEBUG_FILE:-}" ] \ - && _log4sh_log "${__LOG4SH_LEVEL_FATAL_STR}" "$@" -} - -#----------------------------------------------------------------------------- -# miscellaneous -# - -#/** -# -# -# string -# -# -# -# -# _log4sh_mktempDir -# -# -# -# -# Creates a secure temporary directory within which temporary files can be -# created. Honors the TMPDIR environment variable if it is -# set. -# -# -# tmpDir=`_log4sh_mktempDir` -# -# -# -#*/ -_log4sh_mktempDir() -{ - _lmd_tmpPrefix='log4sh' - - # try the standard mktemp function - ( exec mktemp -dqt ${_lmd_tmpPrefix}.XXXXXX 2>/dev/null ) && return - - # the standard mktemp didn't work. doing our own. - if [ -n "${RANDOM:-}" ]; then - # $RANDOM works - _lmd_random=${RANDOM}${RANDOM}${RANDOM}$$ - elif [ -r '/dev/urandom' ]; then - _lmd_random=`od -vAn -N4 -tu4 -# -# void -# -# -# -# -# _log4sh_updateSeconds -# -# -# -# -# Set the __log4sh_seconds variable to the number of seconds -# elapsed since the start of the script. -# -# -# _log4sh_updateSeconds` -# -# -# -#*/ -_log4sh_updateSeconds() -{ - if [ -n "${SECONDS:-}" ]; then - __log4sh_seconds=${SECONDS} - else - _lgs__date=`date '+%H \* 3600 + %M \* 60 + %S'` - _lgs__seconds=`eval "expr ${_lgs__date} + ${__log4sh_secondsWrap} \* 86400"` - if [ ${_lgs__seconds} -lt ${__log4sh_secondsLast} ]; then - __log4sh_secondsWrap=`expr ${__log4sh_secondsWrap} + 1` - _lgs__seconds=`expr ${_lgs_seconds} + 86400` - fi - __log4sh_seconds=`expr ${_lgs__seconds} - ${__LOG4SH_SECONDS}` - __log4sh_secondsLast=${__log4sh_seconds} - unset _lgs__date _lgs__seconds - fi -} - -#/** -# -# -# void/boolean -# -# -# -# -# log4sh_enableStrictBehavior -# -# -# -# -# Enables strict log4j behavior. -# -# Since: 1.3.7 -# -# log4sh_enableStrictBehavior -# -# -# -#*/ -log4sh_enableStrictBehavior() -{ - __log4sh_wa_strictBehavior=${__LOG4SH_TRUE} -} - -#/** -# -# -# void/boolean -# -# -# -# -# log4sh_setAlternative -# string command -# string path -# boolean useRuntimePath (optional) -# -# -# -# Specifies an alternative path for a command. -# -# Since: 1.3.7 -# -# log4sh_setAlternative nc /bin/nc -# -# -# -#*/ -log4sh_setAlternative() -{ - if [ $# -lt 2 ]; then - _log4sh_error 'log4sh_setAlternative(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - lsa_cmdName=$1 - lsa_cmdPath=$2 - lsa_useRuntimePath=${3:-} - __log4sh_return=${__LOG4SH_TRUE} - - # check that the alternative command exists and is executable - if [ \ - ! -x "${lsa_cmdPath}" \ - -a ${lsa_useRuntimePath:-${__LOG4SH_FALSE}} -eq ${__LOG4SH_FALSE} \ - ]; then - # the alternative command is not executable - _log4sh_error "log4sh_setAlternative(): ${lsa_cmdName}: command not found" - __log4sh_return=${__LOG4SH_ERROR} - fi - - # check for valid alternative - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - case ${lsa_cmdName} in - mail) ;; - nc) - lsa_cmdVers=`${lsa_cmdPath} --version 2>&1 |head -1` - if echo "${lsa_cmdVers}" |grep '^netcat' >/dev/null; then - # GNU Netcat - __log4sh_alternative_nc_opts='-c' - else - # older netcat (v1.10) - if nc -q 0 2>&1 |grep '^no destination$' >/dev/null 2>&1; then - # supports -q option - __log4sh_alternative_nc_opts='-q 0' - else - # doesn't support the -q option - __log4sh_alternative_nc_opts='' - fi - fi - unset lsa_cmdVers - ;; - *) - # the alternative is not valid - _log4sh_error "unrecognized command alternative '${lsa_cmdName}'" - __log4sh_return=${__LOG4SH_FALSE} - ;; - esac - fi - - # set the alternative - if [ ${__log4sh_return} -eq ${__LOG4SH_TRUE} ]; then - eval __log4sh_alternative_${lsa_cmdName}="\${lsa_cmdPath}" - ${__LOG4SH_DEBUG} "alternative '${lsa_cmdName}' command set to '${lsa_cmdPath}'" - fi - - unset lsa_cmdName lsa_cmdPath - return ${__log4sh_return} -} - -#----------------------------------------------------------------------------- -# array handling -# -# note: arrays are '1' based -# - -#/** -# -# -# integer -# -# -# -# -# _log4sh_findArrayElement -# string[] array -# string element -# -# -# Find the position of element in an array -# -# -# pos=`_log4sh_findArrayElement "$array" $element` -# -# -# -# -#*/ -_log4sh_findArrayElement() -{ - __pos=`echo "$1" |awk '$0==e{print NR}' e="$2"` - [ -n "${__pos}" ] && echo "${__pos}" || echo 0 - unset __pos -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_getArrayElement -# string[] array -# integer position -# -# -# Retrieve the element at the given position from an array -# -# element=`_log4sh_getArrayElement "$array" $position` -# -# -# -#*/ -_log4sh_getArrayElement() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - _lgae_array=$1 - _lgae_index=$2 - ${__LOG4SH_TRACE} "_lgae_array='${_lgae_array}' _lgae_index='${_lgae_index}'" - - _lgae_oldIFS=${IFS} IFS=${__LOG4SH_IFS_ARRAY} - if [ ${__log4sh_wa_setNeedsEval} -eq 0 ]; then - set -- junk ${_lgae_array} - else - eval "set -- junk \"${_lgae_array}\"" - _lgae_arraySize=$# - - if [ ${_lgae_arraySize} -le ${__log4shAppenderCount} ]; then - # the evaled set *didn't* work; failing back to original set command and - # disabling the work around. (pdksh) - __log4sh_wa_setNeedsEval=${__LOG4SH_FALSE} - set -- junk ${_lgae_array} - fi - fi - IFS=${_lgae_oldIFS} - - shift ${_lgae_index} - ${__LOG4SH_TRACE} "1='${1:-}' 2='${2:-}' 3='${3:-}' ..." - echo "$1" - - unset _lgae_array _lgae_arraySize _lgae_index _lgae_oldIFS - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# integer -# -# -# -# -# _log4sh_getArrayLength -# string[] array -# -# -# Get the length of an array -# -# length=`_log4sh_getArrayLength "$array"` -# -# -# -#*/ -_log4sh_getArrayLength() -{ - _oldIFS=${IFS} IFS=${__LOG4SH_IFS_ARRAY} - set -- $1 - IFS=${_oldIFS} unset _oldIFS - echo $# -} - -#/** -# -# -# string[] -# -# -# -# -# _log4sh_setArrayElement -# string[] array -# integer position -# string element -# -# -# Place an element at a given location in an array -# -# newArray=`_log4sh_setArrayElement "$array" $position $element` -# -# -# -#*/ -_log4sh_setArrayElement() -{ - echo "$1" |awk '{if(NR==r){print e}else{print $0}}' r=$2 e="$3" -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_peekStack -# string[] array -# -# -# Return the topmost element on a stack without removing the -# element. -# -# element=`_log4sh_peekStack "$array"` -# -# -# -#*/ -_log4sh_peekStack() -{ - echo "$@" |awk '{line=$0}END{print line}' -} - -#/** -# -# -# string[] -# -# -# -# -# _log4sh_popStack -# string[] array -# -# -# Remove the top-most element from a stack. This command takes a -# normal log4sh string array as input, but treats it as though it were a -# stack. -# -# newArray=`_log4sh_popStack "$array"` -# -# -# -#*/ -_log4sh_popStack() -{ - _array=$1 - _length=`_log4sh_getArrayLength "${_array}"` - echo "${_array}" |awk '{if(NR -# -# string -# -# -# -# -# _log4sh_pushStack -# string[] array -# string element -# -# -# Add a new element to the top of a stack. This command takes a normal -# log4sh string array as input, but treats it as though it were a -# stack. -# -# newArray=`_log4sh_pushStack "$array" $element` -# -# -# -#*/ -_log4sh_pushStack() -{ - echo "${1:+$1${__LOG4SH_IFS_ARRAY}}$2" -} - -#============================================================================= -# Appender -# - -#/** -# -# -# void -# -# -# -# -# appender_activateOptions -# string appender -# -# -# -# Activate an appender's configuration. This should be called after -# reconfiguring an appender via code. It needs only to be called once -# before any logging statements are called. This calling of this function -# will be required in log4sh 1.4.x. -# -# -# appender_activateAppender myAppender -# -# -# -#*/ -appender_activateOptions() -{ - _aao_appender=$1 - ${__LOG4SH_APPENDER_FUNC_PREFIX}${_aao_appender}_activateOptions - unset _aao_appender -} - -#/** -# -# -# void -# -# -# -# -# appender_close -# string appender -# -# -# Disable any further logging via an appender. Once closed, the -# appender can be reopened by setting it to any logging Level (e.g. -# INFO). -# -# appender_close myAppender -# -# -# -#*/ -appender_close() -{ - appender_setLevel $1 ${__LOG4SH_LEVEL_CLOSED_STR} -} - -#/** -# -# -# boolean -# -# -# -# -# appender_exists -# string appender -# -# -# Checks for the existance of a named appender -# -# exists=`appender_exists myAppender` -# -# -# -#*/ -appender_exists() -{ - _ae_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - [ "${_ae_index}" -gt 0 ] \ - && _ae_return=${__LOG4SH_TRUE} \ - || _ae_return=${__LOG4SH_FALSE} - unset _ae_index - return ${_ae_return} -} - -#/** -# -# -# string -# -# -# -# -# appender_getLayout -# string appender -# -# -# Gets the Layout of an Appender -# -# type=`appender_getLayout myAppender` -# -# -# -#*/ -appender_getLayout() -{ - _agl_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - _log4sh_getArrayElement "${__log4shAppenderLayouts}" ${_agl_index} - unset _agl_index -} - -#/** -# -# -# void -# -# -# -# -# appender_setLayout -# string appender -# string layout -# -# -# Sets the Layout of an Appender (e.g. PatternLayout) -# -# appender_setLayout myAppender PatternLayout -# -# -# -#*/ -appender_setLayout() -{ - _asl_appender=$1 - _asl_layout=$2 - - case ${_asl_layout} in - ${__LOG4SH_LAYOUT_HTML}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_LAYOUT_HTML}) - _asl_layout=${__LOG4SH_LAYOUT_HTML} - ;; - - ${__LOG4SH_LAYOUT_SIMPLE}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_LAYOUT_SIMPLE}) - _asl_layout=${__LOG4SH_LAYOUT_SIMPLE} - ;; - - ${__LOG4SH_LAYOUT_PATTERN}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_LAYOUT_PATTERN}) - _asl_layout=${__LOG4SH_LAYOUT_PATTERN} - ;; - - *) - _log4sh_error "unknown layout: ${_asl_layout}" - return ${__LOG4SH_FALSE} - ;; - esac - - _asl_index=`_log4sh_findArrayElement "${__log4shAppenders}" $1` - __log4shAppenderLayouts=`_log4sh_setArrayElement \ - "${__log4shAppenderLayouts}" ${_asl_index} "${_asl_layout}"` - - # resource the appender - _appender_cache ${_asl_appender} - - unset _asl_appender _asl_index _asl_layout - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getLayoutByIndex -# integer index -# -# -# Gets the Layout of an Appender at the given array index -# -# type=`_appender_getLayoutByIndex 3` -# -# -# -#*/ -_appender_getLayoutByIndex() -{ - _log4sh_getArrayElement "${__log4shAppenderLayouts}" $1 -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_getLevel -# string appender -# -# -# Gets the current logging Level of an Appender -# -# type=`appender_getLevel myAppender` -# -# -# -#*/ -appender_getLevel() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_getLevel(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - agl_appender=$1 - - agl_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${agl_appender}` - # TODO: put check for valid index here - agl_level=`_log4sh_getArrayElement \ - "${__log4shAppenderLevels}" ${agl_index}` - __log4sh_return=$? - - echo "${agl_level}" - - unset agl_appender agl_index agl_level - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setLevel -# string appender -# string level -# -# -# Sets the Level of an Appender (e.g. INFO) -# -# appender_setLevel myAppender INFO -# -# -# -#*/ -appender_setLevel() -{ - asl_appender=$1 - asl_level=$2 - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asl_appender}` - __log4shAppenderLevels=`_log4sh_setArrayElement \ - "${__log4shAppenderLevels}" ${_index} "${asl_level}"` - - # resource the appender - _appender_cache ${asl_appender} - - unset asl_appender asl_level _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getLevelByIndex -# integer index -# -# -# Gets the current logging Level of an Appender at the given array -# index -# -# type=`_appender_getLevelByIndex 3` -# -# -# -#*/ -_appender_getLevelByIndex() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - _log4sh_getArrayElement "${__log4shAppenderLevels}" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_getPattern -# string appender -# -# -# Gets the Pattern of an Appender -# -# pattern=`appender_getPattern myAppender` -# -# -# -#*/ -appender_getPattern() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppenderPatterns" $_index - unset _index -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setPattern -# string appender -# string pattern -# -# -# Sets the Pattern of an Appender -# -# appender_setPattern myAppender '%d %p - %m%n' -# -# -# -#*/ -appender_setPattern() -{ - asp_appender=$1 - asp_pattern=$2 - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asp_appender}` - __log4shAppenderPatterns=`_log4sh_setArrayElement \ - "${__log4shAppenderPatterns}" ${_index} "${asp_pattern}"` - - # resource the appender - _appender_cache ${asp_appender} - - unset asp_appender asp_pattern _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# string -# -# -# -# -# _appender_getPatternByIndex -# integer index -# -# -# Gets the Pattern of an Appender at the specified array index -# -# pattern=`_appender_getPatternByIndex 3` -# -# -# -#*/ -_appender_getPatternByIndex() -{ - _log4sh_getArrayElement "$__log4shAppenderPatterns" $1 -} - -#/** -# -# -# string -# -# -# -# -# _appender_parsePattern -# string pattern -# string priority -# string message -# -# -# Generate a logging message given a Pattern, priority, and message. -# All dates will be represented as ISO 8601 dates (YYYY-MM-DD -# HH:MM:SS). -# Note: the '%r' character modifier does not work in the -# Solaris /bin/sh shell -# Example: -#
-# -# _appender_parsePattern '%d %p - %m%n' INFO "message to log" -# -#
-#
-#
-#
-#*/ -_appender_parsePattern() -{ - _pattern=$1 - _priority=$2 - _msg=$3 - - _date='' - _doEval=${__LOG4SH_FALSE} - - # determine if various commands must be run - _oldIFS="${IFS}"; IFS='%'; set -- x${_pattern}; IFS="${_oldIFS}" - if [ $# -gt 1 ]; then - # run the date command?? - IFS='d'; set -- ${_pattern}x; IFS="${_oldIFS}" - [ $# -gt 1 ] && _date=`date '+%Y-%m-%d %H:%M:%S'` - - # run the eval command? - IFS='X'; set -- ${_pattern}x; IFS="${_oldIFS}" - [ $# -gt 1 ] && _doEval=${__LOG4SH_TRUE} - fi - unset _oldIFS - - # escape any '\' and '&' chars in the message - _msg=`echo "${_msg}" |sed 's/\\\\/\\\\\\\\/g;s/&/\\\\&/g'` - - # deal with any newlines in the message - _msg=`echo "${_msg}" |tr '\n' ''` - - # parse the pattern - _pattern=`echo "${_pattern}" |sed \ - -e 's/%c/shell/g' \ - -e 's/%d{[^}]*}/%d/g' -e "s/%d/${_date}/g" \ - -e "s/%F/${__log4sh_filename}/g" \ - -e 's/%L//g' \ - -e 's/%n//g' \ - -e "s/%-*[0-9]*p/${_priority}/g" \ - -e "s/%-*[0-9]*r/${__log4sh_seconds}/g" \ - -e "s/%t/${__log4sh_threadName}/g" \ - -e 's/%x//g' \ - -e 's/%X{/$\{/g' \ - -e 's/%%m/%%%m/g' -e 's/%%/%/g' \ - -e "s%m${_msg}" |tr '' '\n'` - if [ ${_doEval} -eq ${__LOG4SH_FALSE} ]; then - echo "${_pattern}" - else - eval "echo \"${_pattern}\"" - fi - - unset _date _doEval _msg _pattern _tag -} - -#/** -# -# -# string -# -# -# -# -# appender_getType -# string appender -# -# -# Gets the Type of an Appender -# -# type=`appender_getType myAppender` -# -# -# -#*/ -appender_getType() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppenderTypes" $_index - unset _index -} - -#/** -# -# -# string -# -# -# -# -# appender_getAppenderType -# integer index -# -# -# Deprecated as of 1.3.1 -# -# Gets the Type of an Appender at the given array index -# -# -# type=`appender_getAppenderType 3` -# -# -# -#*/ -appender_getAppenderType() -{ - _appender_getTypeByIndex "$@" -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_setType -# string appender -# string type -# -# -# Sets the Type of an Appender (e.g. FileAppender) -# -# appender_setType myAppender FileAppender -# -# -# -#*/ -appender_setType() -{ - ast_appender=$1 - ast_type=$2 - - # XXX need to verify types - - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${ast_appender}` - __log4shAppenderTypes=`_log4sh_setArrayElement \ - "${__log4shAppenderTypes}" ${_index} "${ast_type}"` - - # resource the appender - _appender_cache ${ast_appender} - - unset ast_appender ast_type _index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderType -# string appender -# string type -# -# -# Deprecated as of 1.3.1 -# -# Sets the Type of an Appender (e.g. FileAppender) -# -# -# appender_setAppenderType myAppender FileAppender -# -# -# -#*/ -appender_setAppenderType() -{ - appender_setType "$@" -} - -#/** -# -# -# string -# -# -# -# -# _appender_getTypeByIndex -# integer index -# -# -# Gets the Type of an Appender at the given array index -# -# type=`_appender_getTypeByIndex 3` -# -# -# -#*/ -_appender_getTypeByIndex() -{ - _log4sh_getArrayElement "$__log4shAppenderTypes" $1 -} - -#/** -# -# -# void -# -# -# -# -# _appender_cache -# string appender -# -# -# Dynamically creates an appender function in memory that will fully -# instantiate itself when it is called. -# -# _appender_cache myAppender -# -# -# -#*/ -_appender_cache() -{ - _ac__appender=$1 - - _ac__inc="${__log4sh_tmpDir}/${_ac__appender}${__LOG4SH_APPENDER_INCLUDE_EXT}" - - cat >"${_ac__inc}" < -# -# void -# -# -# -# -# _appender_activate -# string appender -# -# -# -# Dynamically regenerates an appender function in memory that is fully -# instantiated for a specific logging task. -# -# -# _appender_activate myAppender -# -# -# -#*/ -_appender_activate() -{ - [ -n "${FUNCNAME:-}" ] && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - ${__LOG4SH_TRACE} "_appender_activate($#)" - _aa_appender=$1 - ${__LOG4SH_TRACE} "_aa_appender='${_aa_appender}'" - - _aa_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${_aa_appender}` - _aa_inc="${__log4sh_tmpDir}/${_aa_appender}${__LOG4SH_APPENDER_INCLUDE_EXT}" - - ### generate function for inclusion - # TODO can we modularize this in the future? - - # send STDOUT to our include file - exec 4>&1 >${_aa_inc} - - # header - cat <&2" - elif [ "${_aa_file}" != "${__LOG4SH_NULL}" ]; then - # do rotation - case ${_aa_type} in - ${__LOG4SH_TYPE_ROLLING_FILE}) - # check whether the max file size has been exceeded - _aa_rotIndex=`appender_file_getMaxBackupIndex ${_aa_appender}` - _aa_rotSize=`appender_file_getMaxFileSize ${_aa_appender}` - cat <>'${_aa_file}'" - else - # the file "${__LOG4SH_NULL}" is closed?? Why did we get here, and why - # did I care when I wrote this bit of code? - : - fi - - unset _aa_file - ;; - - ${__LOG4SH_TYPE_SMTP}) - _aa_smtpTo=`appender_smtp_getTo ${_aa_appender}` - _aa_smtpSubject=`appender_smtp_getSubject ${_aa_appender}` - - cat </dev/null ) - unset _la_tag -EOF - else - # yes -- use netcat - if [ -n "${__log4sh_alternative_nc:-}" ]; then - case ${_aa_facilityName} in - kern) _aa_facilityCode=0 ;; # 0<<3 - user) _aa_facilityCode=8 ;; # 1<<3 - mail) _aa_facilityCode=16 ;; # 2<<3 - daemon) _aa_facilityCode=24 ;; # 3<<3 - auth|security) _aa_facilityCode=32 ;; # 4<<3 - syslog) _aa_facilityCode=40 ;; # 5<<3 - lpr) _aa_facilityCode=48 ;; # 6<<3 - news) _aa_facilityCode=56 ;; # 7<<3 - uucp) _aa_facilityCode=64 ;; # 8<<3 - cron) _aa_facilityCode=72 ;; # 9<<3 - authpriv) _aa_facilityCode=80 ;; # 10<<3 - ftp) _aa_facilityCode=88 ;; # 11<<3 - local0) _aa_facilityCode=128 ;; # 16<<3 - local1) _aa_facilityCode=136 ;; # 17<<3 - local2) _aa_facilityCode=144 ;; # 18<<3 - local3) _aa_facilityCode=152 ;; # 19<<3 - local4) _aa_facilityCode=160 ;; # 20<<3 - local5) _aa_facilityCode=168 ;; # 21<<3 - local6) _aa_facilityCode=176 ;; # 22<<3 - local7) _aa_facilityCode=184 ;; # 23<<3 - esac - - cat <&4 4>&- - - # source the newly created function - ${__LOG4SH_TRACE} 're-sourcing the newly created function' - . "${_aa_inc}" - - unset _aa_appender _aa_inc _aa_layout _aa_pattern _aa_type -} - -#----------------------------------------------------------------------------- -# FileAppender -# - -#/** -# -# -# string -# -# -# -# -# _appender_file_getFileByIndex -# integer index -# -# -# Get the filename of a FileAppender at the given array index -# -# _appender_file_getFileByIndex 3 -# -# -# -#*/ -_appender_file_getFileByIndex() -{ - _log4sh_getArrayElement "${__log4shAppender_file_files}" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_file_getFile -# string appender -# -# -# Get the filename of a FileAppender -# -# appender_file_getFile myAppender -# -# -# -#*/ -appender_file_getFile() -{ - _index=`_log4sh_findArrayElement "$__log4shAppenders" $1` - _log4sh_getArrayElement "$__log4shAppender_file_files" $_index - unset _index -} - -#/** -# -# -# void -# -# -# -# -# appender_file_setFile -# string appender -# string filename -# -# -# -# Set the filename for a FileAppender (e.g. STDERR or -# /var/log/log4sh.log). -# -# -# appender_file_setFile myAppender STDERR -# -# -# -#*/ -appender_file_setFile() -{ - afsf_appender=$1 - afsf_file=$2 - ${__LOG4SH_TRACE} "afsf_appender='${afsf_appender}' afsf_file='${afsf_file}'" - - if [ -n "${afsf_appender}" -a -n "${afsf_file}" ]; then - # set the file - _index=`_log4sh_findArrayElement "${__log4shAppenders}" ${afsf_appender}` - __log4shAppender_file_files=`_log4sh_setArrayElement \ - "${__log4shAppender_file_files}" ${_index} "${afsf_file}"` - _return=$? - - # create the file (if it isn't already) - if [ ${_return} -eq ${__LOG4SH_TRUE} \ - -a ! "${afsf_file}" '=' "${__LOG4SH_NULL}" \ - -a ! "${afsf_file}" '=' 'STDERR' \ - -a ! -f "${afsf_file}" \ - ]; then - touch "${afsf_file}" 2>/dev/null - _result=$? - # determine success of touch command - if [ ${_result} -eq 1 ]; then - _log4sh_error "appender_file_setFile(): could not create file (${afsf_file}); closing appender" - appender_setLevel ${afsf_appender} ${__LOG4SH_LEVEL_CLOSED_STR} - fi - unset _result - fi - else - _log4sh_error 'appender_file_setFile(): missing appender and/or file' - _return=${__LOG4SH_FALSE} - fi - - # resource the appender - _appender_cache ${afsf_appender} - - unset afsf_appender afsf_file _index - return ${_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderFile -# string appender -# string filename -# -# -# Deprecated as of 1.3.2 -# -# Set the filename for a FileAppender (e.g. "STDERR" or -# "/var/log/log4sh.log") -# -# -# appender_setAppenderFile myAppender STDERR -# -# -# -#*/ -appender_setAppenderFile() -{ - appender_file_setFile "$@" -} - -#/** -# -# -# integer/boolean -# -# -# -# -# appender_file_getMaxBackupIndex -# string appender -# -# -# -# Returns the value of the MaxBackupIndex option. -# -# Since: 1.3.7 -# -# appender_file_getMaxBackupIndex myAppender -# -# -# -#*/ -appender_file_getMaxBackupIndex() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_file_getMaxBackupIndex(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - afgmbi_appender=$1 - - afgmbi_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afgmbi_appender}` - # TODO: put check for valid index here - _log4sh_getArrayElement \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" ${afgmbi_index} - __log4sh_return=$? - - unset afgmbi_appender afgmbi_index - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_file_setMaxBackupIndex -# string appender -# integer index -# -# -# Set the maximum number of backup files to keep around. -# -# The MaxBackupIndex option determines -# how many backup files are kept before the oldest is erased. This option -# takes a positive integer value. If set to zero, then there will be no -# backup files and the log file will be truncated when it reaches -# . -# -# Since: 1.3.7 -# -# appender_file_setMaxBackupIndex myAppender 3 -# -# -# -#*/ -appender_file_setMaxBackupIndex() -{ - if [ $# -ne 2 ]; then - _log4sh_error "appender_file_setMaxBackupIndex(): invalid number of parameters ($#)" - return ${__LOG4SH_FALSE} - fi - - afsmbi_appender=$1 - afsmbi_maxIndex=$2 - - # TODO: put check for valid input - - afsmbi_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afsmbi_appender}` - # TODO: put check for valid index here - __log4shAppender_rollingFile_maxBackupIndexes=`_log4sh_setArrayElement \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" ${afsmbi_index} \ - "${afsmbi_maxIndex}"` - __log4sh_return=$? - - # re-source the appender - _appender_cache ${afsmbi_appender} - - unset afsmbi_appender afsmbi_maxIndex afsmbi_index - return ${__log4sh_return} -} - -#/** -# -# -# integer/boolean -# -# -# -# -# appender_file_getMaxFileSize -# string appender -# -# -# -# Get the maximum size that the output file is allowed to reach before -# being rolled over to backup files. -# -# Since: 1.3.7 -# -# maxSize=`appender_file_getMaxBackupSize myAppender` -# -# -# -#*/ -appender_file_getMaxFileSize() -{ - if [ $# -ne 1 ]; then - _log4sh_error "appender_file_getMaxFileSize(): invalid number of parameters ($#)" - return ${__LOG4SH_FALSE} - fi - - afgmfs_appender=$1 - - afgmfs_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afgmfs_appender}` - # TODO: put check for valid index here - _log4sh_getArrayElement \ - "${__log4shAppender_rollingFile_maxFileSizes}" ${afgmfs_index} - __log4sh_return=$? - - unset afgmfs_appender afgmfs_index - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_file_setMaxFileSize -# string appender -# string size -# -# -# -# Set the maximum size that the output file is allowed to reach before -# being rolled over to backup files. -# -# -# In configuration files, the option takes an -# long integer in the range 0 - 2^40. You can specify the value with the -# suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being -# expressed respectively in kilobytes, megabytes or gigabytes. For example, -# the value "10KiB" will be interpreted as 10240. -# -# Since: 1.3.7 -# -# appender_file_setMaxBackupSize myAppender 10KiB -# -# -# -#*/ -appender_file_setMaxFileSize() -{ - if [ $# -ne 2 ]; then - _log4sh_error \ - "appender_file_setMaxFileSize(): invalid number of parameters ($#)" - return ${__LOG4SH_ERROR} - fi - - afsmfs_appender=$1 - afsmfs_size=$2 - afsmfs_return=${__LOG4SH_TRUE} - - # split the file size into parts - afsmfs_value=`expr ${afsmfs_size} : '\([0-9]*\)'` - afsmfs_unit=`expr ${afsmfs_size} : '[0-9]* *\([A-Za-z]\{1,3\}\)'` - - # determine multiplier - if [ ${__log4sh_wa_strictBehavior} -eq ${__LOG4SH_TRUE} ]; then - case "${afsmfs_unit}" in - KB) afsmfs_unit='KiB' ;; - MB) afsmfs_unit='MiB' ;; - GB) afsmfs_unit='GiB' ;; - TB) afsmfs_unit='TiB' ;; - esac - fi - case "${afsmfs_unit}" in - B) afsmfs_mul=1 ;; - KB) afsmfs_mul=1000 ;; - KiB) afsmfs_mul=1024 ;; - MB) afsmfs_mul=1000000 ;; - MiB) afsmfs_mul=1048576 ;; - GB) afsmfs_mul=1000000000 ;; - GiB) afsmfs_mul=1073741824 ;; - TB) afsmfs_mul=1000000000000 ;; - TiB) afsmfs_mul=1099511627776 ;; - '') - _log4sh_warn 'missing file size unit; assuming bytes' - afsmfs_mul=1 - ;; - *) - _log4sh_error "unrecognized file size unit '${afsmfs_unit}'" - afsmfs_return=${__LOG4SH_ERROR} - ;; - esac - - # calculate maximum file size - if [ ${afsmfs_return} -eq ${__LOG4SH_TRUE} ]; then - afsmfs_maxFileSize=`(expr ${afsmfs_value} \* ${afsmfs_mul} 2>&1)` - if [ $? -gt 0 ]; then - _log4sh_error "problem calculating maximum file size: '${afsmfs_maxFileSize}'" - afsmfs_return=${__LOG4SH_FALSE} - fi - fi - - # store the maximum file size - if [ ${afsmfs_return} -eq ${__LOG4SH_TRUE} ]; then - afsmfs_index=`_log4sh_findArrayElement \ - "${__log4shAppenders}" ${afsmfs_appender}` - # TODO: put check for valid index here - __log4shAppender_rollingFile_maxFileSizes=`_log4sh_setArrayElement \ - "${__log4shAppender_rollingFile_maxFileSizes}" ${afsmfs_index} \ - "${afsmfs_maxFileSize}"` - fi - - # re-source the appender - [ ${afsmfs_return} -eq ${__LOG4SH_TRUE} ] \ - && _appender_cache ${afsmfs_appender} - - __log4sh_return=${afsmfs_return} - unset afsmfs_appender afsmfs_size afsmfs_value afsmfs_unit afsmfs_mul \ - afsmfs_maxFileSize afsmfs_index afsmfs_return - return ${__log4sh_return} -} - -#----------------------------------------------------------------------------- -# SMTPAppender -# - -#/** -# -# -# string/boolean -# -# -# -# -# appender_smtp_getTo -# string appender -# -# -# Get the to address for the given appender -# -# email=`appender_smtp_getTo myAppender` -# -# -# -#*/ -appender_smtp_getTo() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_smtp_getTo(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgt_appender=$1 - - asgt_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgt_appender}` - # TODO: put check for valid index here - asgt_to=`_log4sh_getArrayElement \ - "${__log4shAppender_smtp_tos}" ${asgt_index}` - __log4sh_return=$? - - [ "${asgt_to}" = "${__LOG4SH_NULL}" ] && asgt_to='' - echo "${asgt_to}" - - unset asgt_appender asgt_index asgt_to - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_smtp_setTo -# string appender -# string email -# -# -# Set the to address for the given appender -# -# appender_smtp_setTo myAppender user@example.com -# -# -# -#*/ -appender_smtp_setTo() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_smtp_setTo(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asst_appender=$1 - asst_email=$2 - - asst_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asst_appender}` - # TODO: put check for valid index here - __log4shAppender_smtp_tos=`_log4sh_setArrayElement \ - "${__log4shAppender_smtp_tos}" ${asst_index} "${asst_email}"` - - # resource the appender - _appender_cache ${asst_appender} - - unset asst_appender asst_email asst_index -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderRecipient -# string appender -# string email -# -# -# Deprecated as of 1.3.1 -# -# Set the to address for the given appender -# -# -# appender_smtp_setTo myAppender user@example.com -# -# -# -#*/ -appender_setAppenderRecipient() -{ - appender_smtp_setTo "$@" -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_smtp_getSubject -# string appender -# -# -# Get the email subject for the given appender -# -# subject=`appender_smtp_getSubject myAppender` -# -# -# -#*/ -appender_smtp_getSubject() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_smtp_getSubject(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgs_appender=$1 - - asgs_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgs_appender}` - # TODO: put check for valid index here - asgs_subject=`_log4sh_getArrayElement \ - "${__log4shAppender_smtp_subjects}" ${asgs_index}` - __log4sh_return=$? - - [ "${asgs_subject}" = "${__LOG4SH_NULL}" ] && asgs_subject='' - echo "${asgs_subject}" - - unset asgs_appender asgs_index asgs_subject - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_smtp_setSubject -# string appender -# string subject -# -# -# Sets the email subject for an SMTP appender -# -# appender_smtp_setSubject myAppender "This is a test" -# -# -# -#*/ -appender_smtp_setSubject() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_smtp_setSubject(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asss_appender=$1 - asss_subject=$2 - - # set the Subject - asss_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asss_appender}` - if [ ${asss_index} -gt 0 ]; then - __log4shAppender_smtp_subjects=`_log4sh_setArrayElement \ - "${__log4shAppender_smtp_subjects}" ${asss_index} "${asss_subject}"` - __log4sh_return=${__LOG4SH_TRUE} - else - _log4sh_error "could not set Subject for appender (${asss_appender})" - __log4sh_return=${__LOG4SH_FALSE} - fi - - # re-source the appender - _appender_cache ${asss_appender} - - unset asss_appender asss_subject asss_index - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# appender_setAppenderSubject -# string appender -# string subject -# -# -# Deprecated as of 1.3.1 -# -# Sets the email subject for an SMTP appender -# -# -# appender_setAppenderSubject myAppender "This is a test" -# -# -# -#*/ -appender_setAppenderSubject() -{ - appender_smtp_setSubject "$@" -} - -#----------------------------------------------------------------------------- -# SyslogAppender -# - -#/** -# -# -# string -# -# -# -# -# -# _appender_syslog_getFacilityByIndex -# -# integer index -# -# -# Get the syslog facility of the specified appender by index -# -# -# facility=`_appender_syslog_getFacilityByIndex 3` -# -# -# -# -#*/ -_appender_syslog_getFacilityByIndex() -{ - _log4sh_getArrayElement "$__log4shAppender_syslog_facilities" $1 -} - -#/** -# -# -# string -# -# -# -# -# appender_getSyslogFacility -# integer index -# -# -# Deprecated as of 1.3.1 -# -# Get the syslog facility of the specified appender by index -# -# -# facility=`appender_getSyslogFacility 3` -# -# -# -#*/ -appender_getSyslogFacility() -{ - _appender_syslog_getFacilityByIndex "$@" -} - -#/** -# -# -# void -# -# -# -# -# appender_syslog_getFacility -# string appender -# -# -# -# Get the syslog facility for the given appender. -# -# -# facility=`appender_syslog_getFacility myAppender` -# -# -# -#*/ -appender_syslog_getFacility() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_syslog_getFacility(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgf_appender=$1 - - asgf_index=`_log4sh_findArrayElement "$__log4shAppenders" ${asgf_appender}` - _log4sh_getArrayElement "${__log4shAppender_syslog_facilities}" ${asgf_index} - - unset asgf_appender asgf_index -} - -#/** -# -# -# void -# -# -# -# -# appender_syslog_setFacility -# string appender -# string facility -# -# -# Set the syslog facility for the given appender -# -# appender_syslog_setFacility myAppender local4` -# -# -# -#*/ -appender_syslog_setFacility() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_syslog_setFacility(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - assf_appender=$1 - assf_facility=$2 - - # check for valid facility - echo "${__LOG4SH_TYPE_SYSLOG_FACILITY_NAMES}" |grep " ${assf_facility} " >/dev/null - if [ $? -ne 0 ]; then - # the facility is not valid - _log4sh_error "[${assf_facility}] is an unknown syslog facility. Defaulting to [user]." - assf_facility='user' - fi - - # set appender facility - assf_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${assf_appender}` - # TODO: put check for valid index here - __log4shAppender_syslog_facilities=`_log4sh_setArrayElement \ - "${__log4shAppender_syslog_facilities}" ${assf_index} "${assf_facility}"` - - # re-source the appender - _appender_cache ${assf_appender} - - unset assf_appender assf_facility assf_index - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# appender_setSyslogFacility -# string appender -# string facility -# -# -# Deprecated as of 1.3.2 -# -# Set the syslog facility for the given appender -# -# -# appender_setSyslogFacility myAppender local4` -# -# -# -#*/ -appender_setSyslogFacility() -{ - appender_syslog_setFacility "$@" -} - -#/** -# -# -# string/boolean -# -# -# -# -# appender_syslog_getHost -# integer index -# -# -# -# Get the syslog host of the specified appender. -# -# Since: 1.3.7 -# -# host=`appender_syslog_getHost myAppender` -# -# -# -#*/ -appender_syslog_getHost() -{ - if [ $# -ne 1 ]; then - _log4sh_error 'appender_syslog_getHost(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - asgh_appender=$1 - - asgh_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${asgh_appender}` - # TODO: put check for valid index here - asgh_host=`_log4sh_getArrayElement \ - "${__log4shAppender_syslog_hosts}" ${asgh_index}` - __log4sh_return=$? - - [ "${asgh_host}" = "${__LOG4SH_NULL}" ] && asgh_host='' - echo "${asgh_host}" - - unset asgh_appender asgh_index asgh_host - return ${__log4sh_return} -} - -#/** -# -# -# void/boolean -# -# -# -# -# appender_syslog_setHost -# string appender -# string host -# -# -# -# Set the syslog host for the given appender. Requires that the 'nc' -# command alternative has been previously set with the -# log4sh_setAlternative() function. -# -# Since: 1.3.7 -# -# appender_syslog_setHost myAppender localhost -# -# -# -#*/ -# -# The BSD syslog Protocol -# http://www.ietf.org/rfc/rfc3164.txt -# -appender_syslog_setHost() -{ - if [ $# -ne 2 ]; then - _log4sh_error 'appender_syslog_setHost(): invalid number of parameters' - return ${__LOG4SH_FALSE} - fi - - assh_appender=$1 - assh_host=$2 - - [ -z "${__log4sh_alternative_nc:-}" ] \ - && _log4sh_warn 'the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative().' - - assh_index=`_log4sh_findArrayElement "${__log4shAppenders}" ${assh_appender}` - # TODO: put check for valid index here - __log4shAppender_syslog_hosts=`_log4sh_setArrayElement \ - "${__log4shAppender_syslog_hosts}" ${assh_index} "${assh_host}"` - - # re-source the appender - _appender_cache ${assh_appender} - - unset assh_appender assh_host assh_index - return ${__LOG4SH_TRUE} -} - -#============================================================================= -# Level -# - -#/** -# -# -# string -# -# -# -# -# logger_level_toLevel -# integer val -# -# -# Converts an internally used level integer into its external level -# equivalent -# -# level=`logger_level_toLevel 3` -# -# -# -#*/ -# TODO use arrays instead of case statement ?? -logger_level_toLevel() -{ - _ltl__val=$1 - - _ltl__return=${__LOG4SH_TRUE} - _ltl__level='' - - case ${_ltl__val} in - ${__LOG4SH_LEVEL_TRACE}) _ltl__level=${__LOG4SH_LEVEL_TRACE_STR} ;; - ${__LOG4SH_LEVEL_DEBUG}) _ltl__level=${__LOG4SH_LEVEL_DEBUG_STR} ;; - ${__LOG4SH_LEVEL_INFO}) _ltl__level=${__LOG4SH_LEVEL_INFO_STR} ;; - ${__LOG4SH_LEVEL_WARN}) _ltl__level=${__LOG4SH_LEVEL_WARN_STR} ;; - ${__LOG4SH_LEVEL_ERROR}) _ltl__level=${__LOG4SH_LEVEL_ERROR_STR} ;; - ${__LOG4SH_LEVEL_FATAL}) _ltl__level=${__LOG4SH_LEVEL_FATAL_STR} ;; - ${__LOG4SH_LEVEL_OFF}) _ltl__level=${__LOG4SH_LEVEL_OFF_STR} ;; - ${__LOG4SH_LEVEL_CLOSED}) _ltl__level=${__LOG4SH_LEVEL_CLOSED_STR} ;; - *) _ltl__return=${__LOG4SH_FALSE} ;; - esac - - echo ${_ltl__level} - unset _ltl__val _ltl__level - return ${_ltl__return} -} - -#/** -# -# -# integer -# -# -# -# -# logger_level_toInt -# string level -# -# -# Converts an externally used level tag into its integer -# equivalent -# -# levelInt=`logger_level_toInt WARN` -# -# -# -#*/ -logger_level_toInt() -{ - _lti__level=$1 - - _lti__int=0 - _lti__return=${__LOG4SH_TRUE} - - case ${_lti__level} in - ${__LOG4SH_LEVEL_TRACE_STR}) _lti__int=${__LOG4SH_LEVEL_TRACE} ;; - ${__LOG4SH_LEVEL_DEBUG_STR}) _lti__int=${__LOG4SH_LEVEL_DEBUG} ;; - ${__LOG4SH_LEVEL_INFO_STR}) _lti__int=${__LOG4SH_LEVEL_INFO} ;; - ${__LOG4SH_LEVEL_WARN_STR}) _lti__int=${__LOG4SH_LEVEL_WARN} ;; - ${__LOG4SH_LEVEL_ERROR_STR}) _lti__int=${__LOG4SH_LEVEL_ERROR} ;; - ${__LOG4SH_LEVEL_FATAL_STR}) _lti__int=${__LOG4SH_LEVEL_FATAL} ;; - ${__LOG4SH_LEVEL_OFF_STR}) _lti__int=${__LOG4SH_LEVEL_OFF} ;; - ${__LOG4SH_LEVEL_CLOSED_STR}) _lti__int=${__LOG4SH_LEVEL_CLOSED} ;; - *) _lti__return=${__LOG4SH_FALSE} ;; - esac - - echo ${_lti__int} - unset _lti__int _lti__level - return ${_lti__return} -} - -#============================================================================= -# Logger -# - -#/** -# -# -# void/boolean -# -# -# -# -# logger_addAppender -# string appender -# -# -# Add and initialize a new appender -# -# logger_addAppender $appender -# -# -# -#*/ -logger_addAppender() -{ - laa_appender=$1 - - # FAQ should we be using setter functions here?? for performance, no. - __log4shAppenders=`_log4sh_pushStack "${__log4shAppenders}" ${laa_appender}` - __log4shAppenderCount=`expr ${__log4shAppenderCount} + 1` - __log4shAppenderCounts="${__log4shAppenderCounts} ${__log4shAppenderCount}" - __log4shAppenderLayouts=`_log4sh_pushStack \ - "$__log4shAppenderLayouts" "${__LOG4SH_LAYOUT_SIMPLE}"` - __log4shAppenderLevels=`_log4sh_pushStack \ - "${__log4shAppenderLevels}" "${__LOG4SH_NULL}"` - __log4shAppenderPatterns=`_log4sh_pushStack \ - "${__log4shAppenderPatterns}" "${__LOG4SH_PATTERN_DEFAULT}"` - __log4shAppenderTypes=`_log4sh_pushStack \ - "${__log4shAppenderTypes}" ${__LOG4SH_TYPE_CONSOLE}` - __log4shAppender_file_files=`_log4sh_pushStack \ - "${__log4shAppender_file_files}" ${__LOG4SH_NULL}` - __log4shAppender_rollingFile_maxBackupIndexes=`_log4sh_pushStack \ - "${__log4shAppender_rollingFile_maxBackupIndexes}" \ - ${__LOG4SH_TYPE_ROLLING_FILE_MAX_BACKUP_INDEX}` - __log4shAppender_rollingFile_maxFileSizes=`_log4sh_pushStack \ - "${__log4shAppender_rollingFile_maxFileSizes}" \ - ${__LOG4SH_TYPE_ROLLING_FILE_MAX_FILE_SIZE}` - __log4shAppender_smtp_tos=`_log4sh_pushStack \ - "${__log4shAppender_smtp_tos}" ${__LOG4SH_NULL}` - __log4shAppender_smtp_subjects=`_log4sh_pushStack \ - "${__log4shAppender_smtp_subjects}" ${__LOG4SH_NULL}` - __log4shAppender_syslog_facilities=`_log4sh_pushStack \ - "${__log4shAppender_syslog_facilities}" ${__LOG4SH_TYPE_SYSLOG_FACILITY}` - __log4shAppender_syslog_hosts=`_log4sh_pushStack \ - "${__log4shAppender_syslog_hosts}" "${__LOG4SH_NULL}"` - - _appender_cache ${laa_appender} - - unset laa_appender - return ${__LOG4SH_TRUE} -} - -#/** -# -# -# void -# -# -# -# -# logger_addAppenderWithPattern -# string appender -# string pattern -# -# -# Deprecated as of 1.3.6 -# -# Add and initialize a new appender with a specific PatternLayout -# -# -# logger_addAppenderWithPattern $appender '%d %p - %m%n' -# -# -# -#*/ -logger_addAppenderWithPattern() -{ - _myAppender=$1 - _myPattern=$2 - - logger_addAppender ${_myAppender} - appender_setLayout ${_myAppender} ${__LOG4SH_LAYOUT_PATTERN} - appender_setPattern ${_myAppender} "${_myPattern}" - - unset _myAppender _myPattern -} - -#/** -# -# -# string -# -# -# -# -# logger_getFilename -# -# -# -# -# Get the filename that would be shown when the '%F' conversion character -# is used in a PatternLayout. -# -# -# filename=`logger_getFilename` -# -# -# -#*/ -logger_getFilename() -{ - echo "${__log4sh_filename}" -} - -#/** -# -# -# void -# -# -# -# -# logger_setFilename -# string filename -# -# -# Set the filename to be shown when the '%F' conversion character is -# used in a PatternLayout. -# -# logger_setFilename 'myScript.sh' -# -# -# -#*/ -logger_setFilename() -{ - __log4sh_filename=$1 -} - -#/** -# -# -# string -# -# -# -# -# logger_getLevel -# -# -# -# Get the global default logging level (e.g. DEBUG). -# -# level=`logger_getLevel` -# -# -# -#*/ -logger_getLevel() -{ - logger_level_toLevel ${__log4shLevel} -} - -#/** -# -# -# void -# -# -# -# -# logger_setLevel -# string level -# -# -# Sets the global default logging level (e.g. DEBUG). -# -# logger_setLevel INFO -# -# -# -#*/ -logger_setLevel() -{ - _l_level=$1 - - _l_int=`logger_level_toInt ${_l_level}` - if [ $? -eq ${__LOG4SH_TRUE} ]; then - __log4shLevel=${_l_int} - else - _log4sh_error "attempt to set invalid log level '${_l_level}'" - fi - - unset _l_int _l_level -} - -#/** -# -# -# void -# -# -# -# -# log -# string level -# string[] message(s) -# -# -# The base logging command that logs a message to all defined -# appenders -# -# log DEBUG 'This is a test message' -# -# -# -#*/ -log() -{ - _l_level=$1 - shift - # if no message was passed, read it from STDIN - [ $# -ne 0 ] && _l_msg="$@" || _l_msg=`cat` - - __log4sh_return=${__LOG4SH_TRUE} - _l_levelInt=`logger_level_toInt ${_l_level}` - if [ $? -eq ${__LOG4SH_TRUE} ]; then - # update seconds elapsed - _log4sh_updateSeconds - - _l_oldIFS=${IFS} IFS=${__LOG4SH_IFS_DEFAULT} - for _l_appenderIndex in ${__log4shAppenderCounts}; do - ${__LOG4SH_TRACE} "_l_appenderIndex='${_l_appenderIndex}'" - # determine appender level - _l_appenderLevel=`_appender_getLevelByIndex ${_l_appenderIndex}` - if [ "${_l_appenderLevel}" = "${__LOG4SH_NULL}" ]; then - # continue if requested is level less than general level - [ ! ${__log4shLevel} -le ${_l_levelInt} ] && continue - else - _l_appenderLevelInt=`logger_level_toInt ${_l_appenderLevel}` - # continue if requested level is less than specific appender level - ${__LOG4SH_TRACE} "_l_levelInt='${_l_levelInt}' _l_appenderLevelInt='${_l_appenderLevelInt}'" - [ ! ${_l_appenderLevelInt} -le ${_l_levelInt} ] && continue - fi - - # execute dynamic appender function - _l_appenderName=`_log4sh_getArrayElement \ - "${__log4shAppenders}" ${_l_appenderIndex}` - ${__LOG4SH_APPENDER_FUNC_PREFIX}${_l_appenderName}_append ${_l_level} "${_l_msg}" - done - IFS=${_l_oldIFS} - else - _log4sh_error "invalid logging level requested (${_l_level})" - __log4sh_return=${__LOG4SH_ERROR} - fi - - unset _l_msg _l_oldIFS _l_level _l_levelInt - unset _l_appenderIndex _l_appenderLevel _l_appenderLevelInt _l_appenderName - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# logger_trace -# string[] message -# -# -# This is a helper function for logging a message at the TRACE -# priority -# -# logger_trace 'This is a trace message' -# -# -# -#*/ -logger_trace() -{ - log ${__LOG4SH_LEVEL_TRACE_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_debug -# string[] message -# -# -# This is a helper function for logging a message at the DEBUG -# priority -# -# logger_debug 'This is a debug message' -# -# -# -#*/ -logger_debug() -{ - log ${__LOG4SH_LEVEL_DEBUG_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_info -# string[] message -# -# -# This is a helper function for logging a message at the INFO -# priority -# -# logger_info 'This is a info message' -# -# -# -#*/ -logger_info() -{ - log ${__LOG4SH_LEVEL_INFO_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_warn -# string[] message -# -# -# -# This is a helper function for logging a message at the WARN priority -# -# -# logger_warn 'This is a warn message' -# -# -# -#*/ -logger_warn() -{ - log ${__LOG4SH_LEVEL_WARN_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_error -# string[] message -# -# -# -# This is a helper function for logging a message at the ERROR priority -# -# -# logger_error 'This is a error message' -# -# -# -#*/ -logger_error() -{ - log ${__LOG4SH_LEVEL_ERROR_STR} "$@" -} - -#/** -# -# -# void -# -# -# -# -# logger_fatal -# string[] message -# -# -# This is a helper function for logging a message at the FATAL -# priority -# -# logger_fatal 'This is a fatal message' -# -# -# -#*/ -logger_fatal() -{ - log ${__LOG4SH_LEVEL_FATAL_STR} "$@" -} - -#============================================================================== -# Property -# - -#/** -# -# -# string -# -# -# -# -# _log4sh_getPropPrefix -# string property -# -# -# Takes a string (eg. "log4sh.appender.stderr.File") and returns the -# prefix of it (everything before the first '.' char). Normally used in -# parsing the log4sh configuration file. -# -# prefix=`_log4sh_getPropPrefix $property"` -# -# -# -#*/ -_log4sh_getPropPrefix() -{ - _oldIFS=${IFS} IFS='.' - set -- $1 - IFS=${_oldIFS} unset _oldIFS - echo $1 -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_stripPropPrefix -# string property -# -# -# Strips the prefix off a property configuration command and returns -# the string. E.g. "log4sh.appender.stderr.File" becomes -# "appender.stderr.File". -# -# newProperty=`_log4sh_stripPropPrefix $property` -# -# -# -#*/ -_log4sh_stripPropPrefix() -{ - expr "$1" : '[^.]*\.\(.*\)' -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_propAlternative -# string property -# string value -# -# -# -# Configures log4sh to use an alternative command. -# -# -# _log4sh_propAlternative property value -# -# -# -#*/ -_log4sh_propAlternative() -{ - _lpa_key=$1 - _lpa_value=$2 - - # strip the leading 'alternative.' - _lpa_alternative=`_log4sh_stripPropPrefix ${_lpa_key}` - - # set the alternative - log4sh_setAlternative ${_lpa_alternative} "${_lpa_value}" - - unset _lpa_key _lpa_value _lpa_alternative -} - -#/** -# -# -# void/boolean -# -# -# -# -# _log4sh_propAppender -# string property -# string value -# -# -# Configures log4sh using an appender property configuration statement -# -# _log4sh_propAppender $property $value -# -# -# -#*/ -_log4sh_propAppender() -{ - _lpa_key=$1 - _lpa_value=$2 - - _lpa_appender='' - _lpa_rtrn=${__LOG4SH_TRUE} - - # strip the leading 'appender' keyword prefix - _lpa_key=`_log4sh_stripPropPrefix ${_lpa_key}` - - # handle appender definitions - if [ "${_lpa_key}" '=' "`expr \"${_lpa_key}\" : '\([^.]*\)'`" ]; then - _lpa_appender="${_lpa_key}" - else - _lpa_appender=`_log4sh_getPropPrefix ${_lpa_key}` - fi - - # does the appender exist? - appender_exists ${_lpa_appender} - if [ $? -eq ${__LOG4SH_FALSE} ]; then - _log4sh_error "attempt to configure the non-existant appender (${_lpa_appender})" - unset _lpa_appender _lpa_key _lpa_value - return ${__LOG4SH_ERROR} - fi - - # handle the appender type - if [ "${_lpa_appender}" = "${_lpa_key}" ]; then - case ${_lpa_value} in - ${__LOG4SH_TYPE_CONSOLE}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_CONSOLE}) - appender_setType ${_lpa_appender} ${__LOG4SH_TYPE_CONSOLE} ;; - ${__LOG4SH_TYPE_FILE}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_FILE}) - appender_setType ${_lpa_appender} ${__LOG4SH_TYPE_FILE} ;; - $__LOG4SH_TYPE_DAILY_ROLLING_FILE|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_DAILY_ROLLING_FILE}) - appender_setType ${_lpa_appender} ${__LOG4SH_TYPE_DAILY_ROLLING_FILE} ;; - ${__LOG4SH_TYPE_ROLLING_FILE}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_ROLLING_FILE}) - appender_setType ${_lpa_appender} ${__LOG4SH_TYPE_ROLLING_FILE} ;; - ${__LOG4SH_TYPE_SMTP}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_SMTP}) - appender_setType $_lpa_appender ${__LOG4SH_TYPE_SMTP} ;; - ${__LOG4SH_TYPE_SYSLOG}|\ - ${__LOG4SH_CONFIG_LOG4J_CP}.${__LOG4SH_TYPE_SYSLOG}) - appender_setType $_lpa_appender ${__LOG4SH_TYPE_SYSLOG} ;; - *) - _log4sh_error "appender type (${_lpa_value}) unrecognized" - false - ;; - esac - [ $? -ne ${__LOG4SH_TRUE} ] && _lpa_rtrn=${__LOG4SH_ERROR} - __log4sh_return=${_lpa_rtrn} - unset _lpa_appender _lpa_key _lpa_rtrn _lpa_value - return ${__log4sh_return} - fi - - # handle appender values and methods - _lpa_key=`_log4sh_stripPropPrefix ${_lpa_key}` - if [ "${_lpa_key}" '=' "`expr \"${_lpa_key}\" : '\([^.]*\)'`" ]; then - case ${_lpa_key} in - # General - Threshold) appender_setLevel ${_lpa_appender} "${_lpa_value}" ;; - layout) appender_setLayout ${_lpa_appender} "${_lpa_value}" ;; - - # FileAppender - DatePattern) ;; # unsupported - File) - _lpa_value=`eval echo "${_lpa_value}"` - appender_file_setFile ${_lpa_appender} "${_lpa_value}" - ;; - MaxBackupIndex) - appender_file_setMaxBackupIndex ${_lpa_appender} "${_lpa_value}" ;; - MaxFileSize) - appender_file_setMaxFileSize ${_lpa_appender} "${_lpa_value}" ;; - - # SMTPAppender - To) appender_smtp_setTo ${_lpa_appender} "${_lpa_value}" ;; - Subject) appender_smtp_setSubject ${_lpa_appender} "${_lpa_value}" ;; - - # SyslogAppender - SyslogHost) appender_syslog_setHost ${_lpa_appender} "${_lpa_value}" ;; - Facility) appender_syslog_setFacility ${_lpa_appender} "${_lpa_value}" ;; - - # catch unrecognized - *) - _log4sh_error "appender value/method (${_lpa_key}) unrecognized" - false - ;; - esac - [ $? -ne ${__LOG4SH_TRUE} ] && _lpa_rtrn=${__LOG4SH_ERROR} - __log4sh_return=${_lpa_rtrn} - unset _lpa_appender _lpa_key _lpa_rtrn _lpa_value - return ${__log4sh_return} - fi - - # handle appender layout values and methods - _lpa_key=`_log4sh_stripPropPrefix ${_lpa_key}` - case ${_lpa_key} in - ConversionPattern) appender_setPattern ${_lpa_appender} "${_lpa_value}" ;; - *) - _log4sh_error "layout value/method (${_lpa_key}) unrecognized" - false - ;; - esac - [ $? -ne ${__LOG4SH_TRUE} ] && _lpa_rtrn=${__LOG4SH_ERROR} - __log4sh_return=${_lpa_rtrn} - unset _lpa_appender _lpa_key _lpa_rtrn _lpa_value - return ${__log4sh_return} -} - -#/** -# -# -# string -# -# -# -# -# _log4sh_propLogger -# string property -# string value -# -# -# (future) Configures log4sh with a logger configuration -# statement. Sample output: "logger: property value". -# -# result=`_log4sh_propLogger $property $value` -# -# -# -#*/ -_log4sh_propLogger() -{ - _prop=`_log4sh_stripPropPrefix $1` - echo "logger: ${_prop} $2" - unset _prop -} - -# -# configure log4sh with a rootLogger configuration statement -# -# @param _key configuration command -# @param _value configuration value -# -#/** -# -# -# void -# -# -# -# -# _log4sh_propRootLogger -# string rootLogger -# -# -# Configures log4sh with a rootLogger configuration -# statement. It expects a comma separated string similar to the following: -# log4sh.rootLogger=ERROR, stderr, R -# The first option is the default logging level to set for all -# of the following appenders that will be created, and all following options -# are the names of appenders to create. The appender names must be -# unique. -# -# _log4sh_propRootLogger $value -# -# -# -#*/ -_log4sh_propRootLogger() -{ - __lprl_rootLogger=`echo "$@" |sed 's/ *, */,/g'` - __lprl_count=`echo "${__lprl_rootLogger}" |sed 's/,/ /g' |wc -w` - __lprl_index=1 - while [ ${__lprl_index} -le ${__lprl_count} ]; do - __lprl_operand=`echo "${__lprl_rootLogger}" |cut -d, -f${__lprl_index}` - if [ ${__lprl_index} -eq 1 ]; then - logger_setLevel "${__lprl_operand}" - else - appender_exists "${__lprl_operand}" - if [ $? -eq ${__LOG4SH_FALSE} ]; then - logger_addAppender "${__lprl_operand}" - else - _log4sh_error "attempt to add already existing appender of name (${__lprl_operand})" - fi - fi - __lprl_index=`expr ${__lprl_index} + 1` - done - - unset __lprl_count __lprl_index __lprl_operand __lprl_rootLogger -} - -#/** -# -# -# void/boolean -# -# -# -# -# log4sh_doConfigure -# string configFileName -# -# -# -# Read configuration from a file. The existing -# configuration is not cleared or reset. If you require a -# different behavior, then call the log4sh_resetConfiguration -# before calling log4sh_doConfigure. -# -# -# log4sh_doConfigure myconfig.properties -# -# -# -#*/ -log4sh_doConfigure() -{ - [ -n "${FUNCNAME:-}" ] \ - && ${__LOG4SH_TRACE} "${FUNCNAME}()${BASH_LINENO:+'(called from ${BASH_LINENO})'}" - - # prepare the environment for configuration - log4sh_resetConfiguration - - ldc_file=$1 - ldc_rtrn=${__LOG4SH_TRUE} - - # strip the config prefix and dump output to a temporary file - ldc_tmpFile="${__log4sh_tmpDir}/properties" - ${__LOG4SH_TRACE} "__LOG4SH_CONFIG_PREFIX='${__LOG4SH_CONFIG_PREFIX}'" - grep "^${__LOG4SH_CONFIG_PREFIX}\." "${ldc_file}" >"${ldc_tmpFile}" - - # read the file in. using a temporary file and a file descriptor here instead - # of piping the file into the 'while read' because the pipe causes a fork - # under some shells which makes it impossible to get the variables passed - # back to the parent script. - exec 3<&0 <"${ldc_tmpFile}" - while read ldc_line; do - ldc_key=`expr "${ldc_line}" : '\([^= ]*\) *=.*'` - ldc_value=`expr "${ldc_line}" : '[^= ]* *= *\(.*\)'` - - # strip the leading 'log4sh.' - ldc_key=`_log4sh_stripPropPrefix ${ldc_key}` - ldc_keyword=`_log4sh_getPropPrefix ${ldc_key}` - case ${ldc_keyword} in - alternative) _log4sh_propAlternative ${ldc_key} "${ldc_value}" ;; - appender) _log4sh_propAppender ${ldc_key} "${ldc_value}" ;; - logger) _log4sh_propLogger ${ldc_key} "${ldc_value}" ;; - rootLogger) _log4sh_propRootLogger "${ldc_value}" ;; - *) - _log4sh_error "unrecognized properties keyword (${ldc_keyword})" - false - ;; - esac - [ $? -ne ${__LOG4SH_TRUE} ] && ldc_rtrn=${__LOG4SH_ERROR} - done - exec 0<&3 3<&- - - # remove the temporary file - rm -f "${ldc_tmpFile}" - - # activate all of the appenders - for ldc_appender in ${__log4shAppenders}; do - ${__LOG4SH_APPENDER_FUNC_PREFIX}${ldc_appender}_activateOptions - done - - __log4sh_return=${ldc_rtrn} - unset ldc_appender ldc_file ldc_tmpFile ldc_line ldc_key ldc_keyword - unset ldc_value ldc_rtrn - return ${__log4sh_return} -} - -#/** -# -# -# void -# -# -# -# -# log4sh_readProperties -# string configFileName -# -# -# Deprecated as of 1.3.6 -# -# See log4sh_doConfigure. -# -# -# log4sh_readProperties myconfig.properties -# -# -# -#*/ -log4sh_readProperties() -{ - log4sh_doConfigure "$@" -} - -#/** -# -# -# void -# -# -# -# -# log4sh_resetConfiguration -# -# -# -# -# This function completely resets the log4sh configuration to have no -# appenders with a global logging level of ERROR. -# -# -# log4sh_resetConfiguration -# -# -# -#*/ -# XXX if a configuration is *repeatedly* established via logger_addAppender and -# reset using this command, there is a risk of running out of memory. -log4sh_resetConfiguration() -{ - __log4shAppenders='' - __log4shAppenderCount=0 - __log4shAppenderCounts='' - __log4shAppenderLayouts='' - __log4shAppenderLevels='' - __log4shAppenderPatterns='' - __log4shAppenderTypes='' - __log4shAppender_file_files='' - __log4shAppender_rollingFile_maxBackupIndexes='' - __log4shAppender_rollingFile_maxFileSizes='' - __log4shAppender_smtp_tos='' - __log4shAppender_smtp_subjects='' - __log4shAppender_syslog_facilities='' - __log4shAppender_syslog_hosts='' - - logger_setLevel ERROR -} - -#============================================================================== -# Thread -# - -#/** -# -# -# string -# -# -# -# -# logger_getThreadName -# -# -# -# Gets the current thread name. -# -# threadName=`logger_getThreadName` -# -# -# -#*/ -logger_getThreadName() -{ - echo ${__log4sh_threadName} -} - -#/** -# -# -# void -# -# -# -# -# logger_setThreadName -# string threadName -# -# -# -# Sets the thread name (e.g. the name of the script). This thread name can -# be used with the '%t' conversion character within a -# . -# -# -# logger_setThreadName "myThread" -# -# -# -#*/ -logger_setThreadName() -{ - _thread=$1 - - _length=`_log4sh_getArrayLength "$__log4sh_threadStack"` - __log4sh_threadStack=`_log4sh_setArrayElement "$__log4sh_threadStack" $_length $_thread` - __log4sh_threadName=$_thread - - unset _length _thread -} - -#/** -# -# -# void -# -# -# -# -# logger_pushThreadName -# string threadName -# -# -# Deprecated as of 1.3.7 -# -# Sets the thread name (eg. the name of the script) and pushes the old on -# to a stack for later use. This thread name can be used with the '%t' -# conversion character within a . -# -# -# logger_pushThreadName "myThread" -# -# -# -#*/ -logger_pushThreadName() -{ - __log4sh_threadStack=`_log4sh_pushStack "$__log4sh_threadStack" $1` - __log4sh_threadName=$1 -} - -#/** -# -# -# void -# -# -# -# -# logger_popThreadName -# -# -# -# Deprecated as of 1.3.7 -# -# Removes the topmost thread name from the stack. The next thread name on -# the stack is then placed in the __log4sh_threadName -# variable. If the stack is empty, or has only one element left, then a -# warning is given that no more thread names can be popped from the stack. -# -# -# logger_popThreadName -# -# -# -#*/ -logger_popThreadName() -{ - _length=`_log4sh_getArrayLength "$__log4sh_threadStack"` - if [ $_length -gt 1 ]; then - __log4sh_threadStack=`_log4sh_popStack "$__log4sh_threadStack"` - __log4sh_threadName=`_log4sh_peekStack "$__log4sh_threadStack"` - else - echo 'log4sh:WARN no more thread names available on thread name stack.' >&2 - fi -} - -#============================================================================== -# Trap -# - -#/** -# -# -# void -# -# -# -# -# log4sh_cleanup -# -# -# -# This is a cleanup function to remove the temporary directory used by -# log4sh. It is provided for scripts who want to do log4sh cleanup work -# themselves rather than using the automated cleanup of log4sh that is -# invoked upon a normal exit of the script. -# -# log4sh_cleanup -# -# -# -#*/ -log4sh_cleanup() -{ - _log4sh_cleanup 'EXIT' -} - -#/** -# -# -# void -# -# -# -# -# _log4sh_cleanup -# string signal -# -# -# This is a cleanup function to remove the temporary directory used by -# log4sh. It should only be called by log4sh itself when it is taking -# control of traps. -# If there was a previously defined trap for the given signal, log4sh -# will attempt to call the original trap handler as well so as not to break -# the parent script. -# -# _log4sh_cleanup EXIT -# -# -# -#*/ -_log4sh_cleanup() -{ - _lc__trap=$1 - ${__LOG4SH_INFO} "_log4sh_cleanup(): the ${_lc__trap} signal was caught" - - _lc__restoreTrap=${__LOG4SH_FALSE} - _lc__oldTrap='' - - # match trap to signal value - case "${_lc__trap}" in - EXIT) _lc__signal=0 ;; - INT) _lc__signal=2 ;; - TERM) _lc__signal=15 ;; - esac - - # do we possibly need to restore a previous trap? - if [ -r "${__log4sh_trapsFile}" -a -s "${__log4sh_trapsFile}" ]; then - # yes. figure out what we need to do - if [ `grep "^trap -- " "${__log4sh_trapsFile}" >/dev/null; echo $?` -eq 0 ] - then - # newer trap command - ${__LOG4SH_DEBUG} 'newer POSIX trap command' - _lc__restoreTrap=${__LOG4SH_TRUE} - _lc__oldTrap=`egrep "(${_lc__trap}|${_lc__signal})$" "${__log4sh_trapsFile}" |\ - sed "s/^trap -- '\(.*\)' [A-Z]*$/\1/"` - elif [ `grep "[0-9]*: " "${__log4sh_trapsFile}" >/dev/null; echo $?` -eq 0 ] - then - # older trap command - ${__LOG4SH_DEBUG} 'older style trap command' - _lc__restoreTrap=${__LOG4SH_TRUE} - _lc__oldTrap=`grep "^${_lc__signal}: " "${__log4sh_trapsFile}" |\ - sed 's/^[0-9]*: //'` - else - # unrecognized trap output - _log4sh_error 'unable to restore old traps! unrecognized trap command output' - fi - fi - - # do our work - rm -fr "${__log4sh_tmpDir}" - - # execute the old trap - if [ ${_lc__restoreTrap} -eq ${__LOG4SH_TRUE} -a -n "${_lc__oldTrap}" ]; then - ${__LOG4SH_INFO} 'restoring previous trap of same type' - eval "${_lc__oldTrap}" - fi - - # exit for all non-EXIT signals - if [ "${_lc__trap}" != 'EXIT' ]; then - # disable the EXIT trap - trap 0 - - # add 128 to signal value and exit - _lc__signal=`expr ${_lc__signal} + 128` - exit ${_lc__signal} - fi - - unset _lc__oldTrap _lc__signal _lc__restoreTrap _lc__trap - return -} - - -#============================================================================== -# main -# - -# create a temporary directory -__log4sh_tmpDir=`_log4sh_mktempDir` - -# preserve old trap(s) -__log4sh_trapsFile="${__log4sh_tmpDir}/traps" -trap >"${__log4sh_trapsFile}" - -# configure traps -${__LOG4SH_INFO} 'setting traps' -trap '_log4sh_cleanup EXIT' 0 -trap '_log4sh_cleanup INT' 2 -trap '_log4sh_cleanup TERM' 15 - -# alternative commands -log4sh_setAlternative mail "${LOG4SH_ALTERNATIVE_MAIL:-mail}" ${__LOG4SH_TRUE} -[ -n "${LOG4SH_ALTERNATIVE_NC:-}" ] \ - && log4sh_setAlternative nc "${LOG4SH_ALTERNATIVE_NC}" - -# load the properties file -${__LOG4SH_TRACE} "__LOG4SH_CONFIGURATION='${__LOG4SH_CONFIGURATION}'" -if [ "${__LOG4SH_CONFIGURATION}" != 'none' -a -r "${__LOG4SH_CONFIGURATION}" ] -then - ${__LOG4SH_INFO} 'configuring via properties file' - log4sh_doConfigure "${__LOG4SH_CONFIGURATION}" -else - if [ "${__LOG4SH_CONFIGURATION}" != 'none' ]; then - _log4sh_warn 'No appenders could be found.' - _log4sh_warn 'Please initalize the log4sh system properly.' - fi - ${__LOG4SH_INFO} 'configuring at runtime' - - # prepare the environment for configuration - log4sh_resetConfiguration - - # note: not using the constant variables here (e.g. for ConsoleAppender) so - # that those perusing the code can have a working example - logger_setLevel ${__LOG4SH_LEVEL_ERROR_STR} - logger_addAppender stdout - appender_setType stdout ConsoleAppender - appender_setLayout stdout PatternLayout - appender_setPattern stdout '%-4r [%t] %-5p %c %x - %m%n' -fi - -# restore the previous set of shell flags -for _log4sh_shellFlag in ${__LOG4SH_SHELL_FLAGS}; do - echo ${__log4sh_oldShellFlags} |grep ${_log4sh_shellFlag} >/dev/null \ - || set +${_log4sh_shellFlag} -done -unset _log4sh_shellFlag - -#/** -#
-#*/ diff --git a/1.4/src/test/log4sh.properties b/1.4/src/test/log4sh.properties deleted file mode 100644 index a9ce0b8..0000000 --- a/1.4/src/test/log4sh.properties +++ /dev/null @@ -1,25 +0,0 @@ -# $Id$ - -# set root logger to ERROR, and give it two appenders; stderr and R -log4sh.rootLogger = INFO, mySTDERR, mySimple, myPattern, mySyslog - -# add a file appender at the default level that logs to STDERR -log4sh.appender.mySTDERR = FileAppender -log4sh.appender.mySTDERR.File = STDERR - -# add a file appender at the DEBUG level with the default layout -log4sh.appender.mySimple = FileAppender -log4sh.appender.mySimple.Threshold = DEBUG -log4sh.appender.mySimple.File = log4sh-simple.log - -# add a file appender at the default level with a Pattern layout -log4sh.appender.myPattern = RollingFileAppender -log4sh.appender.myPattern.File = log4sh-pattern.log -log4sh.appender.myPattern.layout = PatternLayout -log4sh.appender.myPattern.layout.ConversionPattern = %d [%p] (%F) - %m%n - -# add a syslog appender at the default level with a facility of local4 -log4sh.appender.mySyslog = SyslogAppender -log4sh.appender.mySyslog.Facility = local4 -log4sh.appender.mySyslog.layout = PatternLayout -log4sh.appender.mySyslog.layout.ConversionPattern = [%p] (%F) - %m diff --git a/1.4/src/test/priorityMatrix.data b/1.4/src/test/priorityMatrix.data deleted file mode 100644 index d61a334..0000000 --- a/1.4/src/test/priorityMatrix.data +++ /dev/null @@ -1,18 +0,0 @@ -# $Id$ -# -# column definitions -# priority -# which priorities should generate a message -# -# note: the default IFS in pure POSIX shells seems to parse only spaces when -# using the 'read' builtin. as such, only spaces are used as separation -# characters below. -# -# priority TRACE DEBUG INFO WARN ERROR FATAL -TRACE 1 1 1 1 1 1 -DEBUG 0 1 1 1 1 1 -INFO 0 0 1 1 1 1 -WARN 0 0 0 1 1 1 -ERROR 0 0 0 0 1 1 -FATAL 0 0 0 0 0 1 -OFF 0 0 0 0 0 0 diff --git a/1.4/src/test/run-test-suite b/1.4/src/test/run-test-suite deleted file mode 100755 index c1257ad..0000000 --- a/1.4/src/test/run-test-suite +++ /dev/null @@ -1,116 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -SHELLS='/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh' -for f in test[A-Z]*; do - [ -x "${f}" ] && TESTS="${TESTS:+${TESTS} }${f}" -done - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -usage() -{ - echo "usage: ${MY_NAME} [-e key=val ...] [-s shell(s)] [-t test(s)]" -} - -# process command line flags -while getopts 'e:hs:t:' opt; do - case ${opt} in - e) - key=`expr "${OPTARG}" : '\([^=]*\)='` - val=`expr "${OPTARG}" : '[^=]*=\(.*\)'` - if [ -z "${key}" -o -z "${val}" ]; then - usage - exit 1 - fi - eval "${key}='${val}'" - export ${key} - env="${env:+${env} }${key}" - ;; - h) usage; exit 0 ;; - s) shells=${OPTARG} ;; - t) tests=${OPTARG} ;; - *) usage; exit 1 ;; - esac -done -shift `expr ${OPTIND} - 1` - -# fill shells and/or tests -shells=${shells:-${SHELLS}} -tests=${tests:-${TESTS}} - -# error checking -if [ -z "${tests}" ]; then - tf_error 'no tests found to run; exiting' - exit 1 -fi - -cat <&1` - exitVal=$? - if [ ${exitVal} -eq 2 ]; then - echo - echo "${version}" - fi - ;; - pdksh) ;; - zsh) ;; - esac - - # execute the tests - for suite in ${tests}; do - suiteName=`expr "${suite}" : 'test\(.*\)'` - echo - echo "--- Executing the '${suiteName}' test suite ---" >&2 - ( exec ${shell} ./${suite}; ) - done -done diff --git a/1.4/src/test/test-common b/1.4/src/test/test-common deleted file mode 100644 index 3ba98fa..0000000 --- a/1.4/src/test/test-common +++ /dev/null @@ -1,163 +0,0 @@ -# $Id$ -# vim:syntax=sh:sw=2:ts=2:expandtab -# -# Author: Kate Ward -# -# The spiffy Simsons comments were shamelessly pulled from the lf5 examples -# from log4j. -# - -# -# setup the initial logging environment -# - -smtpEmail="postmaster@localhost" -syslogFacility="local4" - -# -# do some logging -# - -# log some at the DEBUG level -logger_debug "Hello, my name is Homer Simpson." -logger_debug "Hello, my name is Lisa Simpson." -logger_debug "Hello, my name is Marge Simpson." -logger_debug "Hello, my name is Bart Simpson." -logger_debug "Hello, my name is Maggie Simpson." - -# log some at the INFO level -logger_info "We are the Simpsons!" -logger_info "Mmmmmm .... Chocolate." -logger_info "Homer likes chocolate" -logger_info "Doh!" -logger_info "We are the Simpsons!" - -# log some at the WARN level -logger_warn "Bart: I am through with working! Working is for chumps!\ - Homer: Son, I'm proud of you. I was twice your age before\ - I figured that out." -logger_warn "Mmm...forbidden donut." -logger_warn "D'oh! A deer! A female deer!" -logger_warn "Truly, yours is a butt that won't quit.\ - - Bart, writing as Woodrow to Ms. Krabappel." - -# set the level of the mySTDERR appender to OFF -appender_setLevel mySTDERR OFF - -# log some at the ERROR level -logger_error "Dear Baby, Welcome to Dumpsville. Population: you." -logger_error "Mr. Hutz, are you aware you're not wearing pants?" - -# set the mySTDERR level to DEBUG -appender_setLevel mySTDERR DEBUG - -# log some at the FATAL level -logger_fatal "Eep." -logger_fatal "Mmm...forbidden donut." -logger_fatal "D'oh! A deer! A female deer!" -logger_fatal "Mmmmmm .... Chocolate." - -# various setting changes -appender_setLayout mySTDERR PatternLayout -logger_info "test of the default pattern layout" - -appender_setPattern mySTDERR '%d [%F] %p - %m%n' -logger_info "test of setting a pattern layout" - -appender_setPattern mySTDERR '%d %p - %m%n' -logger_info "test of setting a pattern layout again" - -appender_setPattern mySimple '%d [%F] %p - %m' -logger_info "setting a pattern for a simple layout logger. should not change the pattern of the simple logger as it is still set to a simple layout." - -# manually set the value of the filename flag -logger_setFilename "myFilename" -appender_setPattern myPattern '%d [%F] %p - %m%n' -logger_info "setting a new pattern for a patterned layout file logger" - -appender_setPattern myPattern '%d [%f] %p - %m%n' -logger_info "setting a pattern for a patterned layout file logger, using an invalid character conversion." - -appender_setPattern myPattern '%d %p - %m%n' -logger_info "setting the pattern for the patterned layout file logger back to a reasonable value." - -# close some appenders -logger_info "closing the myFilename appender" -appender_close myFilename - -# test the *ThreadName functions -appender_setPattern mySTDERR '%p [%F:%t]: %m%n' -logger_info "setting a pattern layout for STDERR that uses the thread name conversion character. the thread name isn't set yet, so it should be the default value ('main' as of this writing)..." -logger_setThreadName myThread -logger_info "the thread name is now set to the name of this script, so it should show up in output now" -logger_info "will now 'push' a new thread 'myNewThread' on the thread name stack..." -logger_pushThreadName "myNewThread" -logger_info "checking to see if the thread name changed. did it?" -thread=`logger_getThreadName` -logger_info "just 'got' the thread name of '$thread'. does it match what is shown over on the left?" -logger_pushThreadName "mySecondNewThread" -logger_pushThreadName "myThirdNewThread" -logger_info "just pushed two threads named 'mySecondNewThread' and 'myThirdNewThread'. verify that the later is visible on the left, and that they pop off correctly." -for f in 1 2; do - thread=`logger_getThreadName` - logger_popThreadName - logger_info "popped the thread named '${thread}'" -done -logger_popThreadName -logger_info "I just popped the topmost thread name. the first thread name should be shown again. is it?" -logger_popThreadName -logger_info "I just tried popping again. the thread name should not have changed as we were already at the topmost thread name. there should have been a log4sh warning as well." - -# test the smtp appender -logger_addAppender mySMTP -appender_setAppenderType mySMTP SMTPAppender -appender_setLevel mySMTP FATAL -appender_smtp_setSubject mySMTP "test subject" -appender_smtp_setTo mySMTP $smtpEmail -logger_info "this message *should not* generate an email." -logger_fatal "this message *should* generate an email to '$smtpEmail'." -appender_close mySMTP - -# test the extra syslog appender functions -syslogFacilityResult=`appender_syslog_getFacilityByName mySyslog` -logger_info "just requested the syslog facility for the mySyslog appender. I expected '$syslogFacility' and got '$syslogFacilityResult'. do they match?" -logger_info "closing the mySyslog appender" -appender_close mySyslog - -# test the sending of multiple options to a logger function -logger_info this is a test message without quotes to verify that a logging function can be called without wrapping the message in quotes. - -# testing %X conversion character - MDC (Mapped Diagnostic Context) -logger_info "the next test tests the %X and %% conversion characters" -appender_setPattern mySTDERR '%d %p [%X{percent}%%] - %m%n' -percent=30 -logger_info "got some work done" -percent=75 -logger_info "got some work more done" -percent=100 -logger_info "our work is done" -appender_setPattern mySTDERR '%d %p - %m%n' - -# workaround implementation of separated date and time -logInfo() { mdcD=`date "+%Y-%m-%d"`;mdcT=`date "+%H:%M:%S"`;logger_info "$@"; } - -appender_setPattern mySTDERR '%X{mdcD}|%X{mdcT}|%m%n' -logInfo "MDC test including the date/time" -appender_setPattern mySTDERR '%d %p - %m%n' - -# test proper parsing of the '\' and '&' characters -logger_info "this message should have a backslash character hier >\<" -logger_info "this message should have an andpersand character hier >&<" - -# test grabbing output from some various commands -logger_info "this system's uname: `uname -a`" -logger_info "output of 'ls -l': `ls -l`" - -# test sending things to log4sh via pipes -echo "if this message is seen, then the sending of a message via a pipe works" |logger_info -# try the same 'ls -l' like above, but with a pipe -logger_info "output of 'ls -l' [again] via pipe in next logging statement..." -ls -l |logger_info - -# test the calling of the previous trap handler -logger_info "after this message, you should see a non-log4sh message that a cleanup function was called. if you do, than you know that the trap handler of this test script was called, and that log4sh was able to properly call that handler upon exit." diff --git a/1.4/src/test/test-functions.inc b/1.4/src/test/test-functions.inc deleted file mode 100644 index baff8df..0000000 --- a/1.4/src/test/test-functions.inc +++ /dev/null @@ -1,84 +0,0 @@ -# $Id$ -# vim:syntax=sh:sts=2 - -# -# constants -# - -# configure debugging. set the DEBUG environment variable to any -# non-empty value to enable debug output, or TRACE to enable trace -# output. -TRACE=${TRACE:+'tf_trace '} -[ -n "${TRACE}" ] && DEBUG=1 -[ -z "${TRACE}" ] && TRACE=':' - -DEBUG=${DEBUG:+'tf_debug '} -[ -z "${DEBUG}" ] && DEBUG=':' - -# -# variables -# - -tf_RANDOM=0 - -# -# functions -# - -# message functions -tf_trace() { echo "${MY_NAME}:TRACE $@" >&2; } -tf_debug() { echo "${MY_NAME}:DEBUG $@" >&2; } -tf_info() { echo "${MY_NAME}:INFO $@" >&2; } -tf_warn() { echo "${MY_NAME}:WARN $@" >&2; } -tf_error() { echo "${MY_NAME}:ERROR $@" >&2; } -tf_fatal() { echo "${MY_NAME}:FATAL $@" >&2; } - -# generate a random number -tf_generateRandom() -{ - tfgr_random=${tf_RANDOM} - - while [ "${tfgr_random}" = "${tf_RANDOM}" ]; do - if [ -n "${RANDOM:-}" ]; then - # $RANDOM works - tfgr_random=${RANDOM}${RANDOM}${RANDOM}$$ - elif [ -r '/dev/urandom' ]; then - tfgr_random=`od -vAn -N4 -tu4 -# - -# find myself -whoAmI=`basename $0` -whereAmI=`dirname $0` -whereAmI=`cd "${whereAmI}" 2>/dev/null && pwd || echo "${whereAmI}"` - -#----------------------------------------------------------------------------- -# functions -# - -test_cleanup() -{ - echo '### test script cleanup function called###' -} - -loadLog4sh() -{ - config="$1" - - if [ -r log4sh ]; then - LOG4SH_CONFIGURATION="${config}" . ./log4sh - else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 - fi - logger_trace "whoAmI=${whoAmI} whereAmI=${whereAmI}" -} - -#----------------------------------------------------------------------------- -# pre-configure log4sh -# -# the functions called in this section are meant to exactly reproduce what the -# runtime configuration test script does so that the common tests that are run -# generate the same output. - -configLog4sh() -{ - : -} - -#----------------------------------------------------------------------------- -# main -# - -# setup trap handler. must be done before loading log4sh -trap 'test_cleanup' EXIT - -# load and configure log4sh -loadLog4sh -configLog4sh - -# load and run the common tests -commonTests='test-common' -if [ -r "${commonTests}" ]; then - . ${whereAmI}/${commonTests} -else - logger_fatal "could not load the common tests" - exit 1 -fi diff --git a/1.4/src/test/test-runtime-config b/1.4/src/test/test-runtime-config deleted file mode 100755 index 3ea4de1..0000000 --- a/1.4/src/test/test-runtime-config +++ /dev/null @@ -1,96 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# - -# find myself -whoAmI=`basename $0` -whereAmI=`dirname $0` -whereAmI=`cd "${whereAmI}" 2>/dev/null && pwd || echo "${whereAmI}"` - -#----------------------------------------------------------------------------- -# functions -# - -test_cleanup() -{ - echo '### test script cleanup function called###' -} - -loadLog4sh() -{ - config="$1" - - if [ -r log4sh ]; then - LOG4SH_CONFIGURATION="${config}" . ./log4sh - else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 - fi - logger_trace "whoAmI=${whoAmI} whereAmI=${whereAmI}" -} - -#----------------------------------------------------------------------------- -# pre-configure log4sh -# -# the functions called in this section are meant to exactly reproduce what the -# log4sh.properties does so that the common tests that are run generate the -# same output. -# - -configLog4sh() -{ - # reset the log4sh configuration - log4sh_resetConfiguration - - # setup the default logging level to INFO - logger_setLevel INFO - - # add a file appender at the default level that logs to STDERR - logger_addAppender mySTDERR - appender_setType mySTDERR FileAppender - appender_file_setFile mySTDERR STDERR - appender_activateOptions mySTDERR - - # add a file appender at the DEBUG level with the default layout - logger_addAppender mySimple - appender_setLevel mySimple DEBUG - appender_setType mySimple FileAppender - appender_file_setFile mySimple log4sh-simple.log - appender_activateOptions mySimple - - # add file appender at the default level with a Pattern layout - logger_addAppender myPattern - appender_setType myPattern RollingFileAppender - appender_file_setFile myPattern log4sh-pattern.log - appender_setLayout myPattern PatternLayout - appender_setPattern myPattern '%d [%p] (%F) - %m%n' - appender_activateOptions myPattern - - # add a syslog appender at the default level with a facility of local4 - logger_addAppenderWithPattern mySyslog '[%p] (%F) - %m%n' - appender_setType mySyslog SyslogAppender - appender_syslog_setFacility mySyslog local4 - appender_activateOptions mySyslog -} - -#----------------------------------------------------------------------------- -# main -# - -# setup trap handler. must be done before loading log4sh -trap 'test_cleanup' EXIT - -# load and configure log4sh -loadLog4sh none -configLog4sh - -# load and run the common tests -commonTests='test-common' -if [ -r "${commonTests}" ]; then - . ${whereAmI}/${commonTests} -else - logger_fatal "could not load the common tests" - exit 1 -fi diff --git a/1.4/src/test/testAsciiCharset b/1.4/src/test/testAsciiCharset deleted file mode 100755 index eac9084..0000000 --- a/1.4/src/test/testAsciiCharset +++ /dev/null @@ -1,55 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -TEST_DATA="${MY_NAME}.data" - -#------------------------------------------------------------------------------ -# suite tests -# - -testAsciiCharset() -{ - # save stdin, and redirect it from a file - exec 9<&0 <"${TEST_DATA}" - while read expected; do - # ignore comment lines or blank lines - echo "${expected}" |egrep -v '^(#|$)' >/dev/null || continue - - actual="`logger_info \"${expected}\"`" - ${DEBUG} echo "expected='${expected}' actual='${actual}'" - assertEquals "'${expected}' != '${actual}'" "${expected}" "${actual}" - done - # restore stdin - exec 0<&9 9<&- -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION="${MY_NAME}.log4sh" . ./log4sh -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testAsciiCharset -} - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit2 diff --git a/1.4/src/test/testAsciiCharset.data b/1.4/src/test/testAsciiCharset.data deleted file mode 100644 index 48ef51d..0000000 --- a/1.4/src/test/testAsciiCharset.data +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ - -# 20-2F (escaping the leading space) -\ !"#$%&'()*+,-./ - -# 30-3F -0123456789:;<=>? - -# 40-4F -@ABCDEFGHIJKLMNO - -# 50-5F (escaping the backslash) -PQRSTUVWXYZ[\\]^_ - -# 60-6F -`abcdefghijklmno - -# 70-7E (7F is the unprintable DEL char) -pqrstuvwxzy{|}~ diff --git a/1.4/src/test/testAsciiCharset.log4sh b/1.4/src/test/testAsciiCharset.log4sh deleted file mode 100644 index ab50579..0000000 --- a/1.4/src/test/testAsciiCharset.log4sh +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ -log4sh.rootLogger = INFO, mySTDOUT - -log4sh.appender.mySTDOUT = ConsoleAppender -log4sh.appender.mySTDOUT.layout = PatternLayout -log4sh.appender.mySTDOUT.layout.ConversionPattern = %m%n diff --git a/1.4/src/test/testCustomMDCPatterns b/1.4/src/test/testCustomMDCPatterns deleted file mode 100755 index 92814ae..0000000 --- a/1.4/src/test/testCustomMDCPatterns +++ /dev/null @@ -1,148 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -debug() { echo "${MY_NAME}:DEBUG $@" >&2; } -DEBUG=${DEBUG:+'debug '} -[ -z "${DEBUG}" ] && DEBUG=':' -${DEBUG} 'debugging enabled' - -APP_NAME='stdout' - -#------------------------------------------------------------------------------ -# suite tests -# - -testCustomDateMDC() -{ - mdcDateFmt='+%Y.%m.%d' - pattern='%X{mdcDate}' - regex='^[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}' - - # define custom logger_info function - my_logger_info() - { - mdcDate=`date ${mdcDateFmt}` - log INFO "$@" - } - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`my_logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "dateFormat='${mdcDateFmt}' pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testCustomTimeMDC() -{ - mdcTimeFmt='+%H:%M:%S' - pattern='%X{mdcTime}' - regex='^[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - - # define custom logger_info function - my_logger_info() - { - mdcTime=`date ${mdcTimeFmt}` - log INFO "$@" - } - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`my_logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "timeFormat='${mdcTimeFmt}' pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testCustomUserHostMDC() -{ - pattern='%X{USER}@%X{HOSTNAME}' - regex='[A-Za-z0-9]*@[-.A-Za-z0-9]*' - - # set variables (if needed) - if [ -z "${HOSTNAME:-}" ]; then - HOSTNAME=`hostname` - export HOSTNAME - fi - - # set the custom pattern - appender_setPattern ${APP_NAME} ${pattern} - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'sending message using custom MDC pattern' - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} "pattern='${pattern}' result='${result}' matched='${matched}'" - - assertNotNull \ - "custom pattern '${pattern}' failed with empty result" \ - "${result}" || return - assertNull \ - "custom pattern '${pattern}' output of '${matched}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - resultFile="${__shunit_tmpDir}/result.dat" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration - - # configure log4sh - logger_setLevel INFO - logger_addAppender ${APP_NAME} - appender_setLayout ${APP_NAME} PatternLayout -} - -tearDown() -{ - rm -f "${resultFile}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testCustomDateMDC - suite_addTest testCustomTimeMDC - suite_addTest testCustomUserHostMDC -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit2 diff --git a/1.4/src/test/testFileAppender b/1.4/src/test/testFileAppender deleted file mode 100755 index b8d0ca3..0000000 --- a/1.4/src/test/testFileAppender +++ /dev/null @@ -1,205 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_ACCESSORS='accessors' -APP_ACCESSORS_FILE='' -APP_ACCESSORS_LOG4SH="${MY_NAME}-${APP_ACCESSORS}.log4sh" - -APP_SIMPLE='mySimple' -APP_SIMPLE_FILE='' -APP_SIMPLE_LOG4SH="${MY_NAME}-${APP_SIMPLE}.log4sh" - -APP_STDERR='mySTDERR' -APP_STDERR_LOG4SH="${MY_NAME}-${APP_STDERR}.log4sh" - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -commonSTDERR() -{ - assert=$1 - msg=$2 - cmd=$3 - - ${DEBUG} "sending a message to ${APP_STDERR}" - result=`eval ${cmd}` - ${DEBUG} "assert='${assert}' cmd='${cmd}' result='${result}'" - eval ${assert} \"${msg}\" \"${result}\" -} - -testSTDERR_runtime() -{ - # runtime configure a STDERR FileAppender - logger_setLevel INFO - logger_addAppender ${APP_STDERR} - appender_setType ${APP_STDERR} FileAppender - appender_file_setFile ${APP_STDERR} STDERR - appender_activateOptions ${APP_STDERR} - - commonSTDERR \ - 'assertNotNull' \ - "${APP_STDERR} runtime FileAppender didn't go to STDERR" \ - "logger_info \'dummy\' 2>&1 >/dev/null" \ - || return - - commonSTDERR \ - 'assertNull' \ - "${APP_STDERR} runtime FileAppender went to STDOUT" \ - "logger_info \'dummy\' 2>/dev/null" \ - || return -} - -testSTDERR_config() -{ - # configure a STDERR FileAppender via config - log4sh_doConfigure "${APP_STDERR_LOG4SH}" - - commonSTDERR \ - 'assertNotNull' \ - "${APP_STDERR} config FileAppender didn't go to STDERR" \ - "logger_info \'dummy\' 2>&1 1>/dev/null" \ - || return - - commonSTDERR \ - 'assertNull' \ - "${APP_STDERR} config FileAppender went to STDOUT" \ - "logger_info \'dummy\' 2>/dev/null" \ - || return -} - -commonSimple() -{ - assert=$1 - msg=$2 - cmd=$3 - - ${DEBUG} "sending a message to ${APP_SIMPLE}" - result=`eval ${cmd}` - ${DEBUG} "assert='${assert}' cmd='${cmd}' result='${result}'" - eval ${assert} \"${msg}\" \"${result}\" -} - -testSimple_runtime() -{ - # runtime configure a simple ConsoleAppender - logger_setLevel INFO - logger_addAppender ${APP_SIMPLE} - appender_setLevel ${APP_SIMPLE} DEBUG - appender_setType ${APP_SIMPLE} FileAppender - appender_file_setFile ${APP_SIMPLE} "${APP_SIMPLE_FILE}" - appender_activateOptions ${APP_SIMPLE} - - commonSimple \ - 'assertNull' \ - "${APP_SIMPLE} config FileAppender went to STDOUT or STDERR" \ - "logger_info \'dummy\' 2>&1" \ - || return - - commonSimple \ - 'assertNotNull' \ - "${APP_SIMPLE} config FileAppender didn't go to file" \ - "logger_info \'dummy\' 2>&1; cat \"${APP_SIMPLE_FILE}\"" \ - || return -} - -testSimple_config() -{ - # configure a simple ConsoleAppender via config - log4sh_doConfigure "${APP_SIMPLE_LOG4SH}" - - commonSimple \ - 'assertNull' \ - "${APP_SIMPLE} runtime FileAppender went to STDOUT or STDERR" \ - "logger_info \'dummy\' 2>&1" \ - || return - - commonSimple \ - 'assertNotNull' \ - "${APP_SIMPLE} runtime FileAppender didn't go to file" \ - "logger_info \'dummy\'; cat ${APP_SIMPLE_FILE}" \ - || return -} - -# test that the filename set in the configuration file is readable -# programatically -testAccessors_getFilename() -{ - # configure log4sh via config - log4sh_doConfigure "${APP_ACCESSORS_LOG4SH}" - - fileName=`appender_file_getFile ${APP_ACCESSORS}` - assertEquals \ - "${APP_ACCESSORS} file '${fileName}' was not '${APP_ACCESSORS_FILE}'" \ - "${fileName}" "${APP_ACCESSORS_FILE}" -} - -# test that setting the filename of an appender actually changes it -testAccessors_setgetFilename() -{ - # configure log4sh via config - log4sh_doConfigure "${APP_ACCESSORS_LOG4SH}" - - newFileName='/var/tmp/accessors.log' - - # the current filename should be what is stored in ${APP_ACCESSORS_FILE}. - # changing it to /var/tmp/accessors.log - appender_file_setFile ${APP_ACCESSORS} "${newFileName}" - - # now, re-reading the file name to verify - fileName=`appender_file_getFile ${APP_ACCESSORS}` - assertEquals \ - "${APP_ACCESSORS} file was not ${newFileName}" \ - "${fileName}" "${newFileName}" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - APP_ACCESSORS_FILE="${__shunit_tmpDir}/myAccessors.out" - APP_SIMPLE_FILE="${__shunit_tmpDir}/mySimple.out" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - rm -f "${APP_ACCESSORS_FILE}" "${APP_SIMPLE_FILE}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testSTDERR_runtime - suite_addTest testSTDERR_config - - suite_addTest testSimple_runtime - suite_addTest testSimple_config - - suite_addTest testAccessors_getFilename - suite_addTest testAccessors_setgetFilename -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit2 diff --git a/1.4/src/test/testFileAppender-accessors.log4sh b/1.4/src/test/testFileAppender-accessors.log4sh deleted file mode 100644 index 186d64b..0000000 --- a/1.4/src/test/testFileAppender-accessors.log4sh +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -# set root logger to INFO, and give it one appender mySTDERR -log4sh.rootLogger = INFO, accessors - -# add a file appender -log4sh.appender.accessors = FileAppender -log4sh.appender.accessors.File = ${APP_ACCESSORS_FILE} diff --git a/1.4/src/test/testFileAppender-mySTDERR.log4sh b/1.4/src/test/testFileAppender-mySTDERR.log4sh deleted file mode 100644 index 8941be1..0000000 --- a/1.4/src/test/testFileAppender-mySTDERR.log4sh +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ - -log4sh.rootLogger = INFO, mySTDERR - -log4sh.appender.mySTDERR = FileAppender -log4sh.appender.mySTDERR.File = STDERR diff --git a/1.4/src/test/testFileAppender-mySimple.log4sh b/1.4/src/test/testFileAppender-mySimple.log4sh deleted file mode 100644 index 8ebd71f..0000000 --- a/1.4/src/test/testFileAppender-mySimple.log4sh +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -log4sh.rootLogger = INFO, mySimple - -log4sh.appender.mySimple = FileAppender -log4sh.appender.mySimple.Threshold = DEBUG -log4sh.appender.mySimple.File = ${APP_SIMPLE_FILE} diff --git a/1.4/src/test/testLog4jCompatibility b/1.4/src/test/testLog4jCompatibility deleted file mode 100755 index 2af6b15..0000000 --- a/1.4/src/test/testLog4jCompatibility +++ /dev/null @@ -1,91 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testAppenders() -{ - for appender in \ - ConsoleAppender \ - FileAppender \ - RollingFileAppender \ - DailyRollingFileAppender \ - SMTPAppender \ - SyslogAppender - do - cat <${propFile} -log4j.rootLogger = INFO, A -log4j.appender.A = org.apache.log4j.${appender} -EOF - log4sh_doConfigure ${propFile} - rtrn=$? - assertTrue \ - "compatibility problems with the log4j ${appender}" \ - "[ ${rtrn} -eq ${__LOG4SH_TRUE} ]" - done -} - -testLayouts() -{ - for layout in \ - SimpleLayout \ - PatternLayout \ - HTMLLayout - do - cat <${propFile} -log4j.rootLogger = INFO, A -log4j.appender.A = org.apache.log4j.ConsoleAppender -log4j.appender.A.layout = org.apache.log4j.${layout} -EOF - log4sh_doConfigure ${propFile} - rtrn=$? - assertTrue \ - "compatibility problems with the log4j ${layout}" \ - "[ ${rtrn} -eq ${__LOG4SH_TRUE} ]" - done -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo 'loading log4sh' >&2 - LOG4SH_CONFIGURATION='none' \ - LOG4SH_CONFIG_PREFIX='log4j' \ - . ./log4sh - - # declare the properties file - propFile="${__shunit_tmpDir}/properties.log4sh" -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - # remove the properties file - rm -f "${propFile}" -} - -#------------------------------------------------------------------------------ -# main -# - -# load and run shUnit -${DEBUG} echo 'loading shUnit' >&2 -. ./shunit2 diff --git a/1.4/src/test/testMultipleAppenders b/1.4/src/test/testMultipleAppenders deleted file mode 100755 index 74ca644..0000000 --- a/1.4/src/test/testMultipleAppenders +++ /dev/null @@ -1,86 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_ONE_NAME="appenderOne" -APP_ONE_FILE="${MY_NAME}-one.log" -APP_TWO_NAME="appenderTwo" -APP_TWO_FILE="${MY_NAME}-two.log" - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testTwoSimilarFileAppenders() -{ - # configure log4sh - logger_setLevel INFO - - # setup first appender - logger_addAppender ${APP_ONE_NAME} - appender_setType ${APP_ONE_NAME} FileAppender - appender_file_setFile ${APP_ONE_NAME} "${APP_ONE_FILE}" - appender_activateOptions ${APP_ONE_NAME} - - # setup second appender - logger_addAppender ${APP_TWO_NAME} - appender_setType ${APP_TWO_NAME} FileAppender - appender_file_setFile ${APP_TWO_NAME} "${APP_TWO_FILE}" - appender_activateOptions ${APP_TWO_NAME} - - # log a message - tf_generateRandom - random=${tf_RANDOM} - logger_info "dummy message ${random}" - - # verify first appender - matched=`tail "${APP_ONE_FILE}" |grep "${random}"` - assertNotNull \ - 'first appender did not properly receive message' \ - "${matched}" - - # verify second appender - matched=`tail "${APP_TWO_FILE}" |grep "${random}"` - assertNotNull \ - 'second appender did not properly receive message' \ - "${matched}" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - log4sh_resetConfiguration -} - -oneTimeTearDown() -{ - rm "${APP_ONE_FILE}" "${APP_TWO_FILE}" -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testTwoSimilarFileAppenders -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit2 diff --git a/1.4/src/test/testPatternLayout b/1.4/src/test/testPatternLayout deleted file mode 100755 index fbc4486..0000000 --- a/1.4/src/test/testPatternLayout +++ /dev/null @@ -1,259 +0,0 @@ -#! /bin/sh -# $Id$ - -myName=`basename $0` -myPath=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -APP_NAME='stdout' - -#------------------------------------------------------------------------------ -# suite tests -# - -commonPatternAssert() -{ - pattern=$1 - expected=$2 - msg=$3 - - appender_setPattern ${APP_NAME} "${pattern}" - appender_activateOptions ${APP_NAME} - actual=`logger_info 'dummy'` - ${DEBUG} echo "pattern='${pattern}' expected='${expected}' actual='${actual}'" - msg=`eval "echo \"${msg}\""` - assertEquals "${msg}" "${expected}" "${actual}" -} - -testCategoryPattern() -{ - pattern='%c' - expected='shell' - msg="category '%c' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -commonDatePatternAssert() -{ - pattern=$1 - regex=$2 - - appender_setPattern ${APP_NAME} "${pattern}" - appender_activateOptions ${APP_NAME} - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "date pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNull \ - "date pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testDatePattern() -{ - # without conversion specifier (Unix date format '+%Y-%m-%d %H:%M:%S') - pattern='%d' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return - - # ISODATE conversion specifier - pattern='%d{ISODATE}' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return - - # custom conversion specifier - pattern='%d{HH:mm:ss,SSS}' - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}' - commonDatePatternAssert "${pattern}" "${regex}" || return -} - -testFileNamePattern() -{ - pattern='%F' - expected="${myName}" - msg="file name '%F' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testLineNumberPattern() -{ - pattern='%L' - expected='' - msg="line number '%L' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testLineSeparatorPattern() -{ - pattern='%n' - expected='' - msg="line separator '%n' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testMessagePattern() -{ - pattern='%m' - expected='dummy' - msg="message '%m' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -commonPriorityPatternAssert() -{ - expected=$2 - msg=$3 - - appender_setPattern ${APP_NAME} "${pattern}" - appender_activateOptions ${APP_NAME} - actual=`logger_info 'dummy'` - ${DEBUG} echo "pattern='${pattern}' expected='${expected}' actual='${actual}'" - msg=`eval echo "${msg}"` - assertEquals "${msg}" "${expected}" "${actual}" -} - -# note: this function using the base log() function rather than the logger_*() -# functions as the functionality is effectively the same -testPriorityPattern() -{ - currPriority=`appender_getLevel ${APP_NAME}` - - pattern='%p' - appender_setPattern ${APP_NAME} "${pattern}" - for priority in TRACE DEBUG INFO WARN ERROR FATAL; do - appender_setLevel ${APP_NAME} ${priority} - appender_activateOptions ${APP_NAME} - result=`log ${priority} 'dummy'` - ${DEBUG} echo "pattern='${pattern}' priority='${priority}' result='${result}'" - assertEquals \ - "priority pattern '${pattern}' failed: the requested priority of '${priority}' does not match the returned priority of '${result}'" \ - "${priority}" "${result}" || break - done - - appender_setLevel ${APP_NAME} ${currPriority} - appender_activateOptions ${APP_NAME} -} - -testRunningTimePattern() -{ - pattern='%r' - regex='^[0-9]*(\.[0-9]*){0,1}$' - - appender_setPattern ${APP_NAME} "${pattern}" - appender_activateOptions ${APP_NAME} - result=`logger_info 'dummy'` - matched=`echo "${result}" |egrep "${regex}"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "running time pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNotNull \ - "running time pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -testThreadNamePattern() -{ - pattern='%t' - expected=${__LOG4SH_THREAD_DEFAULT} - msg="thread name '%t' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -# NDC (Nested Diagnostic Context) -testNDCPattern() -{ - pattern='%x' - expected='' - msg="NDC '%x' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -# MDC (Mapped Diagnostic Context) -testMDCPattern() -{ - msg="MDC '\${pattern}' pattern failed: '\${expected}' != '\${actual}'" - - pattern='%X{USER}' - expected=${USER} - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return - - # the %X pattern should not parse unless it has an environment variable name - # enclosed in {} chars following the 'X' - pattern='%X' - expected=${pattern} - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testPercentPattern() -{ - pattern='%%' - expected='%' - msg="percent '\${pattern}' pattern failed: '\${expected}' != '\${actual}'" - commonPatternAssert "${pattern}" "${expected}" "${msg}" || return -} - -testDefaultPattern() -{ - # the pattern should be '%d %p - %m%n' - pattern=${__LOG4SH_PATTERN_DEFAULT} - regex='^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - result=`logger_info 'dummy'` - matched=`echo ${result} |sed "s/${regex}//"` - ${DEBUG} echo "pattern='${pattern}' result='${result}' regex='${regex}' matched='${matched}'" - - assertNotNull \ - "default pattern '${pattern}' failed: empty result '${result}'" \ - "${result}" || return - assertNull \ - "default pattern '${pattern}' failed: result '${result}' did not match the regex '${regex}'" \ - "${matched}" || return -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION='none' . ./log4sh - logger_setLevel INFO - appender_setLayout ${APP_NAME} PatternLayout -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testCategoryPattern - suite_addTest testDatePattern - suite_addTest testFileNamePattern - suite_addTest testLineNumberPattern - suite_addTest testLineSeparatorPattern - suite_addTest testMessagePattern - suite_addTest testPriorityPattern - suite_addTest testRunningTimePattern - suite_addTest testThreadNamePattern - suite_addTest testNDCPattern - suite_addTest testMDCPattern - suite_addTest testPercentPattern -} - -# need working egrep. the one for Solaris is in /usr/xpg4/bin, so we will add -# that to the path -PATH="/usr/xpg4/bin:${PATH}" - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit2 diff --git a/1.4/src/test/testPriority b/1.4/src/test/testPriority deleted file mode 100755 index 020c57d..0000000 --- a/1.4/src/test/testPriority +++ /dev/null @@ -1,91 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -DEBUG=${DEBUG:+' '} -DEBUG=${DEBUG:-':'} -${DEBUG} echo 'DEBUG output enabled' >&2 - -APP_NAME='stdout' -TEST_DATA="priorityMatrix.data" - -#------------------------------------------------------------------------------ -# suite tests -# - -testPriorityMatrix() -{ - PRIORITY_NAMES='TRACE DEBUG INFO WARN ERROR FATAL' - PRIORITY_POS='1 2 3 4 5 6' - - # save stdin, and redirect it from a file - exec 9<&0 <"${TEST_DATA}" - while read priority outputs; do - # ignore comment lines or blank lines - echo "${priority}" |egrep -v '^(#|$)' >/dev/null || continue - - ${DEBUG} echo "setting appender priority to '${priority}' priority" - appender_setLevel ${APP_NAME} ${priority} - appender_activateOptions ${APP_NAME} - - # the number of outputs must match the number of priority names and - # positions for this to work - for pos in ${PRIORITY_POS}; do - testPriority=`echo ${PRIORITY_NAMES} |cut -d' ' -f${pos}` - shouldOutput=`echo ${outputs} |cut -d' ' -f${pos}` - - ${DEBUG} echo "generating '${testPriority}' message" - result=`log ${testPriority} 'dummy'` - ${DEBUG} echo "result=${result}" - - if [ ${shouldOutput} -eq 1 ]; then - assertTrue \ - "'${priority}' priority appender did not emit a '${testPriority}' message" \ - "[ -n \"${result}\" ]" - else - assertFalse \ - "'${priority}' priority appender emitted a '${testPriority}' message" \ - "[ -n \"${result}\" ]" - fi - done - done - # restore stdin - exec 0<&9 9<&- -} - -testInvalidPriority() -{ - # validate that requesting an invalid logging level (i.e. priority) will fail - log INVALID 'some message' - assertTrue \ - "logging with an invalid logging level did not properly fail" \ - "[ $? -eq ${__LOG4SH_ERROR} ]" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo "loading log4sh" >&2 - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testPriorityMatrix - suite_addTest testInvalidPriority -} - -# load and run shUnit -${DEBUG} echo "loading shUnit" >&2 -. ./shunit2 diff --git a/1.4/src/test/testPropertyConfig b/1.4/src/test/testPropertyConfig deleted file mode 100755 index ff4be33..0000000 --- a/1.4/src/test/testPropertyConfig +++ /dev/null @@ -1,101 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testAppenders() -{ - # - # invalid appender - # - cat <${propFile} -log4sh.rootLogger = INFO, A -log4sh.appender.A = InvalidAppender -EOF - echo '- expecting one error' - log4sh_doConfigure ${propFile} - rtrn=$? - assertTrue \ - 'the InvalidAppender was not caught' \ - "[ ${rtrn} -ne ${__LOG4SH_TRUE} ]" -} - -testLayouts() -{ - # - # invalid layout - # - cat <${propFile} -log4sh.rootLogger = INFO, A -log4sh.appender.A = ConsoleAppender -log4sh.appender.A.layout = InvalidLayout -EOF - echo '- expecting one error' - log4sh_doConfigure ${propFile} - rtrn=$? - assertTrue \ - 'the InvalidLayout was not caught' \ - "[ ${rtrn} -ne ${__LOG4SH_TRUE} ]" -} - -testLayoutTypes() -{ - # - # invalid layout type - # - cat <${propFile} -log4sh.rootLogger = INFO, A -log4sh.appender.A = ConsoleAppender -log4sh.appender.A.layout = SimpleLayout -log4sh.appender.A.layout.InvalidType = blah -EOF - echo '- expecting one error' - log4sh_doConfigure ${propFile} - rtrn=$? - assertTrue \ - 'the invalid layout type was not caught' \ - "[ ${rtrn} -ne ${__LOG4SH_TRUE} ]" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} echo 'loading log4sh' >&2 - LOG4SH_CONFIGURATION='none' . ./log4sh - - # declare the properties file - propFile="${__shunit_tmpDir}/properties.log4sh" -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - # remove the properties file - rm -f "${propFile}" -} - -#------------------------------------------------------------------------------ -# main -# - -# load and run shUnit -${DEBUG} echo 'loading shUnit' >&2 -. ./shunit2 diff --git a/1.4/src/test/testRollingFileAppender b/1.4/src/test/testRollingFileAppender deleted file mode 100755 index b9d739b..0000000 --- a/1.4/src/test/testRollingFileAppender +++ /dev/null @@ -1,556 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` -MY_LOG4SH="${MY_NAME}.log4sh" - -APP_NAME='R' -APP_MAX_FILE_SIZE='10KiB' -APP_MAX_FILE_SIZE_REAL=10240 -APP_MAX_BACKUP_INDEX='1' - -appFile='' -resultFile='' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# custom asserts -# - -assertFileExists() -{ - ${DEBUG} "assertFileExists($@)" - if [ $# -eq 2 ]; then - assertTrue "$1" "[ -f '$2' ]" - else - assertTrue "[ -f '$1' ]" - fi -} - -assertFileNotExists() -{ - ${DEBUG} "assertFileNotExists($@)" - if [ $# -eq 2 ]; then - assertTrue "$1" "[ ! -f '$2' ]" - else - assertTrue "[ ! -f '$1' ]" - fi -} - -#------------------------------------------------------------------------------ -# suite tests -# - -loadLog4sh_runtime() -{ - # add a rolling file appender at the INFO level - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} ${APP_MAX_BACKUP_INDEX} - - # activate the appender - appender_activateOptions ${APP_NAME} -} - -loadLog4sh_config() -{ - # load log4sh configuration - log4sh_doConfigure "${MY_LOG4SH}" -} - -createSizedFile() -{ - file=$1 - size=$2 - - # this could be slow... - ${DEBUG} "creating ${size} byte file..." - if [ ${size} -gt 0 ]; then - result=`dd if=/dev/zero of="${file}" bs=1 count=${size} 2>&1` - if [ $? -ne 0 ]; then - echo "ERROR: had problems creating the '${file}' of ${size} bytes" - return 1 - fi - else - touch "${file}" - fi -} - -testEmptyFile_runtime() -{ testEmptyFile runtime; } -testEmptyFile_config() -{ testEmptyFile config; } -testEmptyFile() -{ - ${DEBUG} 'testing empty file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" 0 \ - || return 1 - - # log a message - logger_error 'dummy message' - - # as we started with a empty file, writing a single logging message should - # not have caused an overrun, nor a rotation - assertFileNotExists \ - "the file rotated, but it shouldn't have" \ - "${appFile}.0" -} - -testOneByteUnderSize_runtime() -{ testOneByteUnderSize runtime; } -testOneByteUnderSize_config() -{ testOneByteUnderSize config; } -testOneByteUnderSize() -{ - ${DEBUG} 'testing one byte under sized file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} - 1` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was just under the limit for doing a rotation, so - # again, no rotation should have occurred - assertFileNotExists \ - "the file rotated, but it shouldn't have" \ - "${appFile}.0" -} - -testExactlyRightSize_runtime() -{ testExactlyRightSize runtime; } -testExactlyRightSize_config() -{ testExactlyRightSize config; } -testExactlyRightSize() -{ - ${DEBUG} 'testing exactly right sized file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was exactly the right size for doing a rotation. a - # rotation should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testOneByteOverSize_runtime() -{ testOneByteOverSize runtime; } -testOneByteOverSize_config() -{ testOneByteOverSize config; } -testOneByteOverSize() -{ - ${DEBUG} 'testing one byte oversize file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} + 1` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was just above the threshold for rotation. a rotation - # should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testOrderOfMagnitudeLarger_runtime() -{ testOrderOfMagnitudeLarger runtime; } -testOrderOfMagnitudeLarger_config() -{ testOrderOfMagnitudeLarger config; } -testOrderOfMagnitudeLarger() -{ - ${DEBUG} 'testing one byte oversize file' - useLog4sh=$1 - - # configure log4sh - loadLog4sh_${useLog4sh} - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create file(s) - createSizedFile "${appFile}" `expr ${APP_MAX_FILE_SIZE_REAL} \* 10` \ - || return 1 - - # log a message - logger_error 'dummy message' - - # this time, the file was way above the threshold for rotation. a rotation - # should have occurred - assertFileExists \ - "the file didn't rotate, but it should have" \ - "${appFile}.0" -} - -testMaxBackupIndexOf2() -{ - ${DEBUG} 'testing a maximum backup index of 2' - - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 2 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 2, there should be only two backups (.0 and .1) - assertFileNotExists \ - 'a backup file with a .2 extension should not exist' \ - "${appFile}.2" - assertFileExists \ - 'a backup file with a .1 extension should exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" - - # - # test with existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.1" - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 2, there should be only two backups (.0 and .1) - assertFileNotExists \ - 'a backup file with a .2 extension should not have been created' \ - "${appFile}.2" - assertFileExists \ - 'a backup file with a .1 extension should exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" -} - -testMaxBackupIndexOf1() -{ - ${DEBUG} 'testing a maximum backup index of 1' - - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 1 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .1 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 1, there should be only one backup (.0) - assertFileNotExists \ - 'a backup file with a .1 extension should not exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" - - # - # test with existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - touch "${appFile}.0" - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 1, there should be only one backup (.0) - assertFileNotExists \ - 'a backup file with a .1 extension should not exist' \ - "${appFile}.1" - assertFileExists \ - 'a backup file with a .0 extension should exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # the .0 backup should have the same size as the file it was rotated from - if [ -f "${appFile}.0" ]; then - appFile0Size=`wc -c "${appFile}.0" |awk '{print $1}'` - else - appFile0Size=0 - fi - assertTrue \ - "the backup file with a .0 extension wasn't properly rotated" \ - "[ ${APP_MAX_FILE_SIZE_REAL} -eq ${appFile0Size} ]" -} - -testMaxBackupIndexOf0() -{ - ${DEBUG} 'testing a maximum backup index of 0' - - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_file_setMaxFileSize ${APP_NAME} ${APP_MAX_FILE_SIZE} - appender_file_setMaxBackupIndex ${APP_NAME} 0 - appender_activateOptions ${APP_NAME} - - # - # test with no existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 0, there should no backups - assertFileNotExists \ - 'a backup file with a .0 extension should not exist' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" - - # - # test with existing .0 backup - # - - # removing any previous files - rm -f "${appFile}" "${appFile}".* - - # create files - createSizedFile "${appFile}" ${APP_MAX_FILE_SIZE_REAL} \ - || return 1 - - # log a message - logger_error 'dummy message' - - # with a backup index of 0, there should be no backups - assertFileNotExists \ - 'a backup file with a .0 extension should not have been created' \ - "${appFile}.0" - assertFileExists \ - 'the log file should exist' \ - "${appFile}" -} - -testMaxFileSizeGetterSetter() -{ - # setup - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} RollingFileAppender - appender_file_setFile ${APP_NAME} "${appFile}" - appender_activateOptions ${APP_NAME} - - ### getter - - # check that the default size equals the default of log4sh - size=`appender_file_getMaxFileSize ${APP_NAME}` - assertEquals \ - "the returned MaxFileSize (${size}) did not equal the log4sh default" \ - "${size}" ${__LOG4SH_TYPE_ROLLING_FILE_MAX_FILE_SIZE} - - ### setter - - # test passing valid units; there should be no warnings or errors - for unit in B KB KiB MB MiB GB GiB TB TiB; do - appender_file_setMaxFileSize ${APP_NAME} 1${unit} - assertTrue \ - "setter failed with the '${unit}' unit" \ - "[ $? -eq ${__LOG4SH_TRUE} ]" - done - - # test passing an empty unit - echo '- expecting one warning' - appender_file_setMaxFileSize ${APP_NAME} 1 - assertTrue \ - "setter failed with an empty unit" \ - "[ $? -eq ${__LOG4SH_TRUE} ]" - - # test passing an invalid unit - echo '- expecting one error' - appender_file_setMaxFileSize ${APP_NAME} 1foo - assertTrue \ - "setter succeeded with an invalid unit" \ - "[ $? -eq ${__LOG4SH_ERROR} ]" -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - appFile="${__shunit_tmpDir}/rfa.log" - resultFile="${__shunit_tmpDir}/result.dat" - - # load log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ${MY_PATH}/log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -tearDown() -{ - rm -f "${appFile}" "${appFile}".* -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - suite_addTest testEmptyFile_runtime - suite_addTest testOneByteUnderSize_runtime - suite_addTest testExactlyRightSize_runtime - suite_addTest testOneByteOverSize_runtime - suite_addTest testOrderOfMagnitudeLarger_runtime - - suite_addTest testEmptyFile_config - suite_addTest testOneByteUnderSize_config - suite_addTest testExactlyRightSize_config - suite_addTest testOneByteOverSize_config - suite_addTest testOrderOfMagnitudeLarger_config - - suite_addTest testMaxBackupIndexOf2 - suite_addTest testMaxBackupIndexOf1 - suite_addTest testMaxBackupIndexOf0 - - suite_addTest testMaxFileSizeGetterSetter -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit2 diff --git a/1.4/src/test/testRollingFileAppender.log4sh b/1.4/src/test/testRollingFileAppender.log4sh deleted file mode 100644 index 0bfa686..0000000 --- a/1.4/src/test/testRollingFileAppender.log4sh +++ /dev/null @@ -1,11 +0,0 @@ -# set root logger to ERROR, and give it one appenders; R -log4sh.rootLogger = ERROR, R - -# setup the R appender as a rolling file appender at the INFO level -log4sh.appender.R = RollingFileAppender -log4sh.appender.R.Threshold = INFO -log4sh.appender.R.File = ${__shunit_tmpDir:+${__shunit_tmpDir}/}rfa.log -log4sh.appender.R.MaxFileSize = 10KiB -log4sh.appender.R.MaxBackupIndex = 1 -log4sh.appender.R.layout = PatternLayout -log4sh.appender.R.layout.ConversionPattern = %d [%t] %-5p %c - %m%n diff --git a/1.4/src/test/testSMTPAppender b/1.4/src/test/testSMTPAppender deleted file mode 100755 index e0a61bd..0000000 --- a/1.4/src/test/testSMTPAppender +++ /dev/null @@ -1,143 +0,0 @@ -#! /bin/sh -# $Id$ - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_NAME='mySMTP' -APP_CONFIG="${MY_NAME}.log4sh" - -TEST_SUBJECT='This is a Subject worth testing' -TEST_TO='some.user@some.host' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testSubjectGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SMTPAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default Subject is empty' - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertNull \ - 'the default SMTP Subject was not empty' \ - "${currSubject}" - - ${DEBUG} 'testing that it is possible to set and get the SMTP Subject' - # TODO: test for the log4sh:ERROR message - appender_smtp_setSubject ${APP_NAME} "${TEST_SUBJECT}" - appender_activateOptions ${APP_NAME} - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertEquals \ - 'the returned SMTP Subject does not match the one that was set' \ - "${currSubject}" "${TEST_SUBJECT}" - - # TODO: test the passing of invalid params - - unset currSubject -} - -testToGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SMTPAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default To is empty' - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertNull \ - 'the default SMTP To was not empty' \ - "${currTo}" - - ${DEBUG} 'testing that it is possible to set and get the SMTP To' - # TODO: test for the log4sh:ERROR message - appender_smtp_setTo ${APP_NAME} "${TEST_TO}" - appender_activateOptions ${APP_NAME} - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertEquals \ - 'the returned SMTP To does not match the one that was set' \ - "${currTo}" "${TEST_TO}" - - # TODO: test the passing of invalid params - - unset currTo -} - -testAppenderSetupFromConfig() -{ - # configure log4sh - log4sh_doConfigure "${APP_CONFIG}" - - ${DEBUG} 'verifying that the appender Type was properly set' - currType=`appender_getType ${APP_NAME}` - ${TRACE} "currType='${currType}'" - assertEquals \ - 'the returned appender type was not SMTPAppender' \ - "${currType}" 'SMTPAppender' - - ${DEBUG} 'verifying that the appender Subject was properly set' - currSubject=`appender_smtp_getSubject ${APP_NAME}` - ${TRACE} "currSubject='${currSubject}'" - assertEquals \ - 'the returned SMTP Subject does not match what was expected' \ - "${currSubject}" "${TEST_SUBJECT}" - - ${DEBUG} 'verifying that the appender To was properly set' - currTo=`appender_smtp_getTo ${APP_NAME}` - ${TRACE} "currTo='${currTo}'" - assertEquals \ - 'the returned SMTP To does not match what was expected' \ - "${currTo}" "${TEST_TO}" - - unset currType currSubject currTo -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - ${TRACE} 'oneTimeSetUp()' - - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - ${TRACE} 'setUp()' - log4sh_resetConfiguration -} - -#------------------------------------------------------------------------------ -# main -# - -suite() -{ - for suite in \ - testSubjectGetterSetter \ - testToGetterSetter \ - testAppenderSetupFromConfig - do - suite_addTest ${suite} - done -} - -# load and run shUnit -${DEBUG} 'loading shUnit' -. ./shunit2 diff --git a/1.4/src/test/testSMTPAppender.log4sh b/1.4/src/test/testSMTPAppender.log4sh deleted file mode 100644 index cde9440..0000000 --- a/1.4/src/test/testSMTPAppender.log4sh +++ /dev/null @@ -1,10 +0,0 @@ -# $Id$ - -# set root logger to ERROR, and give it one appenders; mySMTP -log4sh.rootLogger = ERROR, mySMTP - -# setup the mySMTP appender as a rolling file appender at the INFO level -log4sh.appender.mySMTP = SMTPAppender -log4sh.appender.mySMTP.Threshold = INFO -log4sh.appender.mySMTP.To = some.user@some.host -log4sh.appender.mySMTP.Subject = This is a Subject worth testing diff --git a/1.4/src/test/testSyslogAppender b/1.4/src/test/testSyslogAppender deleted file mode 100755 index 5586d4a..0000000 --- a/1.4/src/test/testSyslogAppender +++ /dev/null @@ -1,258 +0,0 @@ -#! /bin/sh -# $Id$ -# vim:sts=2 -# -# This unit test tests the general logging functionality of Syslog. It sends -# all logging to only a single facility to prevent spamming of system logs -# (something that happens to be a side effect of running this test). This test -# expects that syslog has been configured to write its output to the -# /var/log/log4sh.log logfile so that this file can be parsed. -# -# Sample syslog.conf entries. Note, one should *not* add a '-' char before the -# filename to enable buffering (available only with certain Syslog variants). -# -### Linux (sysklogd) -# local4.* /var/log/log4sh.log -# -### Solaris (syslogd; use tabs for whitespace!) -# local4.debug /var/log/log4sh.log -# -# Possible issues: -# * race conditions waiting for logs to be output via syslog. our backoff might -# be too short for the syslog message to arrive -# * different Syslog variants produce different output. we try to get around -# this by outputing a unique random number to each logging message so each -# message can be tracked individually. -# - -MY_NAME=`basename $0` -MY_PATH=`dirname $0` - -APP_NAME='mySyslog' -APP_SYSLOG_FACILITY='local4' - -BACKOFF_TIMES='0 1 2 4' -TAIL_SAMPLE_SIZE=25 -TEST_PRIORITY_DATA='priorityMatrix.data' -TEST_SYSLOG_DATA="${MY_NAME}.data" -TEST_LOGFILE='/var/log/log4sh.log' - -# load common unit test functions -. "${MY_PATH}/test-functions.inc" - -#------------------------------------------------------------------------------ -# suite tests -# - -testFacilityGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing the setting and getting of the valid syslog facilities' - for facility in `tf_getDataSect facilities "${TEST_SYSLOG_DATA}"`; do - appender_syslog_setFacility ${APP_NAME} "${facility}" - appender_activateOptions ${APP_NAME} - currFacility=`appender_syslog_getFacility ${APP_NAME}` - assertEquals \ - "the syslog facility (${currFacility}) does not match the one set (${facility})" \ - "${facility}" "${currFacility}" - done - - ${DEBUG} 'testing an invalid syslog facility' - testFacility='invalid' - appender_syslog_setFacility ${APP_NAME} "${testFacility}" - appender_activateOptions ${APP_NAME} - currFacility=`appender_syslog_getFacility ${APP_NAME}` - failSame \ - "the returned syslog facility (${currFacility}) matches the invalid one set (${testFacility})" \ - "${testFacility}" "${currFacility}" - - # TODO: test the passing of invalid params - - unset facility currFacility testFacility -} - -testHostGetterSetter() -{ - # configure log4sh - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_activateOptions ${APP_NAME} - - ${DEBUG} 'testing that the default syslog host is empty' - currHost=`appender_syslog_getHost ${APP_NAME}` - assertNull \ - 'the default syslog host was not empty' \ - "${currHost}" - - ${DEBUG} 'testing that it is possible to set and get the syslog host' - testHost='localhost' - # TODO: test for the log4sh:ERROR message - appender_syslog_setHost ${APP_NAME} "${testHost}" - appender_activateOptions ${APP_NAME} - currHost=`appender_syslog_getHost ${APP_NAME}` - assertEquals \ - 'the syslog host does not match the one that was set' \ - "${testHost}" "${currHost}" - - # TODO: test the passing of invalid params - - unset currHost testHost -} - -testPriorityMatrix() -{ - PRIORITY_NAMES='TRACE DEBUG INFO WARN ERROR FATAL' - PRIORITY_POS='1 2 3 4 5 6' - PRIORITY_DATA="priorityMatrix.data" - - # if the test logfile doesn't exist, we want to skip the tests - [ -r "${TEST_LOGFILE}" ] || startSkipping - - # configure log4sh (appender_activateOptions called later) - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_syslog_setFacility ${APP_NAME} ${APP_SYSLOG_FACILITY} - - # save stdin, and redirect it from a file - exec 9<&0 <"${PRIORITY_DATA}" - while read priority outputs; do - # ignore comment lines or blank lines - echo "${priority}" |egrep -v '^(#|$)' >/dev/null || continue - - echo " testing appender priority '${priority}'" - appender_setLevel ${APP_NAME} ${priority} - appender_activateOptions ${APP_NAME} - - # the number of outputs must match the number of priority names and - # positions for this to work - for pos in ${PRIORITY_POS}; do - testPriority=`echo ${PRIORITY_NAMES} |cut -d' ' -f${pos}` - shouldOutput=`echo ${outputs} |cut -d' ' -f${pos}` - result='' - - ${DEBUG} "generating '${testPriority}' message" - tf_generateRandom - random=${tf_RANDOM} - log ${testPriority} "${MY_NAME} test message - ${random}" - - # do a timed backoff to wait for the result -- syslog might take a bit - if ! isSkipping; then - for backoff in ${BACKOFF_TIMES}; do - [ ${backoff} -eq 2 ] \ - && echo " waiting for possible '${testPriority}' message..." - sleep ${backoff} - result=`tail ${tailNumOpt}${TAIL_SAMPLE_SIZE} "${TEST_LOGFILE}" |\ - grep "${random}"` - [ -n "${result}" ] && break - done - ${DEBUG} "result=${result}" - fi - - if [ ${shouldOutput} -eq 1 ]; then - assertNotNull \ - "'${priority}' priority appender did not emit a '${testPriority}' message" \ - "${result}" - else - assertNull \ - "'${priority}' priority appender emitted a '${testPriority}' message" \ - "${result}" - fi - done - done - - # restore stdin - exec 0<&9 9<&- - - unset backoff outputs priority random result shouldOutput testPriority -} - -# -# this test attempts to send a message to a remote syslog host. in this case, -# it is actually the localhost, but when a syslog host is defined, a completely -# different set of logging code is exercised. using the same local4 facility -# like in the priority matrix test, we should still be able to test for the -# presence of a logging message. -# -testRemoteLogging() -{ - # define the netcat alternative command (required!) - log4sh_setAlternative 'nc' "${LOG4SH_ALTERNATIVE_NC:-/bin/nc}" - [ $? -eq ${__LOG4SH_TRUE} ] || startSkipping - - # if the test logfile doesn't exist, we want to skip the tests - [ -r "${TEST_LOGFILE}" ] || startSkipping - - # configure log4sh - ${DEBUG} 'configuring log4sh' - logger_addAppender ${APP_NAME} - appender_setType ${APP_NAME} SyslogAppender - appender_syslog_setFacility ${APP_NAME} 'local4' - appender_syslog_setHost ${APP_NAME} 'localhost' - appender_activateOptions ${APP_NAME} - - # send a logging message - ${DEBUG} 'generating message' - tf_generateRandom - random=${tf_RANDOM} - logger_error "${MY_NAME} test message - ${random}" - - # skip the actual test if there is no logfile to tail at - if [ ! -r "${TEST_LOGFILE}" ]; then - fail - else - # do a timed backoff to wait for the result -- syslog might take a bit - for backoff in ${BACKOFF_TIMES}; do - [ ${backoff} -eq 2 ] \ - && echo " waiting longer for message..." - sleep ${backoff} - result=`tail ${tailNumOpt}${TAIL_SAMPLE_SIZE} "${TEST_LOGFILE}" |\ - grep "${random}"` - [ -n "${result}" ] && break - done - ${DEBUG} "result=${result}" - - assertNotNull \ - 'did not receive the remotely logged syslog message' \ - "${result}" - fi - - unset backoff random result -} - -#------------------------------------------------------------------------------ -# suite functions -# - -oneTimeSetUp() -{ - # source log4sh - ${DEBUG} 'loading log4sh' - LOG4SH_CONFIGURATION='none' . ./log4sh -} - -setUp() -{ - # reset log4sh - log4sh_resetConfiguration -} - -#------------------------------------------------------------------------------ -# main -# - -# check options on tail command -result=`echo '' |tail -n 1 >/dev/null 2>&1` -if [ $? -eq 0 ]; then - # newer tail command - tailNumOpt='-n ' -else - tailNumOpt='-' -fi - -# load and run shUnit2 -${DEBUG} 'loading shUnit2' -. ./shunit2 diff --git a/1.4/src/test/testSyslogAppender.data b/1.4/src/test/testSyslogAppender.data deleted file mode 100644 index e4a5e01..0000000 --- a/1.4/src/test/testSyslogAppender.data +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ - -[facilities] -auth -authpriv -cron -daemon -ftp -kern -lpr -mail -news -security -syslog -user -uucp -local0 -local1 -local2 -local3 -local4 -local5 -local6 -local7 diff --git a/1.5/bin/extractDocs.pl b/1.5/bin/extractDocs.pl deleted file mode 100755 index a803526..0000000 --- a/1.5/bin/extractDocs.pl +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/perl -# $Id$ - -if(@ARGV != 1) { - print "usage: $0 sourceFile\n"; - exit; -} - -$sourceFile = $ARGV[0]; - -# -# read in the source file -# -$rslt = open(FILE, $sourceFile) - || die "could not open file ($sourceFile)"; - -$inComment = 0; -while() { - next if /^[^#]/; - s/^# //; - s/^#//; - - if(/^\/\*\*/) { - $inComment = 1; - next; - } - if(/\*\/$/) { - $inComment = 0; - next; - } - - if ($inComment == 1) { print $_ }; - if ($inComment == 0 && /\/\/\*/) { - @line = split /\/\/\*/, $_, 2; - $line[1] =~ s/^ //; - print $line[1]; - } -} - -close(FILE); diff --git a/1.5/doc/BUILD.txt b/1.5/doc/BUILD.txt deleted file mode 100644 index 0856f62..0000000 --- a/1.5/doc/BUILD.txt +++ /dev/null @@ -1,45 +0,0 @@ -# $Id$ - -BUILD DOCUMENTATION - -As log4sh is a shell script, there is no need to build the code. It is already -built. There is a Makefile included that simplifies various things about -environment setup, but nothing more. - - -BUILDING THE DOCBOOK DOCUMENTATION - -To build the documentation, you will need the following installed on your -system: - -o Sun Java JRE 1.3.x (or newer) -o Apache Ant 1.5 (or newer) -o bzip2 -o tar -o unzip - -The documentation is built using XML and XSLT from the DocBook project. The -required files are not included in the log4sh distribution as they are not -normally needed. The necessary archives can be retrieved from the one of the -URLs listed below. Place the files in the share/dist directory. - -docbook-xml-4.3.zip - http://www.docbook.org/xml/4.3/docbook-xml-4.3.zip - http://forestent.com/dist/docbook/docbook-xml-4.3.zip -docbook-xsl-1.67.2.tar.bz2 - http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.67.2.tar.bz2?download - http://forestent.com/dist/docbook/docbook-xsl-1.67.2.tar.bz2 - -Once the archives have copied to the share/dist directory, they can be -extracted into the share/docbook directory. There is a Makefile in that -directory that will automate this task. - -$ cd share/docbook -$ make - -Once the archives are extracted, it can be generated by running ant. Change to -the src/docbook directory, and run ant. The documentation will be generated in -the distributions doc directory. - -$ cd src/docbook -$ ant diff --git a/1.5/doc/DesignDoc-1.3.txt b/1.5/doc/DesignDoc-1.3.txt deleted file mode 100644 index 6cb8f96..0000000 --- a/1.5/doc/DesignDoc-1.3.txt +++ /dev/null @@ -1,40 +0,0 @@ -* static vs dynamic appenders. generate static versions, and source them - -appenders -- need static function that gets called that does the work. -- for example, if the appender writes to a file, it shouldn't need to lookup - the file as it should alread know it -- make all appenders look similar and/or same?? -- save common data in variables in function, or do a 100% static solution? -- would be really good for performance if 100% static (no variables at all) - -levels -- how should it be determined which appenders to call for what level? -- write all appenders in a "appenders.d" dir, and then use hard/soft links to a - level dir (e.g. "debug.d", "info.d", etc)? - -!!! -- careful. using files as storage for the static appender generation, but the - file will be sourced in as a function so that something like funciton - pointers of C can be used :-) -- need templates for the various appenders... templating engine? ugh! -- what work will there be in using the current paradigm of being able to - "change" an appenders type? that will probably need to go away. -- still need a list of appenders for each logging level -- appenders do not need to be executed in same order for each logging level - (meaning a FileAppender might fire before a SyslogAppender at INFO level, but - the reverse might be true at DEBUG level). -- having each Level in it's own list will allow for firing of appenders at - single levels rather than at current and at all above levels (user request. - verify against log4j) -- when a pattern (or anything else such a file name) changes, the function - needs to be re-loaded and re-sourced. optimize if possible. - -# -# Implementation -# - -logger_addAppender FileAppender - - -$Revision$ diff --git a/1.5/doc/FAQ.txt b/1.5/doc/FAQ.txt deleted file mode 100644 index fc582be..0000000 --- a/1.5/doc/FAQ.txt +++ /dev/null @@ -1,48 +0,0 @@ -Q: Why are the variable names in log4sh so strange? There seems to be no rhyme -or reason to them. - -A: Not all shells support the variable scoping that one would expect. All -variables are treated as global variables, which means that if a variable has a -value outside a function call, and then a function call changes the value, the -original value is not returned upon exiting the function. To get around this, -each function must have different variable names so that when one function -calls another, variables are not overwritten. Where things get especially hairy -is when any sort of recursion is needed, and as such, recursion is avoided in -log4sh. The best example of the described behavior is the default Bourne shell -of Solaris. - - -Q: Why are the variables in log4sh not more "shell" like? In other words, why -are they so long? - -A: Two reasons really. The first reason is for readability. log4sh has been -developed over a long period of time (years), and when going back to the code -after any length of time, it is very easy to forget how or why things were done -the way they were. Long descriptive variable names make it much easier to -remember how and why. The second reason is, well, for readability. The hope is -that newbie shell developers (and experienced ones as well) will look at the -code and be able to learn and/or improve upon it. The faster and easier they -can understand the code, the better their understanding and improvements will -be. - - -Q: Why is there strange XML in the comments? There are almost more comments -than code! - -A: Along the same lines of having long variable names, it is for better -understanding. Maintaining spearate documentation for the functions available -in log4sh is difficult, and it tends to be out-of-date with respect to the -code. This way, everything is in one document and there is a much better chance -that the function documentation remains up-to-date. As to why XML is in there --- the documentation for log4sh is written in DocBook so that it is -standardized. The log4sh XML is not pure DocBook as it does not fit the need -well enough, but the log4sh XML is run through XSLT to generate pure DocBook -XML, and thereby it fits in nicely with the rest of the DocBook documentation. - -If you would prefer to see log4sh without the majority of XML comments, a -simple 'grep' might help you out. Try the following: - -$ grep -v '^#' log4sh - - -$Revision$ diff --git a/1.5/doc/LICENSE b/1.5/doc/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/1.5/doc/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/1.5/doc/style.css b/1.5/doc/style.css deleted file mode 100644 index d3b1628..0000000 --- a/1.5/doc/style.css +++ /dev/null @@ -1,40 +0,0 @@ -/* - style.css - a CSS stylesheet for use with HTML output produced by - tldp-xsl stylesheets. Written by David Horton. -*/ - - -body { - -/* - Style the HMTL tag with a sans-serif font and 6% margin. - A sans-serif font makes documents easier to read when displayed on - a computer screen. Whitespace surrounding the document should - make it easier to read both on screen and on printed paper. The - value of 6% was chosen because it closely approximates a one-half - inch margin on a US letter (8.5" by 11") paper. Since the margin - is expressed as a percentage it should scale well in a web browser - window. -*/ - - font-family: sans-serif; - margin: 6%; -} - - -.programlisting, .screen { - -/* - Style the programlisting and screen classes with a light gray - background and a small bit of space between the object border and - the text inside. The programlisting and screen classes are HTML - representations of the and DocBook tags. -*/ - - background: lightgray; - padding: 5px; -} - - -/* Add any desired customizations below. */ - diff --git a/1.5/examples/hello_world b/1.5/examples/hello_world deleted file mode 100755 index 833ee7b..0000000 --- a/1.5/examples/hello_world +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh -# $Id$ -# -# Author: Kate Ward -# - -# load log4sh -if [ -r log4sh ]; then - LOG4SH_CONFIGURATION='none' . ./log4sh -else - echo "ERROR: could not load (log4sh)" >&2 - exit 1 -fi - -# change the default message level from ERROR to INFO -logger_setLevel INFO - -# say hello to the world -logger_info "Hello, world!" diff --git a/1.5/examples/log4sh.properties.ex1 b/1.5/examples/log4sh.properties.ex1 deleted file mode 100644 index e489cf2..0000000 --- a/1.5/examples/log4sh.properties.ex1 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to INFO and its only appender to A1 -log4sh.rootLogger = INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1 = ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout = PatternLayout -log4sh.appender.A1.layout.ConversionPattern = %-4r [%t] %-5p %c %x - %m%n diff --git a/1.5/examples/log4sh.properties.ex2 b/1.5/examples/log4sh.properties.ex2 deleted file mode 100644 index 77795df..0000000 --- a/1.5/examples/log4sh.properties.ex2 +++ /dev/null @@ -1,9 +0,0 @@ -# Set root logger level to INFO and its only appender to A1 -log4sh.rootLogger = INFO, A1 - -# A1 is set to be a ConsoleAppender. -log4sh.appender.A1 = ConsoleAppender - -# A1 uses PatternLayout. -log4sh.appender.A1.layout = PatternLayout -log4sh.appender.A1.layout.ConversionPattern = %d [%F:%t] %p %c - %m%n diff --git a/1.5/examples/log4sh.properties.ex3 b/1.5/examples/log4sh.properties.ex3 deleted file mode 100644 index b8a18b7..0000000 --- a/1.5/examples/log4sh.properties.ex3 +++ /dev/null @@ -1,30 +0,0 @@ -# configure the alternative commands that log4sh uses -#log4sh.alternative.awk = /usr/bin/awk -#log4sh.alternative.logger = /usr/bin/logger -log4sh.alternative.mail = /home/kward/usr/bin/mail -#log4sh.alternative.sed = /usr/bin/sed - -# set root logger to ERROR, and give it two appenders; stderr and R -log4sh.rootLogger = ERROR, stderr, R, S - -# set the stderr appender to STDERR with the default pattern -log4sh.appender.stderr = FileAppender -log4sh.appender.stderr.File = STDERR -log4sh.appender.stderr.layout = PatternLayout - -# setup the R appender as a file appender at the INFO level with a pattern -log4sh.appender.R = RollingFileAppender -log4sh.appender.R.Threshold = INFO -log4sh.appender.R.File = example.log -log4sh.appender.R.MaxFileSize = 100KB -log4sh.appender.R.MaxBackupIndex = 1 -log4sh.appender.R.layout = PatternLayout -# print the date in ISO 8601 format -log4sh.appender.R.layout.ConversionPattern = %d [%t] %-5p %c - %m%n - -# setup the S appender as a SyslogAppender at the INFO level -log4sh.appender.S = SyslogAppender -log4sh.appender.S.Threshold = DEBUG -log4sh.appender.S.Facility = local4 -log4sh.appender.S.layout = PatternLayout -log4sh.appender.S.layout.ConversionPattern = %d [%t] %-5p %c - %m%n diff --git a/1.5/Makefile b/Makefile similarity index 100% rename from 1.5/Makefile rename to Makefile diff --git a/1.5/README.md b/README-1.5.md similarity index 100% rename from 1.5/README.md rename to README-1.5.md diff --git a/1.5/bin/docbookPrep.sh b/bin/docbookPrep.sh similarity index 100% rename from 1.5/bin/docbookPrep.sh rename to bin/docbookPrep.sh diff --git a/1.3/bin/extractDocs.pl b/bin/extractDocs.pl similarity index 100% rename from 1.3/bin/extractDocs.pl rename to bin/extractDocs.pl diff --git a/1.5/bin/gen_test_results.sh b/bin/gen_test_results.sh similarity index 100% rename from 1.5/bin/gen_test_results.sh rename to bin/gen_test_results.sh diff --git a/1.5/bin/which b/bin/which similarity index 100% rename from 1.5/bin/which rename to bin/which diff --git a/1.5/src/build.sh b/build.sh similarity index 100% rename from 1.5/src/build.sh rename to build.sh diff --git a/1.3/doc/BUILD.txt b/doc/BUILD.txt similarity index 100% rename from 1.3/doc/BUILD.txt rename to doc/BUILD.txt diff --git a/1.5/doc/CHANGES-1.5.md b/doc/CHANGES-1.5.md similarity index 100% rename from 1.5/doc/CHANGES-1.5.md rename to doc/CHANGES-1.5.md diff --git a/1.3/doc/DesignDoc-1.3.txt b/doc/DesignDoc-1.3.txt similarity index 100% rename from 1.3/doc/DesignDoc-1.3.txt rename to doc/DesignDoc-1.3.txt diff --git a/1.5/doc/DesignDoc-1.5.txt b/doc/DesignDoc-1.5.txt similarity index 100% rename from 1.5/doc/DesignDoc-1.5.txt rename to doc/DesignDoc-1.5.txt diff --git a/1.3/doc/FAQ.txt b/doc/FAQ.txt similarity index 100% rename from 1.3/doc/FAQ.txt rename to doc/FAQ.txt diff --git a/1.5/doc/RELEASE.md b/doc/RELEASE.md similarity index 100% rename from 1.5/doc/RELEASE.md rename to doc/RELEASE.md diff --git a/1.5/doc/RELEASE_NOTES-1.5.0.rst b/doc/RELEASE_NOTES-1.5.0.rst similarity index 100% rename from 1.5/doc/RELEASE_NOTES-1.5.0.rst rename to doc/RELEASE_NOTES-1.5.0.rst diff --git a/1.5/doc/TODO.txt b/doc/TODO.txt similarity index 100% rename from 1.5/doc/TODO.txt rename to doc/TODO.txt diff --git a/1.5/doc/coding_standards.txt b/doc/coding_standards.txt similarity index 100% rename from 1.5/doc/coding_standards.txt rename to doc/coding_standards.txt diff --git a/1.5/doc/contributors.txt b/doc/contributors.txt similarity index 100% rename from 1.5/doc/contributors.txt rename to doc/contributors.txt diff --git a/1.5/doc/log4sh.md b/doc/log4sh.md similarity index 100% rename from 1.5/doc/log4sh.md rename to doc/log4sh.md diff --git a/1.2/doc/style.css b/doc/style.css similarity index 100% rename from 1.2/doc/style.css rename to doc/style.css diff --git a/1.3/src/examples/hello_world b/examples/hello_world similarity index 100% rename from 1.3/src/examples/hello_world rename to examples/hello_world diff --git a/1.3/src/examples/log4sh.properties.ex1 b/examples/log4sh.properties.ex1 similarity index 100% rename from 1.3/src/examples/log4sh.properties.ex1 rename to examples/log4sh.properties.ex1 diff --git a/1.3/src/examples/log4sh.properties.ex2 b/examples/log4sh.properties.ex2 similarity index 100% rename from 1.3/src/examples/log4sh.properties.ex2 rename to examples/log4sh.properties.ex2 diff --git a/1.4/src/examples/log4sh.properties.ex3 b/examples/log4sh.properties.ex3 similarity index 100% rename from 1.4/src/examples/log4sh.properties.ex3 rename to examples/log4sh.properties.ex3 diff --git a/1.5/lib/shlib_relToAbsPath b/lib/shlib_relToAbsPath similarity index 100% rename from 1.5/lib/shlib_relToAbsPath rename to lib/shlib_relToAbsPath diff --git a/1.5/lib/shunit2 b/lib/shunit2 similarity index 100% rename from 1.5/lib/shunit2 rename to lib/shunit2 diff --git a/1.5/lib/versions b/lib/versions similarity index 100% rename from 1.5/lib/versions rename to lib/versions diff --git a/1.5/src/log4sh b/log4sh similarity index 100% rename from 1.5/src/log4sh rename to log4sh diff --git a/1.5/src/log4sh_ConsoleAppender b/log4sh_ConsoleAppender similarity index 100% rename from 1.5/src/log4sh_ConsoleAppender rename to log4sh_ConsoleAppender diff --git a/1.5/src/log4sh_ConsoleAppender_test.sh b/log4sh_ConsoleAppender_test.sh similarity index 100% rename from 1.5/src/log4sh_ConsoleAppender_test.sh rename to log4sh_ConsoleAppender_test.sh diff --git a/1.5/src/log4sh_base b/log4sh_base similarity index 100% rename from 1.5/src/log4sh_base rename to log4sh_base diff --git a/1.5/src/log4sh_base_test.sh b/log4sh_base_test.sh similarity index 100% rename from 1.5/src/log4sh_base_test.sh rename to log4sh_base_test.sh diff --git a/1.5/src/log4sh_test.sh b/log4sh_test.sh similarity index 100% rename from 1.5/src/log4sh_test.sh rename to log4sh_test.sh diff --git a/1.5/src/log4sh_test_ascii_charset.sh b/log4sh_test_ascii_charset.sh similarity index 100% rename from 1.5/src/log4sh_test_ascii_charset.sh rename to log4sh_test_ascii_charset.sh diff --git a/1.5/src/log4sh_test_base.sh b/log4sh_test_base.sh similarity index 100% rename from 1.5/src/log4sh_test_base.sh rename to log4sh_test_base.sh diff --git a/1.5/src/log4sh_test_custom_mdc_patterns.sh b/log4sh_test_custom_mdc_patterns.sh similarity index 100% rename from 1.5/src/log4sh_test_custom_mdc_patterns.sh rename to log4sh_test_custom_mdc_patterns.sh diff --git a/1.5/src/log4sh_test_file_appender.sh b/log4sh_test_file_appender.sh similarity index 100% rename from 1.5/src/log4sh_test_file_appender.sh rename to log4sh_test_file_appender.sh diff --git a/1.5/src/log4sh_test_helpers b/log4sh_test_helpers similarity index 100% rename from 1.5/src/log4sh_test_helpers rename to log4sh_test_helpers diff --git a/1.5/src/log4sh_test_log4j_compatibility.sh b/log4sh_test_log4j_compatibility.sh similarity index 100% rename from 1.5/src/log4sh_test_log4j_compatibility.sh rename to log4sh_test_log4j_compatibility.sh diff --git a/1.5/src/log4sh_test_multiple_appenders.sh b/log4sh_test_multiple_appenders.sh similarity index 100% rename from 1.5/src/log4sh_test_multiple_appenders.sh rename to log4sh_test_multiple_appenders.sh diff --git a/1.5/src/log4sh_test_pattern_layout.sh b/log4sh_test_pattern_layout.sh similarity index 100% rename from 1.5/src/log4sh_test_pattern_layout.sh rename to log4sh_test_pattern_layout.sh diff --git a/1.5/src/log4sh_test_priority.sh b/log4sh_test_priority.sh similarity index 100% rename from 1.5/src/log4sh_test_priority.sh rename to log4sh_test_priority.sh diff --git a/1.5/src/log4sh_test_property_config.sh b/log4sh_test_property_config.sh similarity index 100% rename from 1.5/src/log4sh_test_property_config.sh rename to log4sh_test_property_config.sh diff --git a/1.5/src/log4sh_test_rolling_file_appender.sh b/log4sh_test_rolling_file_appender.sh similarity index 100% rename from 1.5/src/log4sh_test_rolling_file_appender.sh rename to log4sh_test_rolling_file_appender.sh diff --git a/1.5/src/log4sh_test_smtp_appender.sh b/log4sh_test_smtp_appender.sh similarity index 100% rename from 1.5/src/log4sh_test_smtp_appender.sh rename to log4sh_test_smtp_appender.sh diff --git a/1.5/src/log4sh_test_syslog_appender.sh b/log4sh_test_syslog_appender.sh similarity index 100% rename from 1.5/src/log4sh_test_syslog_appender.sh rename to log4sh_test_syslog_appender.sh diff --git a/website/releases/log4sh-1.5.0.tgz.md5 b/releases/log4sh-1.5.0.tgz.md5 similarity index 100% rename from website/releases/log4sh-1.5.0.tgz.md5 rename to releases/log4sh-1.5.0.tgz.md5 diff --git a/website/releases/log4sh-1.5.0.tgz.sig b/releases/log4sh-1.5.0.tgz.sig similarity index 100% rename from website/releases/log4sh-1.5.0.tgz.sig rename to releases/log4sh-1.5.0.tgz.sig diff --git a/1.5/src/testdata/ascii_charset.log4sh b/testdata/ascii_charset.log4sh similarity index 100% rename from 1.5/src/testdata/ascii_charset.log4sh rename to testdata/ascii_charset.log4sh diff --git a/1.5/src/testdata/file_appender_accessors.log4sh b/testdata/file_appender_accessors.log4sh similarity index 100% rename from 1.5/src/testdata/file_appender_accessors.log4sh rename to testdata/file_appender_accessors.log4sh diff --git a/1.5/src/testdata/file_appender_simple.log4sh b/testdata/file_appender_simple.log4sh similarity index 100% rename from 1.5/src/testdata/file_appender_simple.log4sh rename to testdata/file_appender_simple.log4sh diff --git a/1.5/src/testdata/file_appender_stderr.log4sh b/testdata/file_appender_stderr.log4sh similarity index 100% rename from 1.5/src/testdata/file_appender_stderr.log4sh rename to testdata/file_appender_stderr.log4sh diff --git a/1.5/src/testdata/priority_matrix.dat b/testdata/priority_matrix.dat similarity index 100% rename from 1.5/src/testdata/priority_matrix.dat rename to testdata/priority_matrix.dat diff --git a/1.5/src/testdata/rolling_file_appender.log4sh b/testdata/rolling_file_appender.log4sh similarity index 100% rename from 1.5/src/testdata/rolling_file_appender.log4sh rename to testdata/rolling_file_appender.log4sh diff --git a/1.5/src/testdata/smtp_appender.log4sh b/testdata/smtp_appender.log4sh similarity index 100% rename from 1.5/src/testdata/smtp_appender.log4sh rename to testdata/smtp_appender.log4sh diff --git a/1.5/src/testdata/syslog_appender.dat b/testdata/syslog_appender.dat similarity index 100% rename from 1.5/src/testdata/syslog_appender.dat rename to testdata/syslog_appender.dat diff --git a/website/index.html b/website/index.html deleted file mode 100644 index 4e22227..0000000 --- a/website/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - -

Redirecting you to the log4sh site.

- - - - - - - - - diff --git a/website/index.php.old b/website/index.php.old deleted file mode 100644 index 6fddee4..0000000 --- a/website/index.php.old +++ /dev/null @@ -1 +0,0 @@ - diff --git a/website/log4sh-1.2.html b/website/log4sh-1.2.html deleted file mode 100644 index 1982b0c..0000000 --- a/website/log4sh-1.2.html +++ /dev/null @@ -1,82 +0,0 @@ -log4sh

log4sh

Kate Ward

2005-08-30

Revision History
Revision 1.2.72005-08-30kwd
added the new get/push/pop thread name commands
Revision 1.2.62005-02-01kwd
improved examples where log4sh is searched for and sourced in
Revision 1.2.42004-12-28kwd
initial DocBook conversion

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundataion (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as this happens to be the primary platform used by myself.

Tested Operating Systems

  • Linux

  • Solaris 8, 9, 10

Tested Shells

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

1.1. Credits / Contributors

In this document, I have the pleasure of acknowledging:

  • Nobody in particular

1.2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

2. Quickstart

To get started quickly with log4sh, take a look at the test-log4sh sample script in the src/test directory of the distribution. You will need to copy the log4sh script itself from the src/shell directory into the test directory before running the test. This test script is designed to configure log4sh via code. Later on, we will configure log4sh with a properties file, very similar to how log4j is configured.

By default, log4sh is configured with a ConsoleAppender which logs to STDOUT using a SimpleLayout and a logging level of ERROR. If no configuration file is found, a warning message will be given letting the user know that no configuration file was found. This warning can be supressed by setting the LOG4SH_CONFIGURATION environment variable to none.

Run the first test.

Example 1. Test #1

-$ ./test-log4sh
-

After a first run you will see quite a bit of output to the display, and as well two log files will be created (log4sh-pattern.log and log4sh-simple.log). The display contains a mix of output to STDOUT and STDERR, and the files contain various versions of the same data, but with output that changes as various layouts and patterns are tested. To clean up the display a bit, you could send all of the output of the STDERR appender off to /dev/null.

Run the test again, but redirecting STDERR to /dev/null.

Example 2. Test #2

-$ ./test-log4sh 2>/dev/null
-

Go ahead a take a look at the test script to get a feel of what the script is trying to accomplish. Hopefully, you can see just how simple log4sh is to use and control.

For our next test, we will configure log4sh with a properties file. This test is incredibly simple as it is designed to show the power of the properties file. Copy first example properties file log4sh.properties.ex1 from the src/examples directory into the test directory, and give it the name log4sh.properties.

Run the second test.

Example 3. Test #3

-$ ./test-properties
-

This test is designed to look very much like one of the log4j examples. The properties file is taken almost verbatum from the log4j short manual, with only small changes required to make it work for log4sh. Log4sh is configured with a ConsoleAppender that has a PatternLayout. One limitation of log4sh is that it does not have access to a timer with millisecond accuracy, so it logs only with an accuracy of one second. For most situations, this should be sufficient.

Copy the second example properties file (log4sh.properties.ex2) as log4sh.properties, and rerun the test. This second properties file is only slightly different from the first in that it adds the filename to the output, and removes the %x pattern directive as that directive is not supported by log4sh.

The next example shows a typical situation where an administrator wants to run a script via a cron job, wants a log of the scripts actions, but only wants an email if the job failed.

Copy the third example properies file (log4sh.properties.ex3) over, and rerun the test. This time, the output will be sent to two separate locations; STDERR and a file called example.log. The output to STDERR is set to the ERROR level, and output sent to the file is at the INFO level. More output is written to the logfile (as expected) when the test is run.

In the situation of being run from a cron job, the logfile will always be written, but an email comes only when output from the script came at the ERROR or FATAL level. An administrator can even configure the log4sh.properties file to a DEBUG level so that more output is logged for testing or debugging purposes, and this change can happen without making any code changes to the script. Something very useful in a production environment!

3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code

  3. configure log4sh in code (optional)

  4. call logging statements

-

3.1. Preconfigure log4sh

To preconfigure log4sh, create a properties file (see the Properties File Configuration later in this document). Optionally set the LOG4SH_CONFIGURATION environment variable to point log4sh to the configuration file.

3.2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 4. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 5. Hello, world (using properties)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 6. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to DEBUG and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%r [%t] %p %c %x - %m%n
-

3.3. Configure log4sh in code

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 7. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# source log4sh (disabling properties file warning)
-LOG4SH_CONFIGURATION="none" . ./log4sh
-
-# configure log4sh defaults
-logger_setLevel INFO
-
-# configure appenders
-appender_setAppend stdout false
-logger_addAppender stderr
-appender_setAppenderType stderr FileAppender
-appender_setAppenderFile stderr STDERR
-
-# say Hello to the world
-logger_info "Hello, world"
-

3.4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

4. Properties File Configuration

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 8. Recommended minimum log4sh.properties file

-log4sh.rootLogger=INFO, stdout
-log4sh.appender.stdout=ConsoleAppender
-

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

4.1. Root Logger

(future)

4.2. Levels

Table 1. Logging Levels (from most output to least)

LevelDefinition
ALLThe ALL level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

4.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 9. Sample appender names

myAppender - good

4.3.1. Types

An appender can be set to one of several different types.

Example 10. Setting an appender type

-  log4sh.appender.A1=FileAppender
-  

Table 2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial
RollingFileAppenderoutput sent to a file that rolls over by sizepartial

4.3.2. Options

An appender can take several different options.

Example 11. Setting an appender option

-  log4sh.appender.A1.File=output.log
-  

Table 3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

4.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 12. Setting an appender's layout

-  log4sh.appender.A1.layout=PatternLayout
-  

Table 4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 13. Setting an appender's layout pattern

-  log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-  

Table 5. Pattern Options

OptionDefinitionSupported?
%ccurrent class (not applicable in shell; always returns 'shell')yes
%dcurrent date (see *NIX date man page; '%Y-%m-%d %H:%M:%S')yes
%Fcurrent script filename (default: `basename $0`)yes
%Lcurrent line number in scriptno (ignored)
%mlogging messageyes
%nOS specific line endingno (ignored)
%plogging level (aka priority)yes
%rnumber of seconds since script was startedpartial (bash)
%tcurrent executing thread (default: 'main'; code changable)yes
%xunknownno (ignored)

5. Function Reference

5.1. Root Logger

Table 6. Configuring the root logger

FunctionDefinitionExample
logger_addAppenderadd an appenderlogger_addAppender stdout
logger_addAppenderWithPatternshortcut for adding an appender with a specific pattern layoutlogger_addAppenderWithLayout myPattern '%d [%p] %m'
logger_setFilenameset the script filename for the %F pattern optionlogger_setFilename "myFilename"
logger_getLevelget the current root logger priority levellevel=`logger_getLevel`
logger_setLevelset the root logger priority levellogger_setLevel INFO
logger_getThreadNameget the current thread namethread=`logger_getThreadName`
logger_setThreadNameset the current thread name for the %t pattern optionlogger_setThreadName "myThread"
logger_pushThreadNamepush the current thread name to the thread name stack, and set a new thread namelogger_pushThreadName "myNewThread"
logger_popThreadNamepop the current thread name from the stack, and discard itlogger_popThreadName

5.2. Appenders

Table 7. Configuring appenders

FunctionDefinitionExample
appender_closeclose an appenderappender_close myAppender
appender_setAppenderFileset the output filename for the named appenderappender_setAppenderFile myAppender "output.log"
appender_setAppenderTypeset the type of appender for the named appenderappender_setAppenderType myAppender FileAppender
appender_getLayoutget an appender's layout typelayout=`appender_getLayout myAppender`
appender_setLayoutset the layout type for the named appenderappender_setLayout myAppender PatternLayout
appender_getLevelget an appender's logging prioritylevel=`appender_getLevel myAppender`
appender_setLevelset the logging priority for the named appenderappender_setLevel myAppender DEBUG
appender_setPatternset the output pattern for named appender (appender must be set to a PatternLayout)appender_setPattern myAppender '%d %p - %m%n'

5.3. Logging

Table 8. Logging statements

FunctionDefinitionExample
loglog a message at a specific levellog DEBUG "Hello, world"
logger_debuglog a message at the DEBUG levellogger_debug "This is a test"
logger_infolog a message at the INFO levellogger_info "Did you get it?"
logger_errorlog a message at the ERROR levellogger_error "I sure hope you did"
logger_warnlog a message at the WARN levellogger_warn "If not, you might be in trouble"
logger_fatallog a message at the FATAL levellogger_fatal "The end of the world is here!!!"

6. Miscellaneous Info

Log4sh has been completly developed from scratch by myself, Kate Ward. I use it in production environments where logging from shell scripts is critical, and where I need more than just a simple "Hello, I worked" type of logging message. If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at . If there is enough interest in the project, I will develop it further.

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this site and all provided source code are owned by Kate Ward.

\ No newline at end of file diff --git a/website/log4sh-1.3.html b/website/log4sh-1.3.html deleted file mode 100644 index 5762582..0000000 --- a/website/log4sh-1.3.html +++ /dev/null @@ -1,771 +0,0 @@ -log4sh

log4sh version 1.3.7

Kate Ward


-            
-          

2007-01-01

Revision History
Revision 1.3.72006-12-28kwd
Revision 1.3.62006-09-16kwd
Revision 1.3.52006-08-19kwd
Revision 1.3.42006-03-25kwd
Revision 1.3.32006-02-11kwd
Revision 1.3.22006-01-18kwd
Revision 1.3.02005-08-15kwd
Revision 1.2.62005-02-01kwd
Revision 1.2.42004-12-28kwd

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


Chapter 1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used.

Tested Operating Systems

  • Cygwin

  • Linux

  • Solaris 8+

Verified Shells

  • BSD Shell (dash)

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

  • Korn Shell (ksh)

  • Public Domain Korn Shell (pdksh) -- partial functionality

See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested.

1. Credits / Contributors

A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool.

2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

Chapter 2. Quickstart

First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests.

Prepare your environment.

-$ make test-prep
-$ cd test
-

Example 2.1. Hello, World!

Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts.

Run the Hello World test.

-$ ./hello_world
-1 [main] INFO shell  - Hello, world!
-

You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not!

The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from ERROR to INFO, and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh.


Example 2.2. Properties Configuration Test

In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code.

Run the properties configuration test.

-$ ./test-prop-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code.


Example 2.3. Runtime Configuration Test

This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime.

Run the runtime configuration test.

-$ ./test-runtime-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed.


Chapter 3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code into the shell script

  3. configure log4sh in code (optional)

  4. call logging statements

-

1. Preconfigure log4sh (optional)

To preconfigure log4sh, create a properties file (see the Properties File later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the Configure log4sh in code section later in this chapter.

2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 3.1. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 3.2. Hello, world (using properties file)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 3.3. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to INFO and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

3. Configure log4sh in code

If log4sh was not preconfigured, the default configuration will be equivalent the config shown below.

Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'.

-log4sh.rootLogger=ERROR, stdout
-log4sh.appender.stdout=ConsoleAppender
-log4sh.appender.stdout.layout=PatternLayout
-log4sh.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 3.4. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set the global logging level to INFO
-logger_setLevel INFO
-
-# add and configure a FileAppender that outputs to STDERR, and activate the
-# configuration
-logger_addAppender stderr
-appender_setType stderr FileAppender
-appender_file_setFile stderr STDERR
-appender_activateOptions stderr
-
-# say Hello to the world
-logger_info 'Hello, world'
-

4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter.

Example 3.5. Standard method of logging a message

logger_info 'message to log'

There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info).

Example 3.6. Alternate method of logging a message

echo 'message to log' |logger_info

Chapter 4. Configuration

1. Properties File

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 4.1. Recommended minimum log4sh.properties file

-  log4sh.rootLogger=INFO, stdout
-  log4sh.appender.stdout=ConsoleAppender
-  

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

1.1. Root Logger

(future)

1.2. Levels

Table 4.1. Logging Levels (from most output to least)

LevelDefinition
TRACEThe TRACE level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

1.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 4.2. Sample appender names

myAppender - good


1.3.1. Types

An appender can be set to one of several different types.

Example 4.3. Setting an appender type

-    log4sh.appender.A1=FileAppender
-    

Table 4.2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial; logs written, but not rotated
RollingFileAppenderoutput sent to a file that rolls over by sizepartial; works, but nees improvement
SMTPAppenderoutput sent via emailparital; works, but needs improvement
SyslogAppenderoutput sent to a remote syslog daemonpartial; only localhost supported

1.3.2. Options

An appender can take several different options.

Example 4.4. Setting an appender option

-    log4sh.appender.A1.File=output.log
-    

Table 4.3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

1.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 4.5. Setting an appender's layout

-    log4sh.appender.A1.layout=PatternLayout
-    

Table 4.4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 4.6. Setting an appender's layout pattern

-    log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-    

Table 4.5. Pattern Options

OptionDefinitionSupported?
cUsed to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'.partial (fixed)
d -

Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, %d{HH:mm:ss,SSS}, or %d{ISODATE}. The specifier is allowed only for compatibility with log4j properties files.

-

The default format of the date returned is equavilant to the output of the Unix date command with a format of +%Y-%m-%d %H:%M:%S.

-
yes
F -

Used to output the file name where the logging request was issued.

-

The default value is equavilent basename $0.

-
yes
LThis option is for compatibility with log4j properties files.no (ignored)
mUsed to output the script supplied message associated with the logging event.yes
nThis option is for compatibility with log4j properties files.no (ignored)
pUsed to output the priority of the logging event.yes
rUsed to output the number of seconds elapsed since the start of the script until the creation of the logging event.yes
t -

Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i

-

The default value is 'main'.

-
yes
xThis option is for compatibility with log4j properties files.no (ignored)
XUsed to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The X conversion character must be followed by an environment variable name placed between braces, as in %X{clientNumber} where clientNumber is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output.no (ignored)
%The sequence %% outputs a single percent sign.yes

2. Environment Variables

There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh.

Here is the full list of supported variables.

Table 4.6. log4sh environment variables

VariableUsage
LOG4SH_CONFIGURATION -

This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration.

-

Example 4.7. LOG4SH_CONFIGURATION variable

LOG4SH_CONFIGURATION='/path/to/log4j.properties'

-
LOG4SH_CONFIG_PREFIX -

This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read.

-

Example 4.8. LOG4SH_CONFIG_PREFIX variable

LOG4SH_CONFIG_PREFIX='log4j'

-

Chapter 5. Advanced Usage

This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood.

1. Environment Variables

There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below.

Table 5.1. log4sh Environment Variables

VariableDefaultDescription
LOG4SH_ALTERNATIVE_NCnoneProvide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc
LOG4SH_CONFIGURATIONnoneProvide log4sh with the absolute path to the log4sh properties file.
LOG4SH_CONFIG_PREFIXlog4shDefine the expected prefix to use for parsing the properties file -- e.g. log4j
LOG4SH_DEBUGnoneEnable internal log4sh debug output. Set to any non-empty value.
LOG4SH_DEBUG_FILEnoneDefine a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log
LOG4SH_INFOnoneEnable internal log4sh info output. Set to any non-empty value.
LOG4SH_TRACEnoneEnable internal log4sh trace output. Set to any non-empty value.

2. Remote Syslog Logging

Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts.

Choice #1 -- reconfigure the syslogd daemon

One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required.

Choice #2 -- install nc (netcat) command -- recommended

The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect.

The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging.

Example 5.1. Sample log4sh properties file demonstrating remote syslog logging

-#
-# log4sh example: remote syslog logging
-#
-
-# Set the 'nc' alternative command to enable remote syslog logging
-log4sh.alternative.nc = /bin/nc
-
- Set root logger level to INFO and its only appender to mySyslog
-log4sh.rootLogger=INFO, mySyslog
-
-# mySyslog is set to be a SyslogAppender.
-log4sh.appender.mySyslog = SyslogAppender
-log4sh.appender.mySyslog.SyslogHost = somehost
-

Example 5.2. Sample shell script demonstrating remote syslog logging

-#! /bin/sh
-#
-# log4sh example: remote syslog logging
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set alternative 'nc' command
-log4sh_setAlternative nc /bin/nc
-
-# add and configure a SyslogAppender that logs to a remote host
-logger_addAppender mySyslog
-appender_setType mySyslog SyslogAppender
-appender_syslog_setFacility mySyslog local4
-appender_syslog_setHost mySyslog somehost
-appender_activateOptions mySyslog
-
-# say Hello to the world
-logger_info 'Hello, world'
-

3. Automated File Rolling

Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your FileAppender into a RollingFileAppender, you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept.

To limit the maximum size of your log files, you need to set the MaxFileSize appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not.

The default maximum file size is equavilent to 1MiB

Table 5.2. Acceptable file size units

UnitSize in bytesEquivalent sizes
B (bytes)11B
KB1,0001KB = 1000B
KiB (kilobytes)1,0241KiB = 1024B
MB1,000,0001MB = 1000KB = 1000000B
MiB (megabytes)1,048,5761MiB = 1024KiB = 1048576B
GB1,000,000,0001GB = 1000MB = 1000000KB = 1000000000B
GiB (gigabytes)1,073,741,8241GiB = 1024MiB = 1048576KiB = 1073741824B
TB1,000,000,000,0001TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B
TiB (terabytes)1,099,511,627,7761TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B

Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j.

To limit the maximum number of backup files kept, you need to set the MaxBackupIndex appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept.

The default maximum backup index is equavilent to '1 MiB'

Example 5.3. Sample log4sh properties file demonstrating a RollingFileAppender

-#
-# log4sh example: using the RollingFileAppender
-#
-
- Set root logger level to INFO and its only appender to R
-log4sh.rootLogger=INFO, R
-
-# add a RollingFileAppender named R
-log4sh.appender.R = RollingFileAppender
-log4sh.appender.R.File = /path/to/some/file
-log4sh.appender.R.MaxFileSize = 10KB
-log4sh.appender.R.MaxBackupIndex = 1
-

Example 5.4. Sample shell script demonstrating a RollingFileAppender

-#! /bin/sh
-#
-# log4sh example: using the RollingFileAppender
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# add and configure a RollingFileAppender named R
-logger_addAppender R
-appender_setType R RollingFileAppender
-appender_file_setFile R '/path/to/some/file'
-appender_file_setMaxFileSize R 10KB
-appender_file_setMaxBackupIndex R 1
-appender_activateOptions R
-
-# say Hello to the world
-logger_info 'Hello, world'
-

Chapter 6. Function Reference

1. Appender

Table 6.1. Appender

- void - -
- appender_activateOptions - (appender); 
string  appender;
-

- Activate an appender's configuration. This should be called after - reconfiguring an appender via code. It needs only to be called once - before any logging statements are called. This calling of this function - will be required in log4sh 1.4.x. -

-
appender_activateAppender myAppender
-
- void - -
- appender_close - (appender); 
string  appender;
-

Disable any further logging via an appender. Once closed, the - appender can be reopened by setting it to any logging Level (e.g. - INFO).

-
appender_close myAppender
-
- boolean - -
- appender_exists - (appender); 
string  appender;
-

Checks for the existance of a named appender

-
exists=`appender_exists myAppender`
-
- string - -
- appender_getAppenderType - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Gets the Type of an Appender at the given array index -

-
type=`appender_getAppenderType 3`
-
- string - -
- appender_getLayout - (appender); 
string  appender;
-

Gets the Layout of an Appender

-
type=`appender_getLayout myAppender`
-
- string - -
- appender_getLevel - (appender); 
string  appender;
-

Gets the current logging Level of an Appender

-
type=`appender_getLevel myAppender`
-
- string - -
- appender_getPattern - (appender); 
string  appender;
-

Gets the Pattern of an Appender

-
pattern=`appender_getPattern myAppender`
-
- string - -
- appender_getType - (appender); 
string  appender;
-

Gets the Type of an Appender

-
type=`appender_getType myAppender`
-
- void - -
- appender_setAppenderType - (appender,  
 type); 
string  appender;
string  type;
-

- Deprecated as of 1.3.1 -

-

- Sets the Type of an Appender (e.g. FileAppender) -

-
appender_setAppenderType myAppender FileAppender
-
- void - -
- appender_setLayout - (appender,  
 layout); 
string  appender;
string  layout;
-

Sets the Layout of an Appender (e.g. PatternLayout)

-
appender_setLayout myAppender PatternLayout
-
void/boolean -
- appender_setLevel - (appender,  
 level); 
string  appender;
string  level;
-

Sets the Level of an Appender (e.g. INFO)

-
appender_setLevel myAppender INFO
-
void/boolean -
- appender_setPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

Sets the Pattern of an Appender

-
appender_setPattern myAppender '%d %p - %m%n'
-
void/boolean -
- appender_setType - (appender,  
 type); 
string  appender;
string  type;
-

Sets the Type of an Appender (e.g. FileAppender)

-
appender_setType myAppender FileAppender
-

2. FileAppender

Table 6.2. FileAppender

- string - -
- appender_file_getFile - (appender); 
string  appender;
-

Get the filename of a FileAppender

-
appender_file_getFile myAppender
-
integer/boolean - -
- appender_file_getMaxBackupIndex - (appender); 
string  appender;
-

- Returns the value of the MaxBackupIndex option. -

-

Since: 1.3.7

-
appender_file_getMaxBackupIndex myAppender
-
integer/boolean - -
- appender_file_getMaxFileSize - (appender); 
string  appender;
-

- Get the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

Since: 1.3.7

-
maxSize=`appender_file_getMaxBackupSize myAppender`
-
- void - -
- appender_file_setFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Set the filename for a FileAppender (e.g. STDERR or - /var/log/log4sh.log). -

-
appender_file_setFile myAppender STDERR
-
- void - -
- appender_file_setMaxBackupIndex - (appender,  
 index); 
string  appender;
integer  index;
-

Set the maximum number of backup files to keep around.

-

- The MaxBackupIndex option determines - how many backup files are kept before the oldest is erased. This option - takes a positive integer value. If set to zero, then there will be no - backup files and the log file will be truncated when it reaches - MaxFileSize. -

-

Since: 1.3.7

-
appender_file_setMaxBackupIndex myAppender 3
-
void/boolean - -
- appender_file_setMaxFileSize - (appender,  
 size); 
string  appender;
string  size;
-

- Set the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

- In configuration files, the MaxFileSize option takes an - long integer in the range 0 - 2^40. You can specify the value with the - suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. For example, - the value "10KiB" will be interpreted as 10240. -

-

Since: 1.3.7

-
appender_file_setMaxBackupSize myAppender 10KiB
-
- void - -
- appender_setAppenderFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Deprecated as of 1.3.2 -

-

- Set the filename for a FileAppender (e.g. "STDERR" or - "/var/log/log4sh.log") -

-
appender_setAppenderFile myAppender STDERR
-

3. Level

Table 6.3. Level

- integer - -
- logger_level_toInt - (level); 
string  level;
-

Converts an externally used level tag into its integer - equivalent

-
levelInt=`logger_level_toInt WARN`
-
- string - -
- logger_level_toLevel - (val); 
integer  val;
-

Converts an internally used level integer into its external level - equivalent

-
level=`logger_level_toLevel 3`
-

4. Log4sh

Table 6.4. Log4sh

void/boolean - -
- log4sh_enableStrictBehavior - (); 
-

- Enables strict log4j behavior. -

-

Since: 1.3.7

-
log4sh_enableStrictBehavior
-
void/boolean - -
- log4sh_setAlternative - (command,  
 path); 
string  command;
string  path;
-

- Specifies an alternative path for a command. -

-

Since: 1.3.7

-
log4sh_setAlternative nc /bin/nc
-

5. Logger

Table 6.5. Logger

- void - -
- log - (level,  
 message(s)); 
string  level;
string[]  message(s);
-

The base logging command that logs a message to all defined - appenders

-
log DEBUG 'This is a test message'
-
void/boolean -
- logger_addAppender - (appender); 
string  appender;
-

Add and initialize a new appender

-
logger_addAppender $appender
-
- void - -
- logger_addAppenderWithPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

- Deprecated as of 1.3.6 -

-

- Add and initialize a new appender with a specific PatternLayout -

-
logger_addAppenderWithPattern $appender '%d %p - %m%n'
-
- void - -
- logger_debug - (message); 
string[]  message;
-

This is a helper function for logging a message at the DEBUG - priority

-
logger_debug 'This is a debug message'
-
- void - -
- logger_error - (message); 
string[]  message;
-

- This is a helper function for logging a message at the ERROR priority -

-
logger_error 'This is a error message'
-
- void - -
- logger_fatal - (message); 
string[]  message;
-

This is a helper function for logging a message at the FATAL - priority

-
logger_fatal 'This is a fatal message'
-
- string - -
- logger_getFilename - (); 
-

- Get the filename that would be shown when the '%F' conversion character - is used in a PatternLayout. -

-
filename=`logger_getFilename`
-
- string - -
- logger_getLevel - (); 
-

Get the global default logging level (e.g. DEBUG).

-
level=`logger_getLevel`
-
- void - -
- logger_info - (message); 
string[]  message;
-

This is a helper function for logging a message at the INFO - priority

-
logger_info 'This is a info message'
-
- void - -
- logger_setFilename - (filename); 
string  filename;
-

Set the filename to be shown when the '%F' conversion character is - used in a PatternLayout.

-
logger_setFilename 'myScript.sh'
-
- void - -
- logger_setLevel - (level); 
string  level;
-

Sets the global default logging level (e.g. DEBUG).

-
logger_setLevel INFO
-
- void - -
- logger_trace - (message); 
string[]  message;
-

This is a helper function for logging a message at the TRACE - priority

-
logger_trace 'This is a trace message'
-
- void - -
- logger_warn - (message); 
string[]  message;
-

- This is a helper function for logging a message at the WARN priority -

-
logger_warn 'This is a warn message'
-

6. Property

Table 6.6. Property

- void - -
- log4sh_doConfigure - (configFileName); 
string  configFileName;
-

- Read configuration from a file. The existing - configuration is not cleared or reset. If you require a - different behavior, then call the log4sh_resetConfiguration - before calling log4sh_doConfigure. -

-
log4sh_doConfigure myconfig.properties
-
- void - -
- log4sh_readProperties - (configFileName); 
string  configFileName;
-

- Deprecated as of 1.3.6 -

-

- See log4sh_doConfigure. -

-
log4sh_readProperties myconfig.properties
-
- void - -
- log4sh_resetConfiguration - (); 
-

- This function completely resets the log4sh configuration to have no - appenders with a global logging level of ERROR. -

-
log4sh_resetConfiguration
-

7. SMTPAppender

Table 6.7. SMTPAppender

- void - -
- appender_setAppenderRecipient - (appender,  
 email); 
string  appender;
string  email;
-

- Deprecated as of 1.3.1 -

-

- Set the to address for the given appender -

-
appender_smtp_setTo myAppender user@example.com
-
- void/boolean - -
- appender_setAppenderSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

- Deprecated as of 1.3.1 -

-

- Sets the email subject for an SMTP appender -

-
appender_setAppenderSubject myAppender "This is a test"
-
- string - -
- appender_smtp_getSubject - (appender); 
string  appender;
-

Get the email subject for the given appender

-
subject=`appender_smtp_getSubject myAppender`
-
- string - -
- appender_smtp_getTo - (appender); 
string  appender;
-

Get the to address for the given appender

-
email=`appender_smtp_getTo myAppender`
-
- void/boolean - -
- appender_smtp_setSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

Sets the email subject for an SMTP appender

-
appender_smtp_setSubject myAppender "This is a test"
-
- void - -
- appender_smtp_setTo - (appender,  
 email); 
string  appender;
string  email;
-

Set the to address for the given appender

-
appender_smtp_setTo myAppender user@example.com
-

8. SyslogAppender

Table 6.8. SyslogAppender

- string - -
- appender_getSyslogFacility - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Get the syslog facility of the specified appender by index -

-
facility=`appender_getSyslogFacility 3`
-
- void - -
- appender_setSyslogFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

- Deprecated as of 1.3.2 -

-

- Set the syslog facility for the given appender -

-
appender_setSyslogFacility myAppender local4`
-
- void - -
- appender_syslog_getFacility - (appender); 
string  appender;
-

- Get the syslog facility for the given appender. -

-
facility=`appender_syslog_getFacility myAppender`
-
string/boolean - -
- appender_syslog_getHost - (index); 
integer  index;
-

- Get the syslog host of the specified appender. -

-

Since: 1.3.7

-
host=`appender_syslog_getHost myAppender`
-
- void - -
- appender_syslog_setFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

Set the syslog facility for the given appender

-
appender_syslog_setFacility myAppender local4`
-
void/boolean - -
- appender_syslog_setHost - (appender,  
 host); 
string  appender;
string  host;
-

- Set the syslog host for the given appender. Requires that the 'nc' - command alternative has been previously set with the - log4sh_setAlternative() function. -

-

Since: 1.3.7

-
appender_syslog_setHost myAppender localhost
-

9. Thread

Table 6.9. Thread

- string - -
- logger_getThreadName - (); 
-

Gets the current thread name.

-
threadName=`logger_getThreadName`
-
- void - -
- logger_popThreadName - (); 
-

- Deprecated as of 1.3.7 -

-

- Removes the topmost thread name from the stack. The next thread name on - the stack is then placed in the __log4sh_threadName - variable. If the stack is empty, or has only one element left, then a - warning is given that no more thread names can be popped from the stack. -

-
logger_popThreadName
-
- void - -
- logger_pushThreadName - (threadName); 
string  threadName;
-

- Deprecated as of 1.3.7 -

-

- Sets the thread name (eg. the name of the script) and pushes the old on - to a stack for later use. This thread name can be used with the '%t' - conversion character within a PatternLayout. -

-
logger_pushThreadName "myThread"
-
- void - -
- logger_setThreadName - (threadName); 
string  threadName;
-

- Sets the thread name (e.g. the name of the script). This thread name can - be used with the '%t' conversion character within a - PatternLayout. -

-
logger_setThreadName "myThread"
-

10. Trap

Table 6.10. Trap

- void - -
- log4sh_cleanup - (); 
-

This is a cleanup function to remove the temporary directory used by - log4sh. It is provided for scripts who want to do log4sh cleanup work - themselves rather than using the automated cleanup of log4sh that is - invoked upon a normal exit of the script.

-
log4sh_cleanup
-

Chapter 7. Conclusion

The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well.

If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at .

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward.

diff --git a/website/log4sh-1.4.html b/website/log4sh-1.4.html deleted file mode 100644 index eac6192..0000000 --- a/website/log4sh-1.4.html +++ /dev/null @@ -1,765 +0,0 @@ -log4sh

log4sh version 1.4.2

Kate Ward


-            
-          

2007-06-02

Revision History
Revision 1.4.22007-06-02kwd
Revision 1.4.12007-05-06kwd
Revision 1.4.02007-01-05kwd

Abstract

log4sh is a logging framework for shell scripts that works similar to the other wonderful logging products available from the Apache Software Foundation (eg. log4j, log4perl). Although not as powerful as the others, it can make the task of adding advanced logging to shell scripts easier. It has much more power than just using simple "echo" commands throughout. In addition, it can be configured from a properties file so that scripts in a production environment do not need to be altered to change the amount of logging they produce.


Chapter 1. Introduction

Log4sh has been developed under the Bourne Again Shell (bash) on Linux, but great care has been taken to make sure it works under the default Bourne Shell of Solaris (sh) as the platform is still widely used.

Tested Operating Systems

  • Cygwin

  • Linux

  • Mac OS X

  • Solaris 8+

Verified Shells

  • BSD Shell (dash)

  • Bourne Shell (sh)

  • Bourne Again Shell (bash)

  • Korn Shell (ksh)

  • Public Domain Korn Shell (pdksh) -- partial functionality

See the appropriate Release Notes (doc/RELEASE_NOTES-X.X.X.txt) for this release for the actual versions tested.

1. Credits / Contributors

A list of contributors to log4sh can be found in the source archive as doc/contributors.txt. I want to personally thank all those who have contributed to make this a better tool.

2. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

Chapter 2. Quickstart

First things first. Go to the directory from which you extracted the log4sh software. In there, you should find a Makefile. If you find one, you are in the right place. We need to setup the environment for running tests, so from this directory, execute the make test-prep command as shown below. Once this is done, a test directory will be created and prepared with everything needed to run the log4sh tests.

Prepare your environment.

-$ make test-prep
-$ cd test
-

Example 2.1. Hello, World!

Ok. What kind of a quickstart would this be if the first example wasn't a "Hello, World!" example? Who knows, but this isn't one of those kind of quickstarts.

Run the Hello World test.

-$ ./hello_world
-1 [main] INFO shell  - Hello, world!
-

You should have seen output similar to that above. If not, make sure you are in the right location and such. If you really had problems, please send a letter to the log4sh maintainers. Who knows, maybe you already found a bug. Hopefully not!

The Hello, World! test is about as simple as it gets. If you take a look at the test, all it does is load log4sh, reset the default logging level from ERROR to INFO, and the logs a "Hello, world!" message. As you can see, it didn't take much to setup and use log4sh.


Example 2.2. Properties Configuration Test

In this example, a log4sh.properties configuraiton file will be used to pre-configure log4sh before any logging messages are output. It demonstrates that a configuration file can be used to alter the behavior of log4sh without having to change any shell code.

Run the properties configuration test.

-$ ./test-prop-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should see much more output on your terminal that what was listed above. What is actually happening is log4sh is outputting information to STDERR using logging statements that were stored in the test-common script. In addition, there were multiple logfiles generated (take a look in the test directory), and output was written also written via Syslog. Take a look at both the property configuration script (test-prop-config) and the common script (test-common) if you would like to see what is happening. If you do, you will notice that nowhere in code was it configured to write to the any of those different locations. The log4sh.properties configuration file did all of that work for us. Go ahead and take a look at it too. You might be amazed with how easy it was to write to so many locations with such a small amount of code.


Example 2.3. Runtime Configuration Test

This example is exactly like the last example as far as output is concerned (they both execute the same test-common script), but this one is configured instead at runtime with function calls. It demonstrates that log4sh is fully configurable at runtime.

Run the runtime configuration test.

-$ ./test-runtime-config
-INFO - We are the Simpsons!
-INFO - Mmmmmm .... Chocolate.
-INFO - Homer likes chocolate
-...
-

You should again see much more output on your terminal that what was listed above. The output should also have been exactly the same (except that the times were different) as the above example. This is because the same logging commands were used. If you take a look a look in the test-runtime-config script though, you will see that this time log4sh was configured completly at runtime. The log4sh.properties was not used. It shows that log4sh can be fully configured without a pre-existing configuration file. This isn't nearly as friendly as using the configuration file, but there are times when it is needed.


Chapter 3. Usage Guide

The usage of log4sh is simple. There are only a few simple steps required to setup and use log4sh in your application.

-

  1. preconfigure log4sh (properties file)

  2. source the log4sh script code into the shell script

  3. configure log4sh in code (optional)

  4. call logging statements

-

1. Preconfigure log4sh (optional)

To preconfigure log4sh, create a properties file (see the Properties File later in this document). If the properties file is not located in the same directory as log4sh, set the LOG4SH_CONFIGURATION environment variable to the full path to the properties file. If you do not wish to preconfigure log4sh, please read the Configure log4sh in code section later in this chapter.

2. Source log4sh

To source the code into your script (also known as including), one uses the sourcing ability of shell to source one script into another. See the following quick example for how easy this is done.

Example 3.1. Sourcing external shell code into current program

-#! /bin/sh
-
-# source log4sh from current directory
-. ./log4sh
-

Here is some sample code that looks for log4sh in the same directory as the script is located, as well as the current directory. If log4sh could not be found, it exits with an error. If log4sh is found, it is loaded, along with the log4sh.properties file in the current directory (see the following example). It then logs a message at the INFO level to STDOUT.

Example 3.2. Hello, world (using properties file)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-myDir=`dirname $0`
-
-# find and source log4sh
-if [ -r "$myDir/log4sh" ]; then
-  log4shDir=$myDir
-elif [ -r "./log4sh" ]; then
-  log4shDir=.
-else
-  echo "fatal: could not find log4sh" >&2
-  exit 1
-fi
-. $log4shDir/log4sh
-
-# say Hello to the world
-logger_info "Hello, world"
-

Here is the log4sh.properties file for the previous example. Save it in the same directory you are running the above script from.

Example 3.3. Hello, world; properties file

-#
-# log4sh example: Hello, world properties file
-#
-
-# Set root logger level to INFO and its only appender to A1
-log4sh.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4sh.appender.A1=ConsoleAppender
-
-# A1 uses a PatternLayout.
-log4sh.appender.A1.layout=PatternLayout
-log4sh.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

3. Configure log4sh in code

If log4sh was not preconfigured, the default configuration will be equivalent the config shown below.

Note: log4sh will complain if no configuration file was specified or found. If you meant for the default configuration to be used, or you want to configure log4sh via code, make sure to define the LOG4SH_CONFIGURATION with the value of 'none'.

-log4sh.rootLogger=ERROR, stdout
-log4sh.appender.stdout=ConsoleAppender
-log4sh.appender.stdout.layout=PatternLayout
-log4sh.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-

To configure log4sh in code, simply call the appropriate functions in your code. The following code sample loads log4sh from the current directory, configures it for STDERR output, and the logs a message at the INFO level.

Example 3.4. Hello, world (configured in code)

-#! /bin/sh
-#
-# log4sh example: Hello, world
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set the global logging level to INFO
-logger_setLevel INFO
-
-# add and configure a FileAppender that outputs to STDERR, and activate the
-# configuration
-logger_addAppender stderr
-appender_setType stderr FileAppender
-appender_file_setFile stderr STDERR
-appender_activateOptions stderr
-
-# say Hello to the world
-logger_info 'Hello, world'
-

4. Logging with log4sh

Once log4sh is loaded, logging is as simple as calling the appropriate logging function with a message to be logged. Take a look at the above examples to see just how easy it was to log the statement "Hello, world" at an INFO level.

The samples above show the standard way of logging a message via log4sh. That standard method is by calling the appropriate function, and passing the message as a parameter.

Example 3.5. Standard method of logging a message

logger_info 'message to log'

There is a second way of logging as well. The second method is via pipes. What this method is really good for is logging the standard output (STDOUT) of a command to the logfile. Piping echo statements is a bit silly, but something like piping the output of a ls is more practical (e.g. ls -l |logger_info).

Example 3.6. Alternate method of logging a message

echo 'message to log' |logger_info

Chapter 4. Configuration

1. Properties File

Log4sh can be configured with a properties file that is separate from the actual script where the logging takes place. By default, log4sh looks for its properties file called log4sh.properties in the current directory. If the file is located elsewhere or with a different name, log4sh can be configured by setting the LOG4SH_CONFIGURATION environment variable (eg. LOG4SH_CONFIGURATION="/etc/log4sh.conf").

A log4sh.properties file that is completly empty is sufficient to configure log4sh. There will be absolutely no output however (which might just be what is desired). Usually though, some output is desired, so there is at least a recommended minimum configuration file. An explaination of the file follows the example.

Example 4.1. Recommended minimum log4sh.properties file

-  log4sh.rootLogger=INFO, stdout
-  log4sh.appender.stdout=ConsoleAppender
-  

In the first line, the root logger is configured by setting the default logging level, and defining the name of an appender. In the second line, the stdout appender is defined as a ConsoleAppender.

1.1. Root Logger

(future)

1.2. Levels

Table 4.1. Logging Levels (from most output to least)

LevelDefinition
TRACEThe TRACE level has the lowest possible rank and is intended to turn on all logging.
DEBUGThe DEBUG level designates fine-grained informational events that are most useful to debug an application.
INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARNThe WARN level designates potentially harmful situations.
ERRORThe ERROR level designates error events that might still allow the application to continue running.
FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.
OFFThe OFF level has the highest possible rank and is intended to turn off logging.

1.3. Appenders

An appender name can be any alpha-numeric string containing no spaces.

Example 4.2. Sample appender names

myAppender - good


1.3.1. Types

An appender can be set to one of several different types.

Example 4.3. Setting an appender type

-    log4sh.appender.A1=FileAppender
-    

Table 4.2. Appender Types

TypeDefinitionSupported?
ConsoleAppenderoutput sent to console (STDOUT)yes
FileAppenderoutput sent to a fileyes
DailyRollingFileAppenderoutput sent to a file that rolls over dailypartial; logs written, but not rotated
RollingFileAppenderoutput sent to a file that rolls over by sizepartial; works, but nees improvement
SMTPAppenderoutput sent via emailparital; works, but needs improvement
SyslogAppenderoutput sent to a remote syslog daemonpartial; only localhost supported

1.3.2. Options

An appender can take several different options.

Example 4.4. Setting an appender option

-    log4sh.appender.A1.File=output.log
-    

Table 4.3. Appender Options

OptionDefinitionSupported?
DatePatternconfigure a pattern for the output filenameno (ignored)
Fileoutput filename (special filename of STDERR used for logging to STDERR)yes
MaxBackupIndexnumber of old logfiles to keepno (ignored)
MaxFileSizemaximum size of old logfilesno (ignored)
Thresholdlogging level of the appenderyes

1.3.3. Layouts

An appender can be configured with various Layouts to customize how the output looks.

Example 4.5. Setting an appender's layout

-    log4sh.appender.A1.layout=PatternLayout
-    

Table 4.4. Layouts

LayoutDefinitionSupported?
HTMLLayoutlayout using HTMLno (same as SimpleLayout)
SimpleLayouta simple default layout ('%p - %m')yes
PatternLayouta patterned layout (default: '%d %p - %m%n')yes

An layout has many different options to configure how it appears. These are known as patterns.

Example 4.6. Setting an appender's layout pattern

-    log4sh.appender.A1.layout.ConversionPattern=%d [%p] %c - %m%n
-    

Table 4.5. Pattern Options

OptionDefinitionSupported?
cUsed to output the category of logging request. As this is not applicable in shell, the conversion character will always returns 'shell'.partial (fixed)
d -

Used to output the date of the logging event. The date conversion specifier may be followed by a date format specifier enclosed between braces, but this specifier will be ignored. For example, %d{HH:mm:ss,SSS}, or %d{ISODATE}. The specifier is allowed only for compatibility with log4j properties files.

-

The default format of the date returned is equavilant to the output of the Unix date command with a format of +%Y-%m-%d %H:%M:%S.

-
yes
F -

Used to output the file name where the logging request was issued.

-

The default value is equavilent basename $0.

-
yes
LThis option is for compatibility with log4j properties files.no (ignored)
mUsed to output the script supplied message associated with the logging event.yes
nThis option is for compatibility with log4j properties files.no (ignored)
pUsed to output the priority of the logging event.yes
rUsed to output the number of seconds elapsed since the start of the script until the creation of the logging event.yes
t -

Used to output the current executing thread. As shell doesn't actually support threads, this is simply a value that can be set that can be put into the messages.i

-

The default value is 'main'.

-
yes
xThis option is for compatibility with log4j properties files.no (ignored)
XUsed to output the MDC (mapped diagnostic context) associated with the thread that generated the logging event. The X conversion character must be followed by an environment variable name placed between braces, as in %X{clientNumber} where clientNumber is the name of the environment variable. The value in the MDC corresponding to the environment variable will be output.no (ignored)
%The sequence %% outputs a single percent sign.yes

2. Environment Variables

There are some environment variables that can be used to pre-configure log4sh, or to change some of its default behavior. These variables should be set before log4sh is sourced so that they are immediately available to log4sh.

Here is the full list of supported variables.

Table 4.6. log4sh environment variables

VariableUsage
LOG4SH_CONFIGURATION -

This variable is used to tell log4sh what the name of (and possibly the full path to) the configuration (a.k.a properties) file that should be used to configure log4sh at the time log4sh is sourced. If the value 'none' is passed, than log4sh will expect to be configured at a later time via run-time configuration.

-

Example 4.7. LOG4SH_CONFIGURATION variable

LOG4SH_CONFIGURATION='/path/to/log4j.properties'

-
LOG4SH_CONFIG_PREFIX -

This variable is used to tell log4sh what prefix it should use when parsing the configuration file. Normally, the default value is 'log4sh' (e.g. 'log4sh.rootLogger'), but the value can be redefined so that a configuration file from another logging frame work such as log4j can be read.

-

Example 4.8. LOG4SH_CONFIG_PREFIX variable

LOG4SH_CONFIG_PREFIX='log4j'

-

Chapter 5. Advanced Usage

This chapter is dedicated to some more advanced usage of log4sh. It is meant to demonstrate some functionality that might not normally be understood.

1. Environment Variables

There are several environment variables that can be set to alter the behavior of log4sh. The full listing is below.

Table 5.1. log4sh Environment Variables

VariableDefaultDescription
LOG4SH_ALTERNATIVE_NCnoneProvide log4sh with the absolute path to the nc (netcat) command -- e.g. /bin/nc
LOG4SH_CONFIGURATIONnoneProvide log4sh with the absolute path to the log4sh properties file.
LOG4SH_CONFIG_PREFIXlog4shDefine the expected prefix to use for parsing the properties file -- e.g. log4j
LOG4SH_DEBUGnoneEnable internal log4sh debug output. Set to any non-empty value.
LOG4SH_DEBUG_FILEnoneDefine a file where all internal log4sh trace/debug/info output will be written to -- e.g. log4sh_internal.log
LOG4SH_INFOnoneEnable internal log4sh info output. Set to any non-empty value.
LOG4SH_TRACEnoneEnable internal log4sh trace output. Set to any non-empty value.

2. Remote Syslog Logging

Logging to a remote syslog host is incredibly easy with log4sh, but it is not functionality that is normally exposed to a shell user. The logger command, which is used for local syslog logging, unfortunately does not support logging to a remote syslog host. As such, a couple of choices are available to enable logging to remote hosts.

Choice #1 -- reconfigure the syslogd daemon

One can alter the configuration of the local syslog daemon, and request that certain types of logging information be sent to remote hosts. This choice requires no extra software to be installed on the machine, but it does require a reconfiguration of the system-wide syslog daemon. As the syslog daemon is different between operating systems, and even between OS releases, no attempt will be made to describe how to do this in this document. Read the respective man page for your particular system to learn what is required.

Choice #2 -- install nc (netcat) command -- recommended

The nc (netcat) command has the ability to generate the UDP packet to port 514 that is required for remote syslog logging. If you have this command installed, you can tell log4sh that this alternative command exists, and then you will be able to use the appender_syslog_setHost() function as you would expect.

The examples below show what a minimum properties file or a minimum script should look like that do remote syslog logging.

Example 5.1. Sample log4sh properties file demonstrating remote syslog logging

-#
-# log4sh example: remote syslog logging
-#
-
-# Set the 'nc' alternative command to enable remote syslog logging
-log4sh.alternative.nc = /bin/nc
-
- Set root logger level to INFO and its only appender to mySyslog
-log4sh.rootLogger=INFO, mySyslog
-
-# mySyslog is set to be a SyslogAppender.
-log4sh.appender.mySyslog = SyslogAppender
-log4sh.appender.mySyslog.SyslogHost = somehost
-

Example 5.2. Sample shell script demonstrating remote syslog logging

-#! /bin/sh
-#
-# log4sh example: remote syslog logging
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# set alternative 'nc' command
-log4sh_setAlternative nc /bin/nc
-
-# add and configure a SyslogAppender that logs to a remote host
-logger_addAppender mySyslog
-appender_setType mySyslog SyslogAppender
-appender_syslog_setFacility mySyslog local4
-appender_syslog_setHost mySyslog somehost
-appender_activateOptions mySyslog
-
-# say Hello to the world
-logger_info 'Hello, world'
-

3. Automated File Rolling

Logging is great, but not when it runs you out of hard drive space. To help prevent such situations, log4sh has automated file rolling built in. By changing your FileAppender into a RollingFileAppender, you enable automatic rolling of your log files. Each logfile will be rolled after it reaches a maximum file size that you determine, and you can also decide the number of backups to be kept.

To limit the maximum size of your log files, you need to set the MaxFileSize appender option in a properties file, or use the appender_file_setMaxFileSize() function. The maximum size is specified by giving a value and a unit for that value (e.g. a 1 megabyte log file can be specified as '1MiB', '1024KiB', or '1048576B'). Note, the unit must be specified with the proper case, i.e. a unit of 'KB' is correct 'kb' is not.

The default maximum file size is equavilent to 1MiB

Table 5.2. Acceptable file size units

UnitSize in bytesEquivalent sizes
B (bytes)11B
KB1,0001KB = 1000B
KiB (kilobytes)1,0241KiB = 1024B
MB1,000,0001MB = 1000KB = 1000000B
MiB (megabytes)1,048,5761MiB = 1024KiB = 1048576B
GB1,000,000,0001GB = 1000MB = 1000000KB = 1000000000B
GiB (gigabytes)1,073,741,8241GiB = 1024MiB = 1048576KiB = 1073741824B
TB1,000,000,000,0001TB = 1000GB = 1000000MB = 1000000000KB = 1000000000000B
TiB (terabytes)1,099,511,627,7761TiB = 1024GiB = 1048576MiB = 1073741824KiB = 1099511627776B

Note: log4sh differes from log4j in the impretation of its units. log4j assumes that all units are base-2 units (i.e. that KB = 1024B), where as log4sh makes a distinction between the standard SI units of KB (base-10 ~ 1000B = 10^3) and KiB (base-2 ~ 1024B = 2^10). If this causes problems, call the log4sh_enableStrictBehavior() once after loading log4sh to force the unit intrepretation to be like log4j.

To limit the maximum number of backup files kept, you need to set the MaxBackupIndex appender option in a properties file, or use the appender_file_setMaxBackupIndex() function. Whenever a file has reached the point of needing rotation, log4sh will rename the current logfile to include an extension of '.0', and any other backups will have thier extension number increased as well. With a maximum backup index of zero, no backups will be kept.

The default maximum backup index is equavilent to '1 MiB'

Example 5.3. Sample log4sh properties file demonstrating a RollingFileAppender

-#
-# log4sh example: using the RollingFileAppender
-#
-
- Set root logger level to INFO and its only appender to R
-log4sh.rootLogger=INFO, R
-
-# add a RollingFileAppender named R
-log4sh.appender.R = RollingFileAppender
-log4sh.appender.R.File = /path/to/some/file
-log4sh.appender.R.MaxFileSize = 10KB
-log4sh.appender.R.MaxBackupIndex = 1
-

Example 5.4. Sample shell script demonstrating a RollingFileAppender

-#! /bin/sh
-#
-# log4sh example: using the RollingFileAppender
-#
-
-# load log4sh (disabling properties file warning) and clear the default
-# configuration
-LOG4SH_CONFIGURATION='none' . ./log4sh
-log4sh_resetConfiguration
-
-# add and configure a RollingFileAppender named R
-logger_addAppender R
-appender_setType R RollingFileAppender
-appender_file_setFile R '/path/to/some/file'
-appender_file_setMaxFileSize R 10KB
-appender_file_setMaxBackupIndex R 1
-appender_activateOptions R
-
-# say Hello to the world
-logger_info 'Hello, world'
-

Chapter 6. Function Reference

1. Appender

Table 6.1. Appender

- void - -
- appender_activateOptions - (appender); 
string  appender;
-

- Activate an appender's configuration. This should be called after - reconfiguring an appender via code. It needs only to be called once - before any logging statements are called. This calling of this function - will be required in log4sh 1.4.x. -

-
appender_activateAppender myAppender
-
- void - -
- appender_close - (appender); 
string  appender;
-

Disable any further logging via an appender. Once closed, the - appender can be reopened by setting it to any logging Level (e.g. - INFO).

-
appender_close myAppender
-
- boolean - -
- appender_exists - (appender); 
string  appender;
-

Checks for the existance of a named appender

-
exists=`appender_exists myAppender`
-
- string - -
- appender_getAppenderType - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Gets the Type of an Appender at the given array index -

-
type=`appender_getAppenderType 3`
-
- string - -
- appender_getLayout - (appender); 
string  appender;
-

Gets the Layout of an Appender

-
type=`appender_getLayout myAppender`
-
string/boolean - -
- appender_getLevel - (appender); 
string  appender;
-

Gets the current logging Level of an Appender

-
type=`appender_getLevel myAppender`
-
- string - -
- appender_getPattern - (appender); 
string  appender;
-

Gets the Pattern of an Appender

-
pattern=`appender_getPattern myAppender`
-
- string - -
- appender_getType - (appender); 
string  appender;
-

Gets the Type of an Appender

-
type=`appender_getType myAppender`
-
- void - -
- appender_setAppenderType - (appender,  
 type); 
string  appender;
string  type;
-

- Deprecated as of 1.3.1 -

-

- Sets the Type of an Appender (e.g. FileAppender) -

-
appender_setAppenderType myAppender FileAppender
-
- void - -
- appender_setLayout - (appender,  
 layout); 
string  appender;
string  layout;
-

Sets the Layout of an Appender (e.g. PatternLayout)

-
appender_setLayout myAppender PatternLayout
-
void/boolean -
- appender_setLevel - (appender,  
 level); 
string  appender;
string  level;
-

Sets the Level of an Appender (e.g. INFO)

-
appender_setLevel myAppender INFO
-
void/boolean -
- appender_setPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

Sets the Pattern of an Appender

-
appender_setPattern myAppender '%d %p - %m%n'
-
void/boolean -
- appender_setType - (appender,  
 type); 
string  appender;
string  type;
-

Sets the Type of an Appender (e.g. FileAppender)

-
appender_setType myAppender FileAppender
-

2. FileAppender

Table 6.2. FileAppender

- string - -
- appender_file_getFile - (appender); 
string  appender;
-

Get the filename of a FileAppender

-
appender_file_getFile myAppender
-
integer/boolean - -
- appender_file_getMaxBackupIndex - (appender); 
string  appender;
-

- Returns the value of the MaxBackupIndex option. -

-

Since: 1.3.7

-
appender_file_getMaxBackupIndex myAppender
-
integer/boolean - -
- appender_file_getMaxFileSize - (appender); 
string  appender;
-

- Get the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

Since: 1.3.7

-
maxSize=`appender_file_getMaxBackupSize myAppender`
-
- void - -
- appender_file_setFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Set the filename for a FileAppender (e.g. STDERR or - /var/log/log4sh.log). -

-
appender_file_setFile myAppender STDERR
-
- void - -
- appender_file_setMaxBackupIndex - (appender,  
 index); 
string  appender;
integer  index;
-

Set the maximum number of backup files to keep around.

-

- The MaxBackupIndex option determines - how many backup files are kept before the oldest is erased. This option - takes a positive integer value. If set to zero, then there will be no - backup files and the log file will be truncated when it reaches - MaxFileSize. -

-

Since: 1.3.7

-
appender_file_setMaxBackupIndex myAppender 3
-
void/boolean - -
- appender_file_setMaxFileSize - (appender,  
 size); 
string  appender;
string  size;
-

- Set the maximum size that the output file is allowed to reach before - being rolled over to backup files. -

-

- In configuration files, the MaxFileSize option takes an - long integer in the range 0 - 2^40. You can specify the value with the - suffixes "KiB", "MiB" or "GiB" so that the integer is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. For example, - the value "10KiB" will be interpreted as 10240. -

-

Since: 1.3.7

-
appender_file_setMaxBackupSize myAppender 10KiB
-
- void - -
- appender_setAppenderFile - (appender,  
 filename); 
string  appender;
string  filename;
-

- Deprecated as of 1.3.2 -

-

- Set the filename for a FileAppender (e.g. "STDERR" or - "/var/log/log4sh.log") -

-
appender_setAppenderFile myAppender STDERR
-

3. Level

Table 6.3. Level

- integer - -
- logger_level_toInt - (level); 
string  level;
-

Converts an externally used level tag into its integer - equivalent

-
levelInt=`logger_level_toInt WARN`
-
- string - -
- logger_level_toLevel - (val); 
integer  val;
-

Converts an internally used level integer into its external level - equivalent

-
level=`logger_level_toLevel 3`
-

4. Log4sh

Table 6.4. Log4sh

void/boolean - -
- log4sh_enableStrictBehavior - (); 
-

- Enables strict log4j behavior. -

-

Since: 1.3.7

-
log4sh_enableStrictBehavior
-
void/boolean - -
- log4sh_setAlternative - (command,  
 path,  
 useRuntimePath); 
string  command;
string  path;
boolean  useRuntimePath;
-

- Specifies an alternative path for a command. -

-

Since: 1.3.7

-
log4sh_setAlternative nc /bin/nc
-

5. Logger

Table 6.5. Logger

- void - -
- log - (level,  
 message(s)); 
string  level;
string[]  message(s);
-

The base logging command that logs a message to all defined - appenders

-
log DEBUG 'This is a test message'
-
void/boolean -
- logger_addAppender - (appender); 
string  appender;
-

Add and initialize a new appender

-
logger_addAppender $appender
-
- void - -
- logger_addAppenderWithPattern - (appender,  
 pattern); 
string  appender;
string  pattern;
-

- Deprecated as of 1.3.6 -

-

- Add and initialize a new appender with a specific PatternLayout -

-
logger_addAppenderWithPattern $appender '%d %p - %m%n'
-
- void - -
- logger_debug - (message); 
string[]  message;
-

This is a helper function for logging a message at the DEBUG - priority

-
logger_debug 'This is a debug message'
-
- void - -
- logger_error - (message); 
string[]  message;
-

- This is a helper function for logging a message at the ERROR priority -

-
logger_error 'This is a error message'
-
- void - -
- logger_fatal - (message); 
string[]  message;
-

This is a helper function for logging a message at the FATAL - priority

-
logger_fatal 'This is a fatal message'
-
- string - -
- logger_getFilename - (); 
-

- Get the filename that would be shown when the '%F' conversion character - is used in a PatternLayout. -

-
filename=`logger_getFilename`
-
- string - -
- logger_getLevel - (); 
-

Get the global default logging level (e.g. DEBUG).

-
level=`logger_getLevel`
-
- void - -
- logger_info - (message); 
string[]  message;
-

This is a helper function for logging a message at the INFO - priority

-
logger_info 'This is a info message'
-
- void - -
- logger_setFilename - (filename); 
string  filename;
-

Set the filename to be shown when the '%F' conversion character is - used in a PatternLayout.

-
logger_setFilename 'myScript.sh'
-
- void - -
- logger_setLevel - (level); 
string  level;
-

Sets the global default logging level (e.g. DEBUG).

-
logger_setLevel INFO
-
- void - -
- logger_trace - (message); 
string[]  message;
-

This is a helper function for logging a message at the TRACE - priority

-
logger_trace 'This is a trace message'
-
- void - -
- logger_warn - (message); 
string[]  message;
-

- This is a helper function for logging a message at the WARN priority -

-
logger_warn 'This is a warn message'
-

6. Property

Table 6.6. Property

void/boolean - -
- log4sh_doConfigure - (configFileName); 
string  configFileName;
-

- Read configuration from a file. The existing - configuration is not cleared or reset. If you require a - different behavior, then call the log4sh_resetConfiguration - before calling log4sh_doConfigure. -

-
log4sh_doConfigure myconfig.properties
-
- void - -
- log4sh_readProperties - (configFileName); 
string  configFileName;
-

- Deprecated as of 1.3.6 -

-

- See log4sh_doConfigure. -

-
log4sh_readProperties myconfig.properties
-
- void - -
- log4sh_resetConfiguration - (); 
-

- This function completely resets the log4sh configuration to have no - appenders with a global logging level of ERROR. -

-
log4sh_resetConfiguration
-

7. SMTPAppender

Table 6.7. SMTPAppender

- void - -
- appender_setAppenderRecipient - (appender,  
 email); 
string  appender;
string  email;
-

- Deprecated as of 1.3.1 -

-

- Set the to address for the given appender -

-
appender_smtp_setTo myAppender user@example.com
-
- void - -
- appender_setAppenderSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

- Deprecated as of 1.3.1 -

-

- Sets the email subject for an SMTP appender -

-
appender_setAppenderSubject myAppender "This is a test"
-
string/boolean - -
- appender_smtp_getSubject - (appender); 
string  appender;
-

Get the email subject for the given appender

-
subject=`appender_smtp_getSubject myAppender`
-
string/boolean - -
- appender_smtp_getTo - (appender); 
string  appender;
-

Get the to address for the given appender

-
email=`appender_smtp_getTo myAppender`
-
void/boolean - -
- appender_smtp_setSubject - (appender,  
 subject); 
string  appender;
string  subject;
-

Sets the email subject for an SMTP appender

-
appender_smtp_setSubject myAppender "This is a test"
-
void/boolean - -
- appender_smtp_setTo - (appender,  
 email); 
string  appender;
string  email;
-

Set the to address for the given appender

-
appender_smtp_setTo myAppender user@example.com
-

8. SyslogAppender

Table 6.8. SyslogAppender

- string - -
- appender_getSyslogFacility - (index); 
integer  index;
-

- Deprecated as of 1.3.1 -

-

- Get the syslog facility of the specified appender by index -

-
facility=`appender_getSyslogFacility 3`
-
- void - -
- appender_setSyslogFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

- Deprecated as of 1.3.2 -

-

- Set the syslog facility for the given appender -

-
appender_setSyslogFacility myAppender local4`
-
- void - -
- appender_syslog_getFacility - (appender); 
string  appender;
-

- Get the syslog facility for the given appender. -

-
facility=`appender_syslog_getFacility myAppender`
-
string/boolean - -
- appender_syslog_getHost - (index); 
integer  index;
-

- Get the syslog host of the specified appender. -

-

Since: 1.3.7

-
host=`appender_syslog_getHost myAppender`
-
- void - -
- appender_syslog_setFacility - (appender,  
 facility); 
string  appender;
string  facility;
-

Set the syslog facility for the given appender

-
appender_syslog_setFacility myAppender local4`
-
void/boolean - -
- appender_syslog_setHost - (appender,  
 host); 
string  appender;
string  host;
-

- Set the syslog host for the given appender. Requires that the 'nc' - command alternative has been previously set with the - log4sh_setAlternative() function. -

-

Since: 1.3.7

-
appender_syslog_setHost myAppender localhost
-

9. Thread

Table 6.9. Thread

- string - -
- logger_getThreadName - (); 
-

Gets the current thread name.

-
threadName=`logger_getThreadName`
-
- void - -
- logger_popThreadName - (); 
-

- Deprecated as of 1.3.7 -

-

- Removes the topmost thread name from the stack. The next thread name on - the stack is then placed in the __log4sh_threadName - variable. If the stack is empty, or has only one element left, then a - warning is given that no more thread names can be popped from the stack. -

-
logger_popThreadName
-
- void - -
- logger_pushThreadName - (threadName); 
string  threadName;
-

- Deprecated as of 1.3.7 -

-

- Sets the thread name (eg. the name of the script) and pushes the old on - to a stack for later use. This thread name can be used with the '%t' - conversion character within a PatternLayout. -

-
logger_pushThreadName "myThread"
-
- void - -
- logger_setThreadName - (threadName); 
string  threadName;
-

- Sets the thread name (e.g. the name of the script). This thread name can - be used with the '%t' conversion character within a - PatternLayout. -

-
logger_setThreadName "myThread"
-

10. Trap

Table 6.10. Trap

- void - -
- log4sh_cleanup - (); 
-

This is a cleanup function to remove the temporary directory used by - log4sh. It is provided for scripts who want to do log4sh cleanup work - themselves rather than using the automated cleanup of log4sh that is - invoked upon a normal exit of the script.

-
log4sh_cleanup
-

Chapter 7. Conclusion

The idea of log4sh is obviously not novel, but the availibility of such a powerful logging framework that is available in (nearly) pure shell is. Hopefully you will find it useful in one of your projects as well.

If you like what you see, or have any suggestions on improvements, please feel free to drop me an email at .

Log4sh is licensed under the GNU Lesser Public License. The contents and copyright of this document and all provided source code are owned by Kate Ward.

diff --git a/website/releases/.htaccess b/website/releases/.htaccess deleted file mode 100644 index 8bdc4c0..0000000 --- a/website/releases/.htaccess +++ /dev/null @@ -1,14 +0,0 @@ -# $Id$ - -Options +Indexes -IndexOptions NameWidth=* - -AddType multipart/digest .md5 - - RemoveEncoding .tgz - - -AddType application/gpg-signature .sig - - RemoveEncoding .tgz - diff --git a/website/releases/log4sh-1.2.5.tgz.md5 b/website/releases/log4sh-1.2.5.tgz.md5 deleted file mode 100644 index 971fdb8..0000000 --- a/website/releases/log4sh-1.2.5.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -9a14581c679697d7c8364dd1361ace57 log4sh-1.2.5.tgz diff --git a/website/releases/log4sh-1.2.5.tgz.sig b/website/releases/log4sh-1.2.5.tgz.sig deleted file mode 100644 index e6561bd..0000000 Binary files a/website/releases/log4sh-1.2.5.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.2.6.tgz.md5 b/website/releases/log4sh-1.2.6.tgz.md5 deleted file mode 100644 index 34f7034..0000000 --- a/website/releases/log4sh-1.2.6.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -b587b41657bbd617ba3c66f22c6e671d log4sh-1.2.6.tgz diff --git a/website/releases/log4sh-1.2.6.tgz.sig b/website/releases/log4sh-1.2.6.tgz.sig deleted file mode 100644 index ea8e123..0000000 Binary files a/website/releases/log4sh-1.2.6.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.2.7.tgz.md5 b/website/releases/log4sh-1.2.7.tgz.md5 deleted file mode 100644 index 9b85318..0000000 --- a/website/releases/log4sh-1.2.7.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -514cca6cc7a2f4055876d9dc28afb1cb log4sh-1.2.7.tgz diff --git a/website/releases/log4sh-1.2.7.tgz.sig b/website/releases/log4sh-1.2.7.tgz.sig deleted file mode 100644 index 8407278..0000000 Binary files a/website/releases/log4sh-1.2.7.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.2.8.tgz.md5 b/website/releases/log4sh-1.2.8.tgz.md5 deleted file mode 100644 index fd5ec90..0000000 --- a/website/releases/log4sh-1.2.8.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -ed5615d7131364edb779532ffae9c068 log4sh-1.2.8.tgz diff --git a/website/releases/log4sh-1.2.8.tgz.sig b/website/releases/log4sh-1.2.8.tgz.sig deleted file mode 100644 index a1cf6d5..0000000 Binary files a/website/releases/log4sh-1.2.8.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.0.tgz.md5 b/website/releases/log4sh-1.3.0.tgz.md5 deleted file mode 100644 index 7c2f1bf..0000000 --- a/website/releases/log4sh-1.3.0.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -ff8fd703562bf84cf6b64fc34c00e8f1 log4sh-1.3.0.tgz diff --git a/website/releases/log4sh-1.3.0.tgz.sig b/website/releases/log4sh-1.3.0.tgz.sig deleted file mode 100644 index 57e7134..0000000 Binary files a/website/releases/log4sh-1.3.0.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.1.tgz.md5 b/website/releases/log4sh-1.3.1.tgz.md5 deleted file mode 100644 index 81dbcb1..0000000 --- a/website/releases/log4sh-1.3.1.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -a0575b4e6358cf034828bc1e46e133ee log4sh-1.3.1.tgz diff --git a/website/releases/log4sh-1.3.1.tgz.sig b/website/releases/log4sh-1.3.1.tgz.sig deleted file mode 100644 index c2d36a6..0000000 Binary files a/website/releases/log4sh-1.3.1.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.2.tgz.md5 b/website/releases/log4sh-1.3.2.tgz.md5 deleted file mode 100644 index ec5e41f..0000000 --- a/website/releases/log4sh-1.3.2.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -7a4adc03758b05be9166c386a38b65db log4sh-1.3.2.tgz diff --git a/website/releases/log4sh-1.3.2.tgz.sig b/website/releases/log4sh-1.3.2.tgz.sig deleted file mode 100644 index 55aef0f..0000000 Binary files a/website/releases/log4sh-1.3.2.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.3.tgz.md5 b/website/releases/log4sh-1.3.3.tgz.md5 deleted file mode 100644 index aee9516..0000000 --- a/website/releases/log4sh-1.3.3.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -3743dc3486ac8c3736214c68ff7d473f log4sh-1.3.3.tgz diff --git a/website/releases/log4sh-1.3.3.tgz.sig b/website/releases/log4sh-1.3.3.tgz.sig deleted file mode 100644 index e8ad98b..0000000 Binary files a/website/releases/log4sh-1.3.3.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.4.tgz.md5 b/website/releases/log4sh-1.3.4.tgz.md5 deleted file mode 100644 index 6680776..0000000 --- a/website/releases/log4sh-1.3.4.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -b3fd228594975d9ab85eee28167d15c2 log4sh-1.3.4.tgz diff --git a/website/releases/log4sh-1.3.4.tgz.sig b/website/releases/log4sh-1.3.4.tgz.sig deleted file mode 100644 index a99d426..0000000 Binary files a/website/releases/log4sh-1.3.4.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.5.tgz.md5 b/website/releases/log4sh-1.3.5.tgz.md5 deleted file mode 100644 index 8632235..0000000 --- a/website/releases/log4sh-1.3.5.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -fd2387f20cdc379e4ee648fa8571ae00 log4sh-1.3.5.tgz diff --git a/website/releases/log4sh-1.3.5.tgz.sig b/website/releases/log4sh-1.3.5.tgz.sig deleted file mode 100644 index d0d0afa..0000000 Binary files a/website/releases/log4sh-1.3.5.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.6.tgz.md5 b/website/releases/log4sh-1.3.6.tgz.md5 deleted file mode 100644 index 7edbb02..0000000 --- a/website/releases/log4sh-1.3.6.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -7405eca38283c413e196326ef1e97bf2 log4sh-1.3.6.tgz diff --git a/website/releases/log4sh-1.3.6.tgz.sig b/website/releases/log4sh-1.3.6.tgz.sig deleted file mode 100644 index 46e2fef..0000000 Binary files a/website/releases/log4sh-1.3.6.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.3.7.tgz.md5 b/website/releases/log4sh-1.3.7.tgz.md5 deleted file mode 100644 index 33b4048..0000000 --- a/website/releases/log4sh-1.3.7.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -7b87416fdf80b986fb1e115d2bed97fc log4sh-1.3.7.tgz diff --git a/website/releases/log4sh-1.3.7.tgz.sig b/website/releases/log4sh-1.3.7.tgz.sig deleted file mode 100644 index 05f015f..0000000 Binary files a/website/releases/log4sh-1.3.7.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.4.0.tgz.md5 b/website/releases/log4sh-1.4.0.tgz.md5 deleted file mode 100644 index c7f62ac..0000000 --- a/website/releases/log4sh-1.4.0.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -b8cf7d33b0aaa0dcc8b0f6a6e4cb7f9c log4sh-1.4.0.tgz diff --git a/website/releases/log4sh-1.4.0.tgz.sig b/website/releases/log4sh-1.4.0.tgz.sig deleted file mode 100644 index 21bed9a..0000000 Binary files a/website/releases/log4sh-1.4.0.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.4.1.tgz.md5 b/website/releases/log4sh-1.4.1.tgz.md5 deleted file mode 100644 index c83a82d..0000000 --- a/website/releases/log4sh-1.4.1.tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -1f4f3bf9b6c26380a276777e43c27a6e log4sh-1.4.1.tgz diff --git a/website/releases/log4sh-1.4.1.tgz.sig b/website/releases/log4sh-1.4.1.tgz.sig deleted file mode 100644 index 9434760..0000000 Binary files a/website/releases/log4sh-1.4.1.tgz.sig and /dev/null differ diff --git a/website/releases/log4sh-1.4.2-tgz.md5 b/website/releases/log4sh-1.4.2-tgz.md5 deleted file mode 100644 index 635a279..0000000 --- a/website/releases/log4sh-1.4.2-tgz.md5 +++ /dev/null @@ -1 +0,0 @@ -b2177ab1f84a6cd91faf123bce74c899 log4sh-1.4.2-tgz diff --git a/website/releases/log4sh-1.4.2-tgz.sig b/website/releases/log4sh-1.4.2-tgz.sig deleted file mode 100644 index e6f108d..0000000 Binary files a/website/releases/log4sh-1.4.2-tgz.sig and /dev/null differ diff --git a/website/style.css b/website/style.css deleted file mode 100644 index c1d2f43..0000000 --- a/website/style.css +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id$ */ -/* - style.css -*/ - - -body { - -/* - Style the HMTL tag with a sans-serif font and 6% margin. - A sans-serif font makes documents easier to read when displayed on - a computer screen. Whitespace surrounding the document should - make it easier to read both on screen and on printed paper. The - value of 6% was chosen because it closely approximates a one-half - inch margin on a US letter (8.5" by 11") paper. Since the margin - is expressed as a percentage it should scale well in a web browser - window. -*/ - - font-family: sans-serif; - margin: 6%; -} - -/* -table { - font-size: 0.9em; -} -*/ - -.toc { - background: #f0f0f0; - padding: 5px; -} diff --git a/website/testresults/.htaccess b/website/testresults/.htaccess deleted file mode 100644 index c1cc83e..0000000 --- a/website/testresults/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ -# $Id$ - -Options +Indexes -IndexOptions NameWidth=* diff --git a/website/testresults/1.3.7/Cygwin.txt b/website/testresults/1.3.7/Cygwin.txt deleted file mode 100644 index 5fc7083..0000000 --- a/website/testresults/1.3.7/Cygwin.txt +++ /dev/null @@ -1,836 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSyslogAppender" - -# system info -$ date -Mon Jan 1 15:06:33 GMT 2007 -$ uname -a -CYGWIN_NT-5.1 girly-winxp 1.5.23(0.156/4/2) 2006-12-19 10:52 i686 Cygwin - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.9(10)-release (i686-pc-cygwin) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% diff --git a/website/testresults/1.3.7/Linux-Ubuntu_Edgy-6.10.txt b/website/testresults/1.3.7/Linux-Ubuntu_Edgy-6.10.txt deleted file mode 100644 index d24efbb..0000000 --- a/website/testresults/1.3.7/Linux-Ubuntu_Edgy-6.10.txt +++ /dev/null @@ -1,927 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSyslogAppender" - -# system info -$ date -Mon Jan 1 14:33:09 GMT 2007 -$ uname -a -Linux kward-laptop 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006 i686 GNU/Linux - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - waiting for possible 'FATAL' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/dash -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% diff --git a/website/testresults/1.3.7/Solaris-10-U2-sparc.txt b/website/testresults/1.3.7/Solaris-10-U2-sparc.txt deleted file mode 100644 index d1c376f..0000000 --- a/website/testresults/1.3.7/Solaris-10-U2-sparc.txt +++ /dev/null @@ -1,632 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Mon Jan 1 14:21:47 GMT 2007 -$ uname -a -SunOS sparc00 5.10 Generic_118833-24 sun4u sparc SUNW,UltraAX-i2 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.3.7/Solaris-10-U2-x86.txt b/website/testresults/1.3.7/Solaris-10-U2-x86.txt deleted file mode 100644 index 4b26214..0000000 --- a/website/testresults/1.3.7/Solaris-10-U2-x86.txt +++ /dev/null @@ -1,563 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Mon Jan 1 12:39:15 GMT 2007 -$ uname -a -SunOS sol10-u2 5.10 Generic_118855-19 i86pc i386 i86pc - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.3.7/Solaris-8-U3-x86.txt b/website/testresults/1.3.7/Solaris-8-U3-x86.txt deleted file mode 100644 index 8876cc8..0000000 --- a/website/testresults/1.3.7/Solaris-8-U3-x86.txt +++ /dev/null @@ -1,563 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Mon Jan 1 15:31:03 Europe/Dublin 2007 -$ uname -a -SunOS sol8-u3 5.8 Generic_117351-43 i86pc i386 i86pc - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 2.03.0(1)-release (i386-sun-solaris) -Copyright 1998 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.0/Cygwin.txt b/website/testresults/1.4.0/Cygwin.txt deleted file mode 100644 index 9a4acee..0000000 --- a/website/testresults/1.4.0/Cygwin.txt +++ /dev/null @@ -1,900 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Fri Jan 5 21:15:53 GMT 2007 -$ uname -mprsv -CYGWIN_NT-5.1 1.5.23(0.156/4/2) 2006-12-19 10:52 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.9(10)-release (i686-pc-cygwin) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% diff --git a/website/testresults/1.4.0/Linux-Ubuntu_Edgy-6.10.txt b/website/testresults/1.4.0/Linux-Ubuntu_Edgy-6.10.txt deleted file mode 100644 index d5bca81..0000000 --- a/website/testresults/1.4.0/Linux-Ubuntu_Edgy-6.10.txt +++ /dev/null @@ -1,1006 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Fri Jan 5 20:11:56 GMT 2007 -$ uname -mprsv -Linux 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/dash -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% diff --git a/website/testresults/1.4.0/Mac_OS_X-10.4.8.txt b/website/testresults/1.4.0/Mac_OS_X-10.4.8.txt deleted file mode 100644 index e289ec6..0000000 --- a/website/testresults/1.4.0/Mac_OS_X-10.4.8.txt +++ /dev/null @@ -1,688 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Fri Jan 5 15:02:16 GMT 2007 -$ uname -mprsv -Darwin 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0) -Copyright (C) 2002 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 p - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.0/Solaris-10-U2-sparc.txt b/website/testresults/1.4.0/Solaris-10-U2-sparc.txt deleted file mode 100644 index 28368b2..0000000 --- a/website/testresults/1.4.0/Solaris-10-U2-sparc.txt +++ /dev/null @@ -1,680 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Fri Jan 5 20:21:02 GMT 2007 -$ uname -mprsv -SunOS 5.10 Generic_118833-24 sun4u sparc - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.0/Solaris-10-U2-x86.txt b/website/testresults/1.4.0/Solaris-10-U2-x86.txt deleted file mode 100644 index deaae1e..0000000 --- a/website/testresults/1.4.0/Solaris-10-U2-x86.txt +++ /dev/null @@ -1,611 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Fri Jan 5 20:48:17 GMT 2007 -$ uname -mprsv -SunOS 5.10 Generic_118855-19 i86pc i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.0/Solaris-8-U3-x86.txt b/website/testresults/1.4.0/Solaris-8-U3-x86.txt deleted file mode 100644 index 88b5072..0000000 --- a/website/testresults/1.4.0/Solaris-8-U3-x86.txt +++ /dev/null @@ -1,611 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" -LOG4SH_ALTERNATIVE_NC=/opt/csw/bin/nc - -# system info -$ date -Fri Jan 5 21:38:25 Europe/Dublin 2007 -$ uname -mprsv -SunOS 5.8 Generic_117351-43 i86pc i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 2.03.0(1)-release (i386-sun-solaris) -Copyright 1998 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix - -# -# Test report -# -tests passed: 42 -tests failed: 0 -tests total: 42 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 -tests failed: 0 -tests total: 32 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.1/Cygwin.txt b/website/testresults/1.4.1/Cygwin.txt deleted file mode 100644 index 9df05ff..0000000 --- a/website/testresults/1.4.1/Cygwin.txt +++ /dev/null @@ -1,928 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sun Apr 22 20:55:56 GMTDT 2007 -$ uname -mprsv -CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.15(13)-release (i686-pc-cygwin) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'DEBUG' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'INFO' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'WARN' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'ERROR' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'FATAL' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed - testing appender priority 'OFF' -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -ASSERT: failed -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 -tests failed: 44 -tests total: 68 -success rate: 35% diff --git a/website/testresults/1.4.1/Linux-Ubuntu_Feisty-7.04.txt b/website/testresults/1.4.1/Linux-Ubuntu_Feisty-7.04.txt deleted file mode 100644 index b20b1e8..0000000 --- a/website/testresults/1.4.1/Linux-Ubuntu_Feisty-7.04.txt +++ /dev/null @@ -1,1041 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sun May 6 18:36:37 CDT 2007 -$ uname -mprsv -Linux 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/dash -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 -tests failed: 0 -tests total: 68 -success rate: 100% diff --git a/website/testresults/1.4.1/Solaris-10-U2-x86.txt b/website/testresults/1.4.1/Solaris-10-U2-x86.txt deleted file mode 100644 index d33addb..0000000 --- a/website/testresults/1.4.1/Solaris-10-U2-x86.txt +++ /dev/null @@ -1,646 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sun May 6 23:12:23 GMT 2007 -$ uname -mprsv -SunOS 5.10 Generic_118855-36 i86pc i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... -ASSERT: did not receive the remotely logged syslog message - -# -# Test report -# -tests passed: 67 -tests failed: 1 -tests total: 68 -success rate: 98% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... -ASSERT: did not receive the remotely logged syslog message - -# -# Test report -# -tests passed: 67 -tests failed: 1 -tests total: 68 -success rate: 98% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 -tests failed: 1 -tests total: 6 -success rate: 83% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 -tests failed: 0 -tests total: 6 -success rate: 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 -tests failed: 0 -tests total: 10 -success rate: 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 -tests failed: 0 -tests total: 2 -success rate: 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 -tests failed: 0 -tests total: 24 -success rate: 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 -tests failed: 0 -tests total: 43 -success rate: 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 -tests failed: 0 -tests total: 44 -success rate: 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 -tests failed: 0 -tests total: 7 -success rate: 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR unrecognized command alternative 'nc' -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... -ASSERT: did not receive the remotely logged syslog message - -# -# Test report -# -tests passed: 67 -tests failed: 1 -tests total: 68 -success rate: 98% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.2/Cygwin.txt b/website/testresults/1.4.2/Cygwin.txt deleted file mode 100755 index 6702f52..0000000 --- a/website/testresults/1.4.2/Cygwin.txt +++ /dev/null @@ -1,900 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sat Jun 2 21:00:09 GMTDT 2007 -$ uname -mprsv -CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.15(13)-release (i686-pc-cygwin) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% diff --git a/website/testresults/1.4.2/Linux-Ubuntu_Dapper-6.06.txt b/website/testresults/1.4.2/Linux-Ubuntu_Dapper-6.06.txt deleted file mode 100644 index 03d17c0..0000000 --- a/website/testresults/1.4.2/Linux-Ubuntu_Dapper-6.06.txt +++ /dev/null @@ -1,892 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sat Jun 2 20:17:05 IST 2007 -$ uname -mprsv -Linux 2.6.18.5-gg10-mixed64-32 #1 SMP Tue May 8 22:29:42 PDT 2007 x86_64 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r- - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -log4sh:WARN missing file size unit; assuming bytes -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% diff --git a/website/testresults/1.4.2/Linux-Ubuntu_Feisty-7.04.txt b/website/testresults/1.4.2/Linux-Ubuntu_Feisty-7.04.txt deleted file mode 100644 index 9dfb740..0000000 --- a/website/testresults/1.4.2/Linux-Ubuntu_Feisty-7.04.txt +++ /dev/null @@ -1,1221 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sat Jun 2 20:17:28 IST 2007 -$ uname -mprsv -Linux 2.6.20-16-generic #2 SMP Wed May 23 01:46:23 UTC 2007 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 67 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 67 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/dash -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 67 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 67 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 67 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 67 100% diff --git a/website/testresults/1.4.2/Mac_OS_X-10.4.9.txt b/website/testresults/1.4.2/Mac_OS_X-10.4.9.txt deleted file mode 100644 index ff1377d..0000000 --- a/website/testresults/1.4.2/Mac_OS_X-10.4.9.txt +++ /dev/null @@ -1,685 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sat Jun 2 19:49:57 IST 2007 -$ uname -mprsv -Darwin 8.9.1 Darwin Kernel Version 8.9.1: Thu Feb 22 20:55:00 PST 2007; root:xnu-792.18.15~1/RELEASE_I386 i386 i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0) -Copyright (C) 2002 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 p - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - -# -# Test report -# -tests passed: 24 36% -tests failed: 0 0% -tests skipped: 43 64% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.2/Solaris-10-U2-x86.txt b/website/testresults/1.4.2/Solaris-10-U2-x86.txt deleted file mode 100644 index f309723..0000000 --- a/website/testresults/1.4.2/Solaris-10-U2-x86.txt +++ /dev/null @@ -1,793 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sat Jun 2 20:40:03 GMT 2007 -$ uname -mprsv -SunOS 5.10 Generic_118855-36 i86pc i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'TRACE' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'DEBUG' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'FATAL' message - testing appender priority 'DEBUG' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'DEBUG' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'FATAL' message - testing appender priority 'INFO' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'FATAL' message - testing appender priority 'WARN' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'FATAL' message - testing appender priority 'ERROR' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'ERROR' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'ERROR' priority appender did not emit a 'FATAL' message - testing appender priority 'FATAL' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'FATAL' priority appender did not emit a 'FATAL' message - testing appender priority 'OFF' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 45 67% -tests failed: 21 31% -tests skipped: 1 1% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10) -Copyright (C) 2004 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 66 99% -tests failed: 0 0% -tests skipped: 1 1% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 66 99% -tests failed: 0 0% -tests skipped: 1 1% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.4.2/Solaris-8-U3-x86.txt b/website/testresults/1.4.2/Solaris-8-U3-x86.txt deleted file mode 100644 index 466ab39..0000000 --- a/website/testresults/1.4.2/Solaris-8-U3-x86.txt +++ /dev/null @@ -1,838 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testConsoleAppender testCustomMDCPatterns testFileAppender testLog4jCompatibility testMultipleAppenders testPatternLayout testPriority testPropertyConfig testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sun Jun 3 17:15:20 GMT 2007 -$ uname -mprsv -SunOS 5.8 Generic_117351-43 i86pc i386 - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'ConsoleAppender' test suite --- -# -# Performing tests -# -testAppenderTypes -ASSERT: need to write - -# -# Test report -# -tests passed: 0 0% -tests failed: 1 100% -tests skipped: 0 0% -tests total: 1 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'TRACE' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'DEBUG' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'TRACE' priority appender did not emit a 'FATAL' message - testing appender priority 'DEBUG' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'DEBUG' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'DEBUG' priority appender did not emit a 'FATAL' message - testing appender priority 'INFO' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'INFO' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'INFO' priority appender did not emit a 'FATAL' message - testing appender priority 'WARN' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'WARN' message -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'WARN' priority appender did not emit a 'FATAL' message - testing appender priority 'ERROR' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'ERROR' priority appender did not emit a 'ERROR' message -./testSyslogAppender: !: not found -ASSERT: 'ERROR' priority appender did not emit a 'FATAL' message - testing appender priority 'FATAL' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -ASSERT: 'FATAL' priority appender did not emit a 'FATAL' message - testing appender priority 'OFF' -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -./testSyslogAppender: !: not found -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 45 67% -tests failed: 21 31% -tests skipped: 1 1% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 2.03.0(1)-release (i386-sun-solaris) -Copyright 1998 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'ConsoleAppender' test suite --- -# -# Performing tests -# -testAppenderTypes -ASSERT: need to write - -# -# Test report -# -tests passed: 0 0% -tests failed: 1 100% -tests skipped: 0 0% -tests total: 1 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 66 99% -tests failed: 0 0% -tests skipped: 1 1% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset -ASSERT: 'PQRSTUVWXYZ[\]^_' != 'PQRSTUVWXYZ[]^_' - -# -# Test report -# -tests passed: 5 83% -tests failed: 1 17% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'ConsoleAppender' test suite --- -# -# Performing tests -# -testAppenderTypes -ASSERT: need to write - -# -# Test report -# -tests passed: 0 0% -tests failed: 1 100% -tests skipped: 0 0% -tests total: 1 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'Log4jCompatibility' test suite --- -# -# Performing tests -# -testAppenders -testLayouts - -# -# Test report -# -tests passed: 9 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 9 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern - -# -# Test report -# -tests passed: 24 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 24 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'PropertyConfig' test suite --- -# -# Performing tests -# -testAppenders -- expecting one error -log4sh:ERROR appender type (InvalidAppender) unrecognized -testLayouts -- expecting one error -log4sh:ERROR unknown layout: InvalidLayout -testLayoutTypes -- expecting one error -log4sh:ERROR layout value/method (InvalidType) unrecognized - -# -# Test report -# -tests passed: 3 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 3 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 -testMaxFileSizeGetterSetter -- expecting one warning -log4sh:WARN missing file size unit; assuming bytes -- expecting one error -log4sh:ERROR unrecognized file size unit 'foo' - -# -# Test report -# -tests passed: 44 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 44 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:ERROR [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging -log4sh:ERROR log4sh_setAlternative(): nc: command not found -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). - waiting longer for message... - -# -# Test report -# -tests passed: 66 99% -tests failed: 0 0% -tests skipped: 1 1% -tests total: 67 100% - -run-test-suite:WARN unable to run tests with the /bin/pdksh shell diff --git a/website/testresults/1.5.0/Cygwin.txt b/website/testresults/1.5.0/Cygwin.txt deleted file mode 100644 index 959cbe6..0000000 --- a/website/testresults/1.5.0/Cygwin.txt +++ /dev/null @@ -1,746 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Sun Apr 22 20:56:05 GMTDT 2007 -$ uname -mprsv -CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 35% -tests failed: 2 3% -tests skipped: 42 62% -tests total: 68 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.15(13)-release (i686-pc-cygwin) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -ASSERT: failed - -# -# Test report -# -tests passed: 24 35% -tests failed: 2 3% -tests skipped: 42 62% -tests total: 68 100% - -run-test-suite:WARN unable to run tests with the /bin/dash shell - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -./testSyslogAppender: @: parameter not set - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -ASSERT: unable to read from the test syslog output file (/var/log/log4sh.log). -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - testing appender priority 'INFO' - testing appender priority 'WARN' - testing appender priority 'ERROR' - testing appender priority 'FATAL' - testing appender priority 'OFF' -testRemoteLogging -./testSyslogAppender: @: parameter not set - -# -# Test report -# -tests passed: 24 36% -tests failed: 1 1% -tests skipped: 42 63% -tests total: 67 100% diff --git a/website/testresults/1.5.0/Linux-Ubuntu_Feisty-7.04.txt b/website/testresults/1.5.0/Linux-Ubuntu_Feisty-7.04.txt deleted file mode 100644 index 5539373..0000000 --- a/website/testresults/1.5.0/Linux-Ubuntu_Feisty-7.04.txt +++ /dev/null @@ -1,1023 +0,0 @@ -#------------------------------------------------------------------------------ -# System data -# - -# test run info -shells="/bin/sh /bin/bash /bin/dash /bin/ksh /bin/pdksh" -tests="testAsciiCharset testCustomMDCPatterns testFileAppender testMultipleAppenders testPatternLayout testPriority testRollingFileAppender testSMTPAppender testSyslogAppender" - -# system info -$ date -Thu Apr 12 17:53:29 IST 2007 -$ uname -mprsv -Linux 2.6.20-14-generic #2 SMP Mon Apr 2 20:37:49 UTC 2007 i686 unknown - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/sh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 68 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/bash -# - -GNU bash, version 3.2.10(1)-release (i486-pc-linux-gnu) -Copyright (C) 2005 Free Software Foundation, Inc. - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 68 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/dash -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 68 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/ksh -# - - version sh (AT&T Labs Research) 1993-12-28 r - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 68 100% - - -#------------------------------------------------------------------------------ -# Running the test suite with /bin/pdksh -# - ---- Executing the 'AsciiCharset' test suite --- -# -# Performing tests -# -testAsciiCharset - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'CustomMDCPatterns' test suite --- -# -# Performing tests -# -testCustomDateMDC -testCustomTimeMDC -testCustomUserHostMDC - -# -# Test report -# -tests passed: 6 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 6 100% - ---- Executing the 'FileAppender' test suite --- -# -# Performing tests -# -testSTDERR_runtime -testSTDERR_config -testSimple_runtime -testSimple_config -testAccessors_getFilename -testAccessors_setgetFilename - -# -# Test report -# -tests passed: 10 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 10 100% - ---- Executing the 'MultipleAppenders' test suite --- -# -# Performing tests -# -testTwoSimilarFileAppenders - -# -# Test report -# -tests passed: 2 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 2 100% - ---- Executing the 'PatternLayout' test suite --- -# -# Performing tests -# -testCategoryPattern -testDatePattern -testFileNamePattern -testLineNumberPattern -testLineSeparatorPattern -testMessagePattern -testPriorityPattern -testRunningTimePattern -testThreadNamePattern -testNDCPattern -testMDCPattern -testPercentPattern -testDefaultPattern -ASSERT: default pattern '%d %p - %m%n' failed: result '%' did not match the regex '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\} INFO - dummy' - -# -# Test report -# -tests passed: 25 96% -tests failed: 1 4% -tests skipped: 0 0% -tests total: 26 100% - ---- Executing the 'Priority' test suite --- -# -# Performing tests -# -testPriorityMatrix -testInvalidPriority -log4sh:ERROR invalid logging level requested (INVALID) - -# -# Test report -# -tests passed: 43 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 43 100% - ---- Executing the 'RollingFileAppender' test suite --- -# -# Performing tests -# -testEmptyFile_runtime -testOneByteUnderSize_runtime -testExactlyRightSize_runtime -testOneByteOverSize_runtime -testOrderOfMagnitudeLarger_runtime -testEmptyFile_config -testOneByteUnderSize_config -testExactlyRightSize_config -testOneByteOverSize_config -testOrderOfMagnitudeLarger_config -testMaxBackupIndexOf2 -testMaxBackupIndexOf1 -testMaxBackupIndexOf0 - -# -# Test report -# -tests passed: 32 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 32 100% - ---- Executing the 'SMTPAppender' test suite --- -# -# Performing tests -# -testSubjectGetterSetter -testToGetterSetter -testAppenderSetupFromConfig - -# -# Test report -# -tests passed: 7 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 7 100% - ---- Executing the 'SyslogAppender' test suite --- -# -# Performing tests -# -testFacilityGetterSetter -log4sh:WARN [invalid] is an unknown syslog facility. Defaulting to [user]. -testHostGetterSetter -log4sh:WARN the nc (netcat) command alternative is required for remote syslog logging. see log4sh_setAlternative(). -testSyslogLogfilePresent -testPriorityMatrix - testing appender priority 'TRACE' - testing appender priority 'DEBUG' - waiting for possible 'TRACE' message... - testing appender priority 'INFO' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - testing appender priority 'WARN' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - testing appender priority 'ERROR' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - testing appender priority 'FATAL' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - testing appender priority 'OFF' - waiting for possible 'TRACE' message... - waiting for possible 'DEBUG' message... - waiting for possible 'INFO' message... - waiting for possible 'WARN' message... - waiting for possible 'ERROR' message... - waiting for possible 'FATAL' message... -testRemoteLogging - -# -# Test report -# -tests passed: 68 100% -tests failed: 0 0% -tests skipped: 0 0% -tests total: 68 100%