You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Mehra, Vishal" <vm...@inovant.com> on 2003/06/18 18:10:27 UTC

Setting Logger Level in POI

	I have a  java application which executes dynamic SQL and based on the result set generates appropriate .XLS file. This java application internally uses cocoon and poi libraries to generate the Excel file. 

	By default, for each cell generation approximately 10 lines are getting printed on the console. As, I have a large Excel file, generation of this file is taking a very long time. It appears the debug level is set to DEBUG (if not specified)

	Is there a POI api to set the log level to FATAL which will reduce the number of log message displayed. 

	One thought would be to disable debug log. Is there a configuration to turn off this log.

	Thanks,

Vishal

Re: Setting Logger Level in POI

Posted by José Antonio Pérez Testa <ja...@indra.es>.
It seems that POI Default Logger is SystemOutLogger.
SystemOutLogger enables ALL levels as it appears in the following code

public class SystemOutLogger extends POILogger
{
 .............................................

    /**
     * Check if a logger is enabled to log at the specified level
     *
     * @param level One of DEBUG, INFO, WARN, ERROR, FATAL
     * @param obj1 The logger to check.
     */

    public boolean check(final int level)
    {
       return true;
    }
...............
}

You can change DefaultLogger changing  the nex system property : 
org.apache.poi.util.POILogger

and setting for example a CommonsLogger 
(org.apache.poi.util.CommonsLogger) backed by a Log4JLogger which is 
"easily" configurable_.

_Hope it helps!


Mehra, Vishal wrote:

>	I have a  java application which executes dynamic SQL and based on the result set generates appropriate .XLS file. This java application internally uses cocoon and poi libraries to generate the Excel file. 
>
>	By default, for each cell generation approximately 10 lines are getting printed on the console. As, I have a large Excel file, generation of this file is taking a very long time. It appears the debug level is set to DEBUG (if not specified)
>
>	Is there a POI api to set the log level to FATAL which will reduce the number of log message displayed. 
>
>	One thought would be to disable debug log. Is there a configuration to turn off this log.
>
>	Thanks,
>
>Vishal
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>