class GoogleStorageLoggingFeature implements Logging, DistributionLogging {

    @Override
    public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException {
        try {
            session.getClient().buckets().patch(container.getName(),
                new Bucket().setLogging(new Bucket.Logging()
                    .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null)
                    .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName()))
            ).execute();
        }
        catch(IOException e) {
            throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container);
        }
    }

    public  GoogleStorageLoggingFeature(final GoogleStorageSession session);

}