miniLogger is a very small (4 classes and a 10KB jar) and easy to use logger. It uses a logging API that is a subset of JDK 1.4 logging but works on all Java 2 versions. It has been tested on Windows, Solaris, IRIX, and Linux for versions 1.2 and 1.3 of the Sun JDK. It supports logger control from the command line. Logger names are hierarchical separated by dots, and selecting any name automatically selects all names below. If logger_name is an empty string, it will affect all loggers. The loggers and level options are evaluated from left to right. It prints the thread name, source file name, and number line by default, and output can be redirected from System.err to file or any PrintStream. Finally, the logger hierarchy can easily mirror a package/class hierarchy or can be arbitrarily defined by the user.
|Tags||Software Development Libraries Java Libraries Testing Logging Monitoring|
|Operating Systems||OS Independent|
Release Notes: This is a maintenance version with only minor modifications. The Logger.throwing() and Logger.caught() methods were changed to return their argument if it is Throwable, which makes it possible to log and throw exception in one line (for example, "throw Logger.throwing(new MyException()))". Added The Logger.caught() method, which can be used to trace when exceptions are caught, was added. The logger output was improved so that it contains the logger name (to simplify grep-like filtering) and a timestamp. The build script was changed to add the package's version number to the MANIFEST file included in the JAR file. To allow running in sandbox, setup calls to System.getProperty() are now wrapped in AccessController.doPrivileged().
Release Notes: Added Logger.entering(..), exiting(), and thrown() convenience methods, which are compatible with JDK 1.4 and automatically determine the class and method name to allow for writing logger.entering() instead of logger.entering("FooClass", "methodBar"). This release also adds log methods that take object parameters and a list of objects, which are converted using toString() and printed.
Release Notes: A fix for a bug with weak references: when loggers were configured from commandline, the reference to loggers were not preserved. Therefore when those loggers were garbage-collected they disappeared from LogManager and it was affecting setup of default logging levels for new loggers (interestingly, the bug showed only under Linux JDK 1.3, not Solaris).