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: 434 $