简体   繁体   中英

Setting up logging for buckets in Google Cloud Storage

Hey I don't what to write in the end of my command please help me.

在此处输入图片说明

According to the official documentation gsutil logging set on

The "gsutil logging set on" command will enable access logging of the buckets named by the specified URLs, outputting log files in the specified logging_bucket. logging_bucket must already exist, and all URLs must name buckets (eg, gs://bucket). The required bucket parameter specifies the bucket to which the logs are written, and the optional log_object_prefix parameter specifies the prefix for log object names. The default prefix is the bucket name. For example, the command:

      gsutil logging set on -b gs://my_logging_bucket -o AccessLog gs://my_bucket1 gs://my_bucket2

You should use a gs://URL (an existing bucket) , you are using only gs:// on your command

      gsutil logging set on -b logging_bucket [-o log_object_prefix] gs://kookipedia-logs

This command will output log files for gs://kookipedia-logs in the specified logging_bucket .

1) There should be two different buckets in the command -- the bucket at the end of the command is the bucket you're generating access logs for, and the bucket after the -b flag should be the bucket those logs get stored in.

2) The [-o log_object_prefix] part of example command that you copied is in square brackets, which indicates that it's an optional parameter you can provide. If you want to turn on logging for all objects in your bucket, rather than only logging objects with a specific prefix, you can just leave the -o argument out:

gsutil logging set on -b gs://BUCKET_YOUR_LOGS_SHOULD_GO_TO gs://BUCKET_TO_TURN_ON_LOGGING_FOR

If you wanted to include the -o argument, you'd provide it without square brackets:

gsutil logging set on -b gs://BUCKET_YOUR_LOGS_SHOULD_GO_TO -o /some/object-prefix/ gs://BUCKET_TO_TURN_ON_LOGGING_FOR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM