1

我正在尝试在我的项目中使用 Spotify DockerClient。该项目不是 Maven 项目,因此我使用 docker-client-8.11.7-shaded.jar 来解决所有依赖项。除了 apache.http.wire DEBUG 日志消息外,它工作正常。我整天都在搜索,试图弄清楚如何禁用它而没有任何成功。我尝试了以下方法:

  1. 创建一个 logback.xml 文件并将其放在我的 classes 文件夹中
  2. 使用处理程序名称的不同变体调整我的 log4j.properties 文件,包括
    • log4j.logger.httpclient.wire=错误
    • log4j.logger.httpclient.wire.header=错误
    • log4j.logger.org.apache.commons.httpclient=错误
    • log4j.logger.org.apache.http.wire=错误
    • log4j.logger.org.apache.http.headers=错误
    • log4j.logger.httpclient=错误

等等...

我确保在我的类路径中没有其他 log4j.properties 文件或 log4j.xml 文件。有谁知道我还能尝试什么?我无法运行我的单元测试,因为转储到屏幕上的信息量使其毫无用处。这是我所看到的示例:

8-07-07 15:56:14.874] apache.http.wire:72 [调试] => http-outgoing-1 >> [0xdf]~5c[0xb][0xac][0x16][0xde][0x8f]它[0xa0][0x1f][0xb5][0xc4][\n]" 18-07-07 15:56:14.874] apache.http.wire:72 [调试] => http-outgoing-1 >> "[ 0xa4][0x83][0xe8][0x17][0xb2]Y;[0xa6][0xb6]Y[0xea]>[0xf9]g[0x96]h"[0x8b][0xfa]?c[0x13]C[0xb3 ]"[0xbb][0xe9]{=y49[0x2][0xc7]g{g[0xa3]k5R[0x8c][0xf4][0xa3][0xfc][0x94]U[0xc]D{[0xbe][0xe3 ]f^D[0xa1][0xd7][0x16][0x8d]&[0x12]Y[0xb4]jx7[0xcc][0xa9][0x82]5[0xc1][0x80][0xfc][0xee][0xb5][0xa4]3[0xd2][0x98][0xf4][0xaa]O:[0xb1])-j[0x9b][0xfa][0xaa]5[0x19][0x90][0xc7][0x5][0xd3][0x8e]a[0xd6]N[0x9]}dz*[0xaf][0xc7][0xc][0xbb][0xb4]P^[0x85][[0x81][0xd4][0x8c]~-z[0xe2][0xbc][0xa7]8N[0xfb][0x98][0xca][0x84][0xdf]Sa[0x15][7[0xa3][0x98][0xd6])[0xdf][0x6][0xc7][0xb3][0x13]d[0x1a][0x8c][0x17]F[0x8a][0xd4][0xe0][0xdc]I[0xd9][0xab][0x12][0xab][0xdd][0x7]8,[0x96][0x9d][0xba][0xcc][0xde][0xcf]Z[0xcd][0xcb][0xcd][0x8e]D[0x80]c[0xb4]hV[0xcc]uc[0x10][0xa7][0xc7]o[0x1][0x98]y[0xb1]0NQ[0x89]5[0xe7]m$%z8[0xbc]nF[0xb0]Z[0x86]j[0x97][0x15]W[0xe6]W[0xff][0x8a][0xd0][0x9d](pT[0x86][0xfe][0xd2][0xa9]cNz[0x5]1[0xc6][0x11][0xc0][0x8d][0xb][0x84] [0xb2]][0xf8][0x0]X6y[0x89]K[0x92][0xcc][0x10]JH[0x8e][0x8][0xed]~[0x9e]Bn[0xb9][0xc8]>[0xe2][0xa6][0x87]:?}[0xbb][0xbd][0xc0][0xad][0xdb]>-[0x9e][0x94][0x9f]e[0xe6][0x84][0x18][0xf5][0x9f][0xe7][0xb1][0x17][0x92]K[0x1b][0x85]Z[0xcd][0xf6][0xa9][0xfa][0xe4][0x9][0x99][0xaa][0xf9][0xfa]=4w[0xf1]m[0xc8][0xc8]uB[0xe8][0xf0][0xbf]D[0xbd]o[0xdd]P[0xf2]G+[0xa3][0xc5][0xdf],[0xf0]-[0x15][0x8b][0xd2][0xe][0xee][0xb9]H[0x97][0xf2][0xae][0xbd]D#4[0xe0],[0x8f]/[0xa6][0xa7][0x80]|[0x1a][0x19][0x1a][0x86][0xdc][0xa3][0xc7][0xc2][0xa9][0x96][0x9b]Z[0xcc][0xc5]^[0xde]P'0M;^B[0x3][0xa1]B[0x9b]y[0xa0][0xe0]g[0x9]o[0x8c][0x9f ]u[0x14][0x9a]QiJ[0xe3]\9[\n]" 18-07-07 15:56:14.874] apache.http.wire:72 [调试] => http-outgoing-1 >>" [0xdf][0xc8][0x8e]7[\n]" 18-07-07 15:56:14.875] apache.http.wire:72 [调试] => http-outgoing-1 >> "[0x8a][ \n]" 18-07-07 15:56:14.875] apache.http.wire:72 [调试] => http-outgoing-1 >> "[0x5][0xe3] [0xc2] [0xad]BA[0x13 ][0xe0]0W[0x8d]C[0xf8][\n]" 18-07-07 15:56:14.875] apache.http.wire:72 [调试] => http-outgoing-1 >> "[0xac ][0xe4][0xa5]@[0xb2][0xb5][0x16]H#[0xbe]f[0x94][0x95]l?/>%[0xae][0xcc]O[0x9a][0xa4][0x81] [0xc7][0xba]+[0xa0][0xb6]BwW[0xd7][0x14][0x1c]w[0xe1][0x94][0xa5]{[0x90]&j[0xca][0xdf][0xa8][0xae][0xc0][0xf2][0xa4]Q[0xc][0xb9]E[0x9c][0xa8][0xf9][\r][0x81][0xc4]E[0x93]d1[0x8c][0xd1]_@[0x9e][0xd8][0x1c]|m[0x88][0xe1][0xac][0xe6][0xb5]A[0xb5][0xb9][0xb3][0xda][0xed]jQ[0xf8]A[\r]+[0x16][0xf5][0x9e]i[0xb2][0xbc]eN[0xa1][0x96][0xdd][0xf9]=A[0xac][0xb7]*+[0xf5]G[0xee][0x82].kU[0xa2][0xeb][0xe8][0xb5][0x89][0xa8][0x94][0xfc]j[0x88][0xb6][0xfc][0xa8]RZ?`[0xc4][0xe8][0xe6]H[0x9e][0xe4][0x89][0x12]f[0x88]w[0x8f]7[0x82][0xdf][ 0x12][0x9a][0xf5][0xfb][0x1a]O:[0xfd]1[0xb7]^?[0x1f][0xe0][0xb5][0xc2]=[0x3][0xe5][0xe2][0x9c] m[0x1]z[0xf9]k[0xda][0xa9][0xc9],[0xdf][0xd1]d[0x1c][0x1][0x1e]+M[0x1d][0xcb][0xc5][0xf][ 0xc][0xf8][0xaa]d[0x10]=svS[0xd0]:5[0x1f]'[0xe9][0xf6]![0x9b][0x6]xp[0x8a][0x8][0xf4]l[0xe9] [0xc5]R[0xfb][0x8b][0xbc][0x8][0x83][0x8]N[0xf]=[0xb8][0xbd][0x12][0xd5][0xb9]Q[0xc0]b[0x86] 9[0xc1]\LR>'[0xed]a1[0x6][0xe6]x[0xc9]d"[0x16][0xa6]CNf\=[0xfa]Y{[0x3][0xee][0xc7][0xc4] ?(Q[0xc]Y[0x91][0x9][0xf9]][0xda]h7<[0xca][0xc8][0x93]0&[0xe8]g[0xe3]j[0xbe]Kk[\n]" 18 -07-07 15:56:14.875] apache.http.wire:72 [调试] => http-outgoing-1 >> "[0x86][0xdf][0x8d][0xf3]u[0xa9][0xa2][0x83][0xc6][0xc1][0xb4][0x3][0xad][0xc3]Yf[0xe]E[0x85][0x0 ][0x9b]5[0x90][0x95][0x8c]N~[0xa9])}w[0xc5][0xe2][0xd9]g[0xaf]'[0x97][0xfa][0x10]1[0xc2][ 0xc][0x19]}V[0x8a][0x9][0xae]z![0x92][0xcb][0xb0]Q[0x85][0xd8][0xd8],[0x18]3[0xaf][0x6][\ r][0xb1]x[0x18][\n]" 18-07-07 15:56:14.875] apache.http.wire:72 [调试] => http-outgoing-1 >> "JeF[0x16][ 0x12]/[0xf1][0x9f][0x15][0xe0][0x7][0xb8][0xa4][0xb2]z8A[0x83][0x80]8\'[0x84][0x15][0x16][0xeb][ 0xe4][0x17][0xd4]k[0xfc][0x9]2)[0x9a][0xea][0x83]q[0x97][0xcf][0xef][0x93][0x6]7[0xcb]H+"a[ 0xc9][0xa1]R[0x19]v}[0x99]F[0xae][0x15]Q[0xa2]{[0xdc]v[0xe9][0xcf][0x5][0xc4]G_[0x85][0x8a]= ip[0x80][0x94]EHk[0x8d]u[0xa8][0xa7][0xad][0xbf][0xa1][0x8d][0xb7][0xf6][0x80]"e[0x1e][0xc5][0xd2][0xed][0xef][0xe8][0xb7][0xb6]X[0xab]C[0xd3]-[0xa0][0x9f][0xae]I[0x9]+FeB?Kw[0xe4][0x16]7[[0xc3]+E[0xd2]>[0xc8]y[0xff][0xf0]&t[0x12]k[0x1b][0xb8][0x99][0x1d][0xb6][0x14 ]6[0x92][0xde][0xe8][0x8b]aA[0xd3][0x13]Q[0xfa]I[0xbb][0x12]46ScM6.[0xb7][0x1][0xfb]G[0xb7][0xe4] [0xa7][0xd9][0xbf][0xee]9[0xf2][0xc5][0xf0]+[0xbd][0x1e][0xbd][0xc6]t[0xa9][0x0]C[0xc5][0xf2][ 0x94][0xf0][0xd0][0xfb];[0xf]Y[0xf1][0xfd][0xe5][0x3][0x1a][0xe7][0xc7]y[0xe5][0xc3]BV[0xb2][0x90 ][0xf7][0xa8][0x90][0x97][0xac][0x92][0x9d]hU[0xab]#[0xb9]5X[0x94]DQB[0xdc]7[0x8e][0x83]z[0xf4][0xf5 ][0xdf][0xed][0xf7][0xee][0x8f][0x18][0xc6][0x2]=Z"[0xc7][0xcc][0xba][0x8f][0xa2][\r]r[0xd9 ]f>[0x97][0x8][0x85][0xa0]U[0x7][0xba][0xd7]l[0xe5][0xf7]][0x16]z[0xb]O[0x83]H[0xd5][0xef ]EQ[0xa2]%D[0xfa][0x14][0xf3][0xd2]Cj[0x9c][0x0][0xe4][0xb7][0xb8][0x98]j[0xee]T&[0xb8]x[0x15] =[0x86]s[0xa7][0xfe][0xaa]S[0xe2]r[0x7]J?[0x91][0xb8]$[0xf6][0xf8][0xa1][0xd8]xF[0xcc]<[0x8b ][0x13][0xf0]l[0xac][0x12][0xc][0xa6][0x5]0[0xb3]A[0xa7][0x9a][0xce][0x84]E/[0x96][0xe7]D[ 0xd9]P[0x98][0xdd][0x9e]>[0xb8][0x11]O[0xb9][0xa7][0xf1]Kl[0xa2][0x12]m[0x15][0xbf]:R[0xdb][0xf4][0xa2][0xdb][0x9]X[0x8];[0x9f]O[0xd6][0xe2][0xd5][0xaa][0x8e][0xd0][0x9b] [0xc][0xf0]}[0xf7][0xf2][@[0x8a]Z[0xc][0x6][0xd1]#[0xf3][0xa9][0xe9][0xe6][0xde][0xa1][0xad] [0xc4][0x8][0x18][0x95][0xfb][0xe1]R[0x6][0xe6][0xde]R+[0x12][0xc4][0x86][0x93][0x81]I[0xd1][0xa0 ][0x96][0xff][0xae]P[0xa1]K[0xc1]C[0xcb][[0x8a][0x86][0xf5][0xb3][0x10]$[0xad][0xab][0x90][0xe8 ][0xfa][0xd1][0xf3][0x1d][0xa6]0fS=[0xa8]ple*[0x95][0xec][0xa4]-q[0xdb][0xff][0xdb][0xb5][0xfc]i [0x83][0xad][0x9d][0xbd][\n]""

任何帮助将不胜感激。谢谢,

4

1 回答 1

0

了解如何将其关闭。基本上因为它是有阴影的,所以禁用所有这些日志消息的最佳方法是添加log4j.logger.com.spotify=INFO到我的 log4j 中。这很好,因为所有阴影文件都在com.spotify/docker/client/shaded/.....

于 2018-07-08T17:28:52.693 回答