Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpRequest content log level should be lower than CONFIG #1782

Open
takaaki7 opened this issue Nov 13, 2022 · 0 comments
Open

HttpRequest content log level should be lower than CONFIG #1782

takaaki7 opened this issue Nov 13, 2022 · 0 comments

Comments

@takaaki7
Copy link

takaaki7 commented Nov 13, 2022

Is your feature request related to a problem? Please describe.
I'm using gradle build cache with gcs and run gradle build with --info flag, then noisy binary log is printed.

like

curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'User-Agent: gcloud-java/1.118.1 Google-API-Java-Client/1.32.1 Google-HTTP-Java-Client/1.39.2 (gzip)' -H 'x-goog-user-project: xxxx' -H 'x-goog-api-client: gl-java/17.0.1 gdcl/1.32.1 mac-os-x/11.6.7' -H 'Content-Type: multipart/related; boundary=__END_OF_PART__a3ce17b2-df8f-4a14-9016-2542961b36e5__' -H 'Content-Encoding: gzip' -d '@-' -- 'https://storage.googleapis.com/upload/storage/v1/b/xxxx/o?projection=full&uploadType=multipart' << $$$
Total: 1,321,887 bytes (logging first 16,384 bytes)
--__END_OF_PART__a3ce17b2-df8f-4a14-9016-2542961b36e5__
Content-Length: 111
Content-Type: application/json; charset=UTF-8
content-transfer-encoding: binary

{"bucket":"xxxx","crc32c":null,"md5Hash":null,"name":"42494ef11e5597b38d47c8bf1d9d7bb6"}
--__END_OF_PART__a3ce17b2-df8f-4a14-9016-2542961b36e5__
Content-Type: application/octet-stream
content-transfer-encoding: binary

 �       ��} @ ב���z Z  ]� Y  �KH �B�$d@2 �H���40 ���A��؉���s_r�M ;��D�-��$V.gs���$�c���+�����n�I։���=���3� f����~���z��իW��������� /�UQYQ�����B�b� �*k
+k��k*+�j*� )~]e%
�4� p�4O�?� ��� Tm>�
]c�� �������m����k�  tu VUTUٵ3Z� ����h�*+j�v؇��P�� C�n�Io���#n���ݿ��?Yz(�/ ������ �=�z۶��U��U�۫+�^�� yCgw�T���?��<7���GF��� �)��o�;�i���|8�VϮ��� �n���6|b��ĩ��CgG�]��`�`�� ��ܣ�2�/� |�Ა;x2Xf�����[�O�1* ��v�( �� �:  i#� 
� �

I guess that this log is printed by HttpRequest.java and LoggingByteArrayOutputStream.java
https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L891

And maybe CONFIG level of java.util.logging is mapped to INFO level of gradle logging system.

Describe the solution you'd like
I think generally http request body is not static information, and CONFIG level is not appropriate.

CONFIG messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations. For example, CONFIG message might include the CPU type, the graphics depth, the GUI look-and-feel, etc. This level is initialized to 700.

https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html#CONFIG

FINE, FINER or FINEST maybe appropriate.

Describe alternatives you've considered
I couldn't find out a workaround, the way to set log level for specific logger in gradle...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant