googleapis / googleapis/google-http-java-client

HttpRequest content log level should be lower than CONFIG

Offen
#1,782 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
type: feature request
Vorherrschende Sprache
Java
Sterne
1.4k
Forks
473
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Is your feature request related to a problem? Please describe.**
I'm using [gradle build cache with gcs](https://github.com/tehlers/gradle-gcs-build-cache) 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: ' -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
https://github.com/googleapis/google-http-java-client/blob/5ddb634887601bfad64ac482643f65c820b55fd4/google-http-client/src/main/java/com/google/api/client/util/LoggingByteArrayOutputStream.java#L107

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...

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.