Class BucketLoggingConfiguration
- java.lang.Object
-
- com.amazonaws.services.s3.model.BucketLoggingConfiguration
-
- All Implemented Interfaces:
Serializable
public class BucketLoggingConfiguration extends Object implements 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
andlogfilePrefix
must not benull
, and the named bucket must exist. When both variables are notnull
, this object represents an enabled logging configuration (as indicated byisLoggingEnabled()
).If either the
targetBucketName
orlogfilePrefix
arenull
, this object represents a disabled logging configuration (as indicated byisLoggingEnabled()
).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 throughAmazonS3Client.getBucketLoggingConfiguration(String)
-
-
Constructor Summary
Constructors Constructor Description BucketLoggingConfiguration()
Creates a new bucket logging configuration, which by default is disabled.BucketLoggingConfiguration(String destinationBucketName, 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDestinationBucketName()
Returns the destination bucket name for this logging configuration.String
getLogFilePrefix()
Returns the optional log file prefix.boolean
isLoggingEnabled()
Returns true if logging is enabled.void
setDestinationBucketName(String destinationBucketName)
Sets the destination bucket name for this logging configuration.void
setLogFilePrefix(String logFilePrefix)
Sets the log file prefix for this bucket logging configuration.String
toString()
-
-
-
Constructor Detail
-
BucketLoggingConfiguration
public BucketLoggingConfiguration()
Creates a new bucket logging configuration, which by default is disabled.Passing this new object directly to
AmazonS3.setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest)
will turn off bucket logging for the specified bucket.
-
BucketLoggingConfiguration
public BucketLoggingConfiguration(String destinationBucketName, 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.- Parameters:
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.
-
-
Method Detail
-
isLoggingEnabled
public boolean isLoggingEnabled()
Returns true if logging is enabled.- Returns:
- True if logging is enabled.
-
getLogFilePrefix
public String getLogFilePrefix()
Returns the optional log file prefix.- Returns:
- The optional log file prefix.
-
setLogFilePrefix
public void setLogFilePrefix(String logFilePrefix)
Sets the log file prefix for this bucket logging configuration.- Parameters:
logFilePrefix
- The log file prefix for this logging configuration.
-
getDestinationBucketName
public String getDestinationBucketName()
Returns the destination bucket name for this logging configuration.- Returns:
- The destination bucket name for this logging configuration.
-
setDestinationBucketName
public void setDestinationBucketName(String destinationBucketName)
Sets the destination bucket name for this logging configuration.- Parameters:
destinationBucketName
- The destination bucket name for this logging configuration.
-
-