public class BucketLoggingConfiguration
extends java.lang.Object
implements java.io.Serializable
Represents bucket logging configuration used to control bucket-based server access logging in Amazon S3.
For logging to be enabled for a bucket both the
destinationBucketName
and logfilePrefix
must not be
null
, and the named bucket must exist. When both variables are
not null
, this object represents an enabled logging
configuration (as indicated by isLoggingEnabled()
).
If either the targetBucketName
or logfilePrefix
are
null
, this object represents a disabled logging
configuration (as indicated by isLoggingEnabled()
).
Server access logging can be enabled or disabled with
AmazonS3Client.setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest)
and the current status of server access logging for a bucket can be retrieved
through AmazonS3Client.getBucketLoggingConfiguration(String)
Constructor and Description |
---|
BucketLoggingConfiguration()
Creates a new bucket logging configuration, which by default is
disabled.
|
BucketLoggingConfiguration(java.lang.String destinationBucketName,
java.lang.String logFilePrefix)
Creates a new bucket logging configuration which enables server access
logs to be collected and stored in the specified destination bucket with
the specified log file prefix.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDestinationBucketName()
Returns the destination bucket name for this logging configuration.
|
java.lang.String |
getLogFilePrefix()
Returns the optional log file prefix.
|
boolean |
isLoggingEnabled()
Returns true if logging is enabled.
|
void |
setDestinationBucketName(java.lang.String destinationBucketName)
Sets the destination bucket name for this logging configuration.
|
void |
setLogFilePrefix(java.lang.String logFilePrefix)
Sets the log file prefix for this bucket logging configuration.
|
java.lang.String |
toString() |
public BucketLoggingConfiguration()
Passing this new object directly to
AmazonS3.setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest)
will turn off bucket logging for the specified bucket.
public BucketLoggingConfiguration(java.lang.String destinationBucketName, java.lang.String logFilePrefix)
destinationBucketName
- The name of the bucket to which to delivery
server access logs from the target bucket. This may be the
same bucket for which logging is being configured.logFilePrefix
- The optional prefix to append to server access logs
when they are written to the destination bucket.public boolean isLoggingEnabled()
public java.lang.String getLogFilePrefix()
public void setLogFilePrefix(java.lang.String logFilePrefix)
logFilePrefix
- The log file prefix for this logging configuration.public java.lang.String getDestinationBucketName()
public void setDestinationBucketName(java.lang.String destinationBucketName)
destinationBucketName
- The destination bucket name for this logging
configuration.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.