@Override
    public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException {
        // Logging target bucket
        final Path bucket = containerService.getContainer(file);
        try {
            final S3BucketLoggingStatus status = new S3BucketLoggingStatus(
                    StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() :
                            bucket.isRoot() ? RequestEntityRestStorageService.findBucketInHostname(session.getHost()) : bucket.getName(), null);
            if(configuration.isEnabled()) {
                status.setLogfilePrefix(new HostPreferences(session.getHost()).getProperty("s3.logging.prefix"));
            }
            session.getClient().setBucketLoggingStatus(bucket.isRoot() ? StringUtils.EMPTY : bucket.getName(), status, true);
        }
        catch(ServiceException e) {
            throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
    }
@Test(expected = NotfoundException.class)
    public void testWriteNotFound() throws Exception {
        new S3LoggingFeature(session).setConfiguration(
            new Path(UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)), new LoggingConfiguration(false)
        );
    }