[ 
http://jira.codehaus.org/browse/GEOT-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jody Garnett reopened GEOT-1545:
--------------------------------


Not done yet Martin; some docs and questions need to be answered first please.

Propsal page:
- 
http://docs.codehaus.org/display/GEOTOOLS/Allow+redirection+to+alternate+logging+API

Has a few more tasks to do...

> Need a Logger subclass which redirect everything to common-logging
> ------------------------------------------------------------------
>
>                 Key: GEOT-1545
>                 URL: http://jira.codehaus.org/browse/GEOT-1545
>             Project: GeoTools
>          Issue Type: Improvement
>          Components: core metadata
>    Affects Versions: 2.4-RC0, 2.5-M0
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>             Fix For: 2.4-RC1, 2.5-M1
>
>         Attachments: build.xml, modified.txt
>
>
> GeoTools uses Java logging ({{java.util.logging}} package), but GeoServer 
> need the ability to log to different frameworks. We wish (if possible) to 
> code against Java logging API since commons-logging is not the only candidate 
> (SLF4J is an other one), Java logging is an attempt of standard API available 
> on every JVM (1.4+) and its API is more elaborated than commons-logging one. 
> The proposal is:
> * Create a {{java.util.logging.Logger}} subclass, {{CommonLogger}}, that 
> delegates everything to commons-logging, including methods like 
> {{info(String)}} and {{isLoggable(Level)}}. Some methods may not have direct 
> match (e.g. {{getHandler}}), but they are of interest only for advanced users 
> (and an indirect match is possible anyway with the {{CommonHandler}} already 
> available in the GeoTools code base).
> * Switch all {{Logger.getLogger(xxx)}} methods to a special GeoTools utility 
> class (maybe the existing {{Logging}} class) that will return either the 
> plain java logging logger, or the {{CommonLogger}}, depending on a 
> configuration.
> * We'll have some way to switch GeoTools logging one way or the other (and 
> the same will have to work for GeoServer as well).
> The level matching currently used is:
> || Log4J Level || java.util.logging Level ||
> | ALL | FINEST |
> | TRACE | FINER |
> | DEBUG | FINE/CONFIG |
> | INFO | INFO |
> | WARN/ERROR | WARNING |
> | FATAL | SEVERE |
> | OFF | OFF |
> {{CommonLogger}} pseudo-code:
> {code:java}
> class CommonLogger extends Logger {
>     private Log commonLog;
>     public boolean isLoggable(Level level) {
>         switch (level) {
>             case FINER: return commonLog.isTraceEnabled();
>             case FINE:  return commonLog.isDebugEnabled();
>             // etc...
>         }
>     }
>     public void finer(String message) {
>         commonLog.trace(message);
>     }
>     // etc...
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to