Issue Details (XML | Word | Printable)

Key: LOGCXX-26
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Curt Arnold
Reporter: Martin Landers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4cxx

Default initialization is broken

Created: 20/Oct/04 12:56 PM   Updated: 22/Oct/04 04:55 AM
Return to search
Component/s: Configurator
Affects Version/s: 0.9.7
Fix Version/s: 0.10.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works log4cxx_config.patch 2004-10-20 12:57 PM Martin Landers 4 kB
Environment: Linux (SuSE)

Resolution Date: 22/Oct/04 04:55 AM


 Description  « Hide
log4cxx's current default initializion is broken on Linux (and possibly a large number of other systems), because log4cxx sticks a little too close to log4j's ideas:

The current mechanism is using _environment variables_ containing
a dot for its configuration. As stated in the short introduction:
"The preferred way to specify the default initialization file is through the log4j.configuration environment variable."

The problem is, that it's impossible to create environment variables containing a dot on Linux systems, meaning you're unable to use the _preferred way_ of default initialization on Linux...

I've created a small, backward-compatible patch, that goes on
to check a few additional environment variables (LOG4J_CONFIGURATION
and LOG4CXX_CONFIGURATION) if log4j.configuration is unset allowing
UNIX-types to use these instead of the ones with the dot. The patch
also updates the documentation in the short introduction.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Landers added a comment - 20/Oct/04 12:57 PM
Patch fixing the initialization issue.

Martin Landers made changes - 20/Oct/04 12:57 PM
Field Original Value New Value
Attachment log4cxx_config.patch [ 17960 ]
Repository Revision Date User Message
ASF #308679 Fri Oct 22 04:46:34 UTC 2004 carnold LOGCXX-26: Default configuration is broken
Files Changed
MODIFY /logging/log4cxx/trunk/build.xml
MODIFY /logging/log4cxx/trunk/docs/introduction.dox
MODIFY /logging/log4cxx/trunk/include/log4cxx/logmanager.h
MODIFY /logging/log4cxx/trunk/src/logmanager.cpp

Curt Arnold added a comment - 22/Oct/04 04:55 AM
Thanks for the patch. I've taken a slightly different take on the resolution. Using "log4j.*" environment variables was misguided in my judgement since log4j configuration is through Java VM properties not environment variables. The existing log4j.* environment variables need to be supported for compatibility, however I've given the "LOG4CXX_*" environment variables and the "log4cxx.*" files precedence over their log4j.* equivalents. So if a directory has log4j.properties and log4cxx.properties, then one will be used to configure Java apps and the other for C++ apps. That seems more desirable than using log4j.properties to control both and ignore the log4cxx.properties file.

I'd be surprised if this (or the existing code) builds on Win32 since "stat" is typically "_stat" on that platform, but I'm pretty sure that build has been broken for a couple of months and I'll fix it up in one go.

I've modified build.xml so that the default configuration unit test
is run under additional scenarios, with LOG4CXX_CONFIGURATION environment variable set and with log4cxx.properties and log4j.properties files present.

CVS commit message: http://nagoya.apache.org/eyebrowse/ReadMsg?listName=log4cxx-dev@logging.apache.org&msgNo=319


Curt Arnold made changes - 22/Oct/04 04:55 AM
Fix Version/s 0.9.8 [ 10782 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Assignee Michaël CATANZARITI [ mcatan ] Curt Arnold [ carnold@apache.org ]