You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2003/01/27 18:13:55 UTC

DO NOT REPLY [Bug 16462] New: - Add a method to check if repository is configured

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>