Browse Source

logging

pull/8292/head
Chris Lu 13 hours ago
parent
commit
428ef2b75f
  1. 1
      weed/filer/filer.go
  2. 4
      weed/s3api/s3api_object_handlers_put.go

1
weed/filer/filer.go

@ -309,6 +309,7 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di
dirEntry.Extended = map[string][]byte{
s3_constants.ExtS3ImplicitDir: []byte("true"),
}
glog.InfofCtx(ctx, "ensureParentDirectoryEntry: implicit directory created %s", dirPath)
}
glog.V(2).InfofCtx(ctx, "create directory: %s %v", dirPath, dirEntry.Mode)

4
weed/s3api/s3api_object_handlers_put.go

@ -139,6 +139,8 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
fullDirPath = fullDirPath + "/" + dirName
}
glog.Infof("PutObjectHandler: explicit directory marker %s/%s (contentType=%q, len=%d)",
bucket, object, objectContentType, r.ContentLength)
if err := s3a.mkdir(
fullDirPath, entryName,
func(entry *filer_pb.Entry) {
@ -148,8 +150,6 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
if r.ContentLength > 0 {
entry.Content, _ = io.ReadAll(r.Body)
}
// Explicitly PUT-created directory markers stay explicit.
// Only auto-created parent directories are tagged as implicit.
entry.Attributes.Mime = objectContentType
// Set object owner for directory objects (same as regular objects)

Loading…
Cancel
Save