uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Baessler <...@michael-baessler.de>
Subject Re: Log4J wrapper for UIMA logger
Date Wed, 23 Jan 2008 14:14:06 GMT
Yes, as Frank mentioned below, there is an open task to do. Till now we 
hadn't the time to work on this.
I like the idea to have a parameter maybe to directly set the logger 
class which is than used in place of the one
that is specified in the factoryConfig.xml file. So it is not necessary 
to patch the UIMAFramework class.

If you have some free cycles you can add the missing pieces and submit 
them as patch to UIMA-282.

Maybe together we get it into the next release.

-- Michael

Roberto Franchini wrote:
> On Jan 22, 2008 11:57 AM, Christoph B├╝scher
> <christoph.buescher@neofonie.de> wrote:
>   
>> Hi,
>>
>> in die mailing list archive I read something about plans to provide a log4j
>> wrapper to the UIMA logging mechanism as an alternative to the standard logger
>> implementation (Jira: UIMA-282). Are there any plans to include this in a future
>> release (we are currently using 2.2.1)?
>>
>>     
>
> Hi, I've made such implementation, you can find it attached to the
> jira issue http://issues.apache.org/jira/browse/UIMA-282
>
> This isn't enough, since you should configure the UIMA framework to
> give you this implementation instead of standard one.
> I did it in this way:
> -custom Factory Config with this content:
> ....
> <factoryConfig>
> 	<cpm class="org.apache.uima.collection.impl.cpm.CPMImpl"/>
>     <logger class="it.celi.uima.Log4jLogger_impl"/>
> ...
>
> -custom UIMAFramework class (  cut and paste the orginal one):
> ....
> protected void parseFactoryConfig() throws
> ParserConfigurationException, SAXException,
>           IOException, ClassNotFoundException, InstantiationException,
> IllegalAccessException {
>     FactoryConfigParseHandler handler = new FactoryConfigParseHandler();
>     // TOOD: Need UtilityClassLoader here? I don't think we do; this works
>     // with XML4J v3. This is a good thing, since the UtilityClassLoader writes
>     // to the logger, which isn't created yet!
>     SAXParserFactory factory = SAXParserFactory.newInstance();
>     SAXParser parser = factory.newSAXParser();
>     XMLReader reader = parser.getXMLReader();
>
>     reader.setContentHandler(handler);
>     reader.setErrorHandler(handler);
>     reader
>             .parse(new InputSource(UIMAFramework_impl.class
>                     .getResourceAsStream("YOUR_FACTORY_XML_FILE_NAME_HERE")));
>   }
>
>
> and the you should give this implementation to the jvm at the startup:
>
> java -Duima.framework_impl=my.package.UIMAFramework_impl
>
> UIMAFrameworks lacks a parameter for che factoryConfig.xml file :(
>
> I hope this could be usefull.
> FRANK
>
>   


Mime
View raw message