logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16462] New: - Add a method to check if repository is configured
Date Mon, 27 Jan 2003 17:13:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16462>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16462

Add a method to check if repository is configured

           Summary: Add a method to check if repository is configured
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Other
        AssignedTo: log4j-dev@jakarta.apache.org
        ReportedBy: jim.mack@cox.net


A way is needed to check if log4j (LoggerRepository?) has been configured. 
Components need to seamlessly integrate with an application (i.e. leverage 
log4j configuration if exists, use files, levels, etc..).  

There are other ways around this problem:
1) Properties could be used to tell the components whether or not to 
initialize, which initialization file to use, etc... 
2) Components could use a specified log4j.xml file regardless of previous 
configurations.
Both solutions require programmer intervention and knowledge of log4j. An 
automated solution would be extremely helpful. A static or non-static method 
defined in Logger, would be ideal. Perhaps, something like:
public class MyClass
{
private Logger log = Logger.getLogger (...);

public MyClass ()
{
  if (!log.isRepositoryConfigured()) // If it is not configured
      DOMConfigurator.configure (...); // then configure it.
}

--
To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>


Mime
View raw message