Log messages from org.apache.http.client showing in console

Description

Using CFHTTP to hit certaion HTTP URLs in CommandBox results in unwanted messages leaking out of the org.apache.http.client library to the console.

Simply running this from the CommandBox prompt will show the issue:

The messages that appear are:

Is there a way to turn off console logging from this library, or redirect it elsewhere?

Environment

None

Activity

Show:
Michael Offner
February 7, 2020, 9:11 AM

we also change this

in the lucee server xml to

 

 

Michael Offner
February 7, 2020, 9:13 AM

side note, this also can be set with the env var/system properties

-lucee.system.out

-lucee.system.err

Michael Offner
February 7, 2020, 10:06 AM

i decided agains my idea above, it would be to much of a change for existing systems. default remains to write to console, but now you have the option “log“.

until now that setting only applied for Lucee, but not 3 party libs like httpcomponents from apache, now the setting rewrites System.setX( and because of that applies to 3 party libs as well.

so to write to the log, you know have to set the env var

 

 

in addition we explicitly supress the output in the tag http

Michael Offner
February 7, 2020, 10:43 AM
Brad Wood
April 9, 2020, 7:39 PM

This ticket is not fixed. The correct fix was to adjust the logging settings for the ESAPI libraries so they stopped logging. highjacking the system out stream has caused many other bugs and regressions in Lucee. System.out needs to be left alone and we need to be only modifying the logging settings of the library that is responsible for the messages. Either turning the logs from that lib off, or redirecting them elsewhere.

Related regressions:
https://luceeserver.atlassian.net/browse/LDEV-2827
https://luceeserver.atlassian.net/browse/LDEV-2743

Fixed

Assignee

Unassigned

Reporter

Brad Wood

Priority

Critical

Labels

Fix versions

Sprint

None

Affects versions

Configure