Commit Graph
23 Commits
Author SHA1 Message Date
Craig R. McClanahan 025dc566b9 The Jdk14Logger wrapper should not be modifying the configuration of the
underlying logger.

Submitted by:  Christophe Felix-Henry <cfelixhenry at scort.com>


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138882 13f79535-47bb-0310-9956-ffa450edef68
2002-04-29 16:48:09 +00:00
Craig R. McClanahan 6bafa3f510 Modify the logger discovery contract to perform the complete set of checks
even in environments (such as an Applet) where System.getProperty() throws
a security exception.  Previously, this was causing the checks for Log4J or
JDK 1.4 logging to be skipped.

PR:  Bugzilla #7468
Reported By:  Tim Vernum (tpv at spamcop.net)


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138881 13f79535-47bb-0310-9956-ffa450edef68
2002-03-31 00:31:49 +00:00
Craig R. McClanahan 4487056de8 Remove forgotten debugging statement.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138880 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 22:57:36 +00:00
Craig R. McClanahan 740d078137 Make discovery process on LogSource compatible with that used by
LogFactory with respect to system properties.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138876 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 00:41:37 +00:00
Craig R. McClanahan 5f390b02fc When selecting the default logging implementation on a 1.4 system, ensure
that the commons-logging wrapper is also available before selecting it.
This avoids problems when using a copy of commons-logging.jar compiled on
a 1.3 system (and therefore missing the wrappe class) when executing on a
1.4 system.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138875 13f79535-47bb-0310-9956-ffa450edef68
2002-02-27 18:01:41 +00:00
Craig R. McClanahan dee096a758 Reset version number for development. Update copyright year (so that
it will be right the next time).


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138872 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 23:02:01 +00:00
Craig R. McClanahan a2abbb8b5c Update version number for release build.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138870 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 22:07:04 +00:00
Craig R. McClanahan aa4b2e1a80 Update the javadocs package description to reflect the new LogFactory
capabilities.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138864 13f79535-47bb-0310-9956-ffa450edef68
2002-02-15 01:59:48 +00:00
Craig R. McClanahan 87cfde50b6 Fix the implementation in LogFactory and LogFactoryImpl so that it actually
works as documented.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138859 13f79535-47bb-0310-9956-ffa450edef68
2002-02-14 03:48:44 +00:00
Craig R. McClanahan 6a315e28ed Improvements to the new LogFactory APIs, based on feedback from Costin and
Jon plus some additional thought about using it in a multi-class-loader
environment (like Tomcat):

* Changed newFactory() to getFactory(), and implemented a cache of
  previously created factory instances (one per class loader).  This
  avoids potentially expensive and redundant discovery operations.

* Added convenient static getLog() method so a typical application
  component can initialize it's Log instance like this:

    Log log = LogFactory.getLog("com.mycompany.mypackage.MyClass");

* Added variants of getInstance() and getLog() that take a Class
  parameter instead of a String.  LogSource had this convenience
  feature, and there's no reason not to keep it.

* Added release() and releaseAll() methods to instruct the factory
  instances to release any cached references to other LogFactory
  or Log instances.  This is important, for example, if you put
  commons-logging.jar in Tomcat's shared "lib" directory, and then
  use the application reload facility.  The references maintained
  here would otherwise prevent garbage collection of the old
  webapp class loader once a reload takes place.

* Added a note on getInstance() that you can make no assumptions
  about whether or not the actual Log instance you get back is
  shared or not.  The actual sharability is a feature of the
  LogFactory implementation you are using, and what kind of a
  class loader environment you ae installing.

* Deprecated LogSource, but left it there to ease transition of
  existing code using it.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138858 13f79535-47bb-0310-9956-ffa450edef68
2002-02-14 00:19:03 +00:00
Craig R. McClanahan 753843f275 Forgot to commit the new exception class.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138857 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 02:18:30 +00:00
Craig R. McClanahan 91d58c6367 Add a new factory base class (LogFactory) and corresponding implementation
(LogFactoryImpl) that is based on the principles of the JAXP API's approach
to discovering SAXParserFactory and DocumentBuilderFactory instances.  It
addresses the technical concerns that Costin brought up in response to the
original Commons Logging 1.0 vote.

The primary new features:

* Applications can select their own LogFactory implementations, not
  just their own Log implementations.  The default LogFactoryImpl
  uses the same algorithm currently included in LogSource.

* The LogFactory implementation class can be specified by either a
  system property (org.apache.commons.logging.LogFactory), or by a
  corresponding property in a "commons-logging.properties" file found
  somewhere in the class path.

* LogFactory implementations possess optional configuration attributes,
  which are preloaded from the "commons-logging.properties" file if it
  is found.  These can be used by the factory to customize its own
  behavior as needed.

* LogFactory and Log implementation classes are loaded from the
  thread context class loader (if it is set) in a JDK 1.2 or later
  environment.  Hwoever, the entire API and default implementation should
  still work on a JDK 1.1 system.

* A specialized exception (LogConfigurationException) is thrown for things
  like missing LogFactory or Log implementation clases.  This class
  extends RuntimeException, so you normally don't have to put everything
  in try/catch blocks unless you care about dealing with this in a
  special way.

For applications currently using the pre-release version of the API, this
will typically mean replacing calls like this:

  Log log = LogSource.getInstance("foo");

with calls like this:

  Log log = LogFactory.newFactory().getInstance("foo");

unless you want to take advantage of the new capabilities.

If this factory approach is accepted, I propose that we take the actions:

* Deprecate LogSource (but leave it there for now, to assist existing
  applications in their transition)

* Consider adding a setLogFactory() method to the Log interface -- and
  the existing implementation classes -- to give them easy access to the
  configuration attributes associated with the factory.

* Add unit tests for the new code (it's not really been tested yet).

* Propose the revised APIs as Commons-Logging 1.0 so that apps waiting
  for a final release can know what API to depend on.

Follow-up technical discussions on this proposal should take place on
COMMONS-DEV.  (If you want to argue about who can vote for what, please
start your own thread someplace else so we can get some work done :-).


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138856 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 02:18:11 +00:00
Craig R. McClanahan ed81b5ffec Correct the author attributions on the JDK 1.4 logging package wrapper.
The code that this was based on was posted by Paulo Gaspar with a Java
package name of "krankikom.log.*" -- not exactly rousing evidence of
the fact that it came from Avalon.

Finally found the old mail message, and it did have Berin and Peter
as authors.  Sure wish Paulo wouldn't arbitrarily change package names ...


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138848 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 03:56:26 +00:00
Craig R. McClanahan 97142db2c2 Add logkit.jar to "test.classpath" as well as "compile.classpath".
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138839 13f79535-47bb-0310-9956-ffa450edef68
2002-01-22 01:33:45 +00:00
Craig R. McClanahan dabce5cf42 Add convenience "all" and "off" levels to SimpleLog.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138838 13f79535-47bb-0310-9956-ffa450edef68
2002-01-21 21:19:38 +00:00
Craig R. McClanahan fef8c7dd0a Update hyperlinks in these two files.
Submitted by:  Eric Dobbs <eric@dobbse.net>


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138837 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 04:48:27 +00:00
Craig R. McClanahan b39b2191aa Implement the agreed-upon API changes for the commons-logging package.
If the changes are too radical, I tagged things with "before_clean_up" to make
it easy to go back.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138835 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 01:47:49 +00:00
Craig R. McClanahan 36652638b4 Make LogSource more applet-friendly by swallowing any security exception
thrown when System.getProperty() is called.

Submitted by:  Anthony Martin <Anthony@TRAMS.com>


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138833 13f79535-47bb-0310-9956-ffa450edef68
2002-01-16 00:54:51 +00:00
Craig R. McClanahan 7ed3bbc6ee A few more tweaks to the STATUS file, add the MANIFEST.MF file for the
META-INF directory of the JAR file.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138832 13f79535-47bb-0310-9956-ffa450edef68
2002-01-08 22:55:39 +00:00
Craig R. McClanahan af62db1c56 Add a new Log implementation for JDK 1.4 (or later) logging.
Default behavior of LogSource.getInstance() is now:
* If Log4J is available, return an instance of Log4JCategoryLog
* If JDK 1.4 is available, return an instance of Jdk14Logger
* Otherwise, return an instance of NoOpLogger

As before, this default behavior can be overridden with a system
property, or by calling LogSource.setLogImplementation(), as described
in the package Javadocs.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138829 13f79535-47bb-0310-9956-ffa450edef68
2002-01-05 22:40:40 +00:00
Craig R. McClanahan 377da14ae0 Add "META-INF/LICENSE.txt" for digester and logging also.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138827 13f79535-47bb-0310-9956-ffa450edef68
2002-01-05 00:34:46 +00:00
Craig R. McClanahan 35ad9f42bd Forgot to clean up a Javadoc warning along the way.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138815 13f79535-47bb-0310-9956-ffa450edef68
2001-12-04 04:41:00 +00:00
Craig R. McClanahan ad40b8fdb4 Migrate the "logging" package from jakarta-commons-sandbox.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138814 13f79535-47bb-0310-9956-ffa450edef68
2001-12-04 04:28:03 +00:00