@@ -1047,7 +1047,7 @@ function _azureConditionalDelete(request, response, log, cb) {
10471047 const reqUids = log . getSerializedUids ( ) ;
10481048 return dataClient . delete ( objectGetInfo , reqUids , err => {
10491049 if ( err && err . code === 412 ) {
1050- log . info ( 'precondition for Azure deletion was not met' , {
1050+ log . error ( 'precondition for Azure deletion was not met' , {
10511051 method : '_azureConditionalDelete' ,
10521052 key : request . objectKey ,
10531053 bucket : request . bucketName ,
@@ -1086,7 +1086,7 @@ function _conditionalTagging(request, response, locations, log, cb) {
10861086 }
10871087 const ifUnmodifiedSince = request . headers [ 'if-unmodified-since' ] ;
10881088 if ( new Date ( ifUnmodifiedSince ) < new Date ( lastModified ) ) {
1089- log . info ( 'object has been modified, skipping tagging operation' , {
1089+ log . debug ( 'object has been modified, skipping tagging operation' , {
10901090 method : '_conditionalTagging' ,
10911091 ifUnmodifiedSince,
10921092 lastModified,
@@ -1103,7 +1103,7 @@ function _performConditionalDelete(request, response, locations, log, cb) {
11031103 const { headers } = request ;
11041104 const location = locationConstraints [ headers [ 'x-scal-storage-class' ] ] ;
11051105 if ( ! request . headers [ 'if-unmodified-since' ] ) {
1106- log . info ( 'unknown last modified time, skipping conditional delete' , {
1106+ log . debug ( 'unknown last modified time, skipping conditional delete' , {
11071107 method : '_performConditionalDelete' ,
11081108 } ) ;
11091109 return _respond ( response , null , log , cb ) ;
@@ -1387,10 +1387,18 @@ function routeBackbeat(clientIP, request, response, log) {
13871387 // Attach the apiMethod method to the request, so it can used by monitoring in the server
13881388 // eslint-disable-next-line no-param-reassign
13891389 request . apiMethod = 'routeBackbeat' ;
1390- log . debug ( 'routing request' , {
1391- method : 'routeBackbeat' ,
1390+ log . addDefaultFields ( {
1391+ clientIP ,
13921392 url : request . url ,
1393+ method : 'routeBackbeat' ,
1394+ resourceType : request . resourceType ,
1395+ bucketName : request . bucketName ,
1396+ objectKey : request . objectKey ,
1397+ bytesReceived : request . parsedContentLength || 0 ,
1398+ bodyLength : parseInt ( request . headers [ 'content-length' ] , 10 ) || 0 ,
13931399 } ) ;
1400+
1401+ log . debug ( 'routing request' ) ;
13941402 _normalizeBackbeatRequest ( request ) ;
13951403 const requestContexts = prepareRequestContexts ( 'objectReplicate' , request ) ;
13961404
@@ -1429,9 +1437,6 @@ function routeBackbeat(clientIP, request, response, log) {
14291437 if ( err ) {
14301438 log . debug ( 'authentication error' , {
14311439 error : err ,
1432- method : request . method ,
1433- bucketName : request . bucketName ,
1434- objectKey : request . objectKey ,
14351440 } ) ;
14361441 return responseJSONBody ( err , null , response , log ) ;
14371442 }
@@ -1444,8 +1449,6 @@ function routeBackbeat(clientIP, request, response, log) {
14441449 if ( userInfo . getCanonicalID ( ) === constants . publicId ) {
14451450 log . debug ( 'unauthenticated access to API routes' , {
14461451 method : request . method ,
1447- bucketName : request . bucketName ,
1448- objectKey : request . objectKey ,
14491452 } ) ;
14501453 return responseJSONBody (
14511454 errors . AccessDenied , null , response , log ) ;
@@ -1473,18 +1476,8 @@ function routeBackbeat(clientIP, request, response, log) {
14731476 ( backbeatRoutes [ request . method ] [ request . resourceType ]
14741477 [ request . query . operation ] === undefined &&
14751478 request . resourceType === 'multiplebackenddata' ) ) ;
1476- log . addDefaultFields ( {
1477- bucketName : request . bucketName ,
1478- objectKey : request . objectKey ,
1479- bytesReceived : request . parsedContentLength || 0 ,
1480- bodyLength : parseInt ( request . headers [ 'content-length' ] , 10 ) || 0 ,
1481- } ) ;
14821479 if ( invalidRequest || invalidRoute ) {
1483- log . debug ( invalidRequest ? 'invalid request' : 'no such route' , {
1484- method : request . method ,
1485- resourceType : request . resourceType ,
1486- query : request . query ,
1487- } ) ;
1480+ log . debug ( invalidRequest ? 'invalid request' : 'no such route' ) ;
14881481 return responseJSONBody ( errors . MethodNotAllowed , null , response , log ) ;
14891482 }
14901483
@@ -1494,9 +1487,6 @@ function routeBackbeat(clientIP, request, response, log) {
14941487 if ( err ) {
14951488 log . debug ( 'authentication error' , {
14961489 error : err ,
1497- method : request . method ,
1498- bucketName : request . bucketName ,
1499- objectKey : request . objectKey ,
15001490 } ) ;
15011491 }
15021492 // eslint-disable-next-line no-param-reassign
@@ -1507,11 +1497,7 @@ function routeBackbeat(clientIP, request, response, log) {
15071497 // TODO: understand why non-object requests (batchdelete) were not authenticated
15081498 if ( ! _isObjectRequest ( request ) ) {
15091499 if ( userInfo . getCanonicalID ( ) === constants . publicId ) {
1510- log . debug ( `unauthenticated access to backbeat ${ request . resourceType } routes` , {
1511- method : request . method ,
1512- bucketName : request . bucketName ,
1513- objectKey : request . objectKey ,
1514- } ) ;
1500+ log . debug ( `unauthenticated access to backbeat ${ request . resourceType } routes` ) ;
15151501 return responseJSONBody (
15161502 errors . AccessDenied , null , response , log ) ;
15171503 }
@@ -1559,12 +1545,7 @@ function routeBackbeat(clientIP, request, response, log) {
15591545 // target buckets with versioning enabled.
15601546 const isVersioningRequired = request . headers [ 'x-scal-versioning-required' ] === 'true' ;
15611547 if ( isVersioningRequired && ( ! versioningConfig || versioningConfig . Status !== 'Enabled' ) ) {
1562- log . debug ( 'bucket versioning is not enabled' , {
1563- method : request . method ,
1564- bucketName : request . bucketName ,
1565- objectKey : request . objectKey ,
1566- resourceType : request . resourceType ,
1567- } ) ;
1548+ log . debug ( 'bucket versioning is not enabled' ) ;
15681549 return next ( errors . InvalidBucketState ) ;
15691550 }
15701551 return backbeatRoutes [ request . method ] [ request . resourceType ] (
@@ -1586,12 +1567,12 @@ function routeBackbeat(clientIP, request, response, log) {
15861567 ( hook , done ) => hook ( err , done ) ,
15871568 ( ) => {
15881569 if ( err ) {
1570+ log . error ( 'error processing backbeat request' , {
1571+ error : err ,
1572+ } ) ;
15891573 return responseJSONBody ( err , null , response , log ) ;
15901574 }
1591- log . debug ( 'backbeat route response sent successfully' ,
1592- { method : request . method ,
1593- bucketName : request . bucketName ,
1594- objectKey : request . objectKey } ) ;
1575+ log . debug ( 'backbeat route response sent successfully' ) ;
15951576 return undefined ;
15961577 } ,
15971578 ) ) ;
0 commit comments