Discussion:
Disabling Logging in POI 3.15
Sawan.Patwari
2018-11-19 13:28:54 UTC
Permalink
Hi,
I am trying to disable logging that is happening in POI 3.15. Please refer
the attached documents for the steps adopted in order to achieve the same,
especially, the 'Approach-3'.

Regards,
-Sawan.Patwari POI_Logging_Disable_Issue.docx
<http://apache-poi.1045710.n5.nabble.com/file/t340636/POI_Logging_Disable_Issue.docx>



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Andreas Beeker
2018-11-19 13:41:28 UTC
Permalink
Hi,

I've searched the codebase for ->usage"<- (and other variations) to check if we generate such a string somewhere,
but didn't find anything - please check your other libs/code.

Andi

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Sawan.Patwari
2018-11-19 14:11:51 UTC
Permalink
Hi Andi,
Even I tried to do a search on the below string combinations, but didn't
find a match.

1. BorderStyle short usage
2. short usage
3. usage

Below is the code where 'BorderStyle' entity is being used. And, 'CellStyle'
is an Interface. Perhaps, an implementation class is logging this one. I
might probably have to figure-out which is that class that is being
referenced at runtime.
CellStyle style = workbook.createCellStyle();
style.setBorderRight(BorderStyle.THIN);

I am attaching a screenshot for your reference; can you help me in figuring
out the implementation class of CellStyle that might be referenced at
runtime (by looking at the jars that are used - as shown in the attached
screenshot). It must be 'XSSFCellStyle' class, since the workbook is created
using - 'XSSFWorkbook'. But, in the source code of 'XSSFCellStyle' class, I
didn't find the above mentioned string combinations. I will also try to
figure out in the mean time. Thanks for your help in advance.
<Loading Image...>

Regards,
-Sawan.Patwari




--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Sawan.Patwari
2018-11-19 14:43:48 UTC
Permalink
Hi Andi,
We need to remove the 'System.out.println' statements from the code that
which we had missed-out. Please find the attached screenshot for the
information; the file is - 'org.apache.poi.ss.util.CellUtil'. The logging
wasn't enabled in the very first place. Now, we are good. Thank you for your
attention and the time.

Regards,
-Sawan.Patwari
<Loading Image...>



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Sawan.Patwari
2018-11-19 15:07:20 UTC
Permalink
Hi Andi,
There were around 91 matches to the 'System.out.println' statements in the
POI-3.15 source-code; please refer the attached screenshot. It would be
great if we could get rid of these statements from the source-code because
these statements would certainly bring-down the performance of excel
generation in the production. Likewise, we might want to have a check in the
other projects show in the attached screenshot. Appreciate your attention on
this thread. Have a good time!


Regards,
-Sawan.Patwari
<Loading Image...>



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Aram Mirzadeh
2018-11-19 15:23:21 UTC
Permalink
I'm sure there a few instances, but your search is bit inaccurate. It
includes test and dev classes, scratchpad, etc... if you exclude those I
wonder how many system.foo.print we have.
Post by Sawan.Patwari
Hi Andi,
There were around 91 matches to the 'System.out.println' statements in the
POI-3.15 source-code; please refer the attached screenshot. It would be
great if we could get rid of these statements from the source-code because
these statements would certainly bring-down the performance of excel
generation in the production. Likewise, we might want to have a check in the
other projects show in the attached screenshot. Appreciate your attention on
this thread. Have a good time!
Regards,
-Sawan.Patwari
<http://apache-poi.1045710.n5.nabble.com/file/t340636/POI-Related-3.jpg>
--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html
---------------------------------------------------------------------
Sawan.Patwari
2018-11-20 06:17:23 UTC
Permalink
Ok. I ran a search only in POI-3.15 source code.

Regards,
-Sawan.Patwari



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Nick Burch
2018-11-19 16:05:20 UTC
Permalink
Post by Sawan.Patwari
There were around 91 matches to the 'System.out.println' statements in the
POI-3.15 source-code
Apache POI 3.15 is now over 2 years old, and several security issues have
been fixed in newer versions. What happens when you upgrade?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Andreas Beeker
2018-11-19 21:14:25 UTC
Permalink
Post by Sawan.Patwari
There were around 91 matches to the 'System.out.println' statements in the
POI-3.15 source-code
Apache POI 3.15 is now over 2 years old, and several security issues have been fixed in newer versions. What happens when you upgrade?
I went over the System.outs again and those occur only (if I haven't missed one) in util code, like listing the records of format XY. I've removed a few commented out areas - but as Nick mentions, it's time to upgrade your libs.
IIRC there is one noteworthy regression, before bug #61798 was fixed, in XSSF the last column had a one-off error corrupting the sheets -> you would need to use POI 4.0.0. Just test your use-cases, if you can stay on 3.17 or use 4.0.0.
Btw. I'm in the progress of providing 4.0.1 soon, so maybe you want to wait for it ...

Andi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Sawan.Patwari
2018-11-20 06:25:09 UTC
Permalink
Hi Andi,
This was very useful and an elaborative information. Thank you for sharing
this information. So far we haven't faced any issue with the excel
generation, but I will certainly get to know the issue that you are
mentioning. We would certainly think to upgrade the libs. I thank you again
for your attention - it is encouraging.

Regards,
-Sawan.Patwari



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org

Sawan.Patwari
2018-11-20 06:19:19 UTC
Permalink
Thanks for the info, Nick.

Regards,
-Sawan.Patwari



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
kiwiwings
2018-11-19 14:57:15 UTC
Permalink
I would try to provide my own PrintStream [1], set System.out and trace/debug
its caller.


[1]
https://stackoverflow.com/questions/2227095/how-to-override-not-the-oop-override-the-output-of-system-out-print



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Loading...