@@ -112,10 +112,10 @@ export default class httpClient {
112112
113113 async request ( config : AxiosRequestConfig , log : Logger ) : Promise < Record < string , any > > {
114114 log . debug ( `http request: ${ config . method } ${ config . url } ` ) ;
115- if ( config && config . data && ! config . data . skipLogging && ! config . data . name && ! config . data . snapshot ) {
115+ if ( config && config . data && ! config . data . skipLogging && ! config . data . name && ! config . data . snapshot && config . method !== 'PUT' ) {
116116 log . debug ( config . data ) ;
117117 }
118- if ( config && config . data && ! config . data . skipLogging && config . data . snapshotUuid ) {
118+ if ( config && config . data && ! config . data . skipLogging && config . data . snapshotUuid && config . method !== 'PUT' ) {
119119 log . debug ( config . data ) ;
120120 }
121121 return this . axiosInstance . request ( config )
@@ -611,7 +611,24 @@ export default class httpClient {
611611 }
612612
613613 uploadLogs ( ctx : Context , uploadURL : string ) {
614- const logContent = fs . readFileSync ( constants . LOG_FILE_PATH ) ;
614+ const fileStream = fs . createReadStream ( constants . LOG_FILE_PATH ) ;
615+ const { size } = fs . statSync ( constants . LOG_FILE_PATH ) ;
616+
617+ return this . request ( {
618+ url : uploadURL ,
619+ method : 'PUT' ,
620+ headers : {
621+ 'Content-Type' : 'text/plain' ,
622+ 'Content-Length' : size ,
623+ } ,
624+ data : fileStream ,
625+ maxBodyLength : Infinity , // prevent axios from limiting the body size
626+ maxContentLength : Infinity , // prevent axios from limiting the content size
627+ } , ctx . log )
628+ }
629+
630+ uploadLogsForCaps ( ctx : Context , uploadURL : string ) {
631+ const logContent = fs . readFileSync ( constants . LOG_FILE_PATH )
615632 const { size } = fs . statSync ( constants . LOG_FILE_PATH ) ;
616633
617634 return this . request ( {
0 commit comments