Add more logs

This commit is contained in:
David Pilato 2016-05-18 16:43:56 +02:00
parent cfedda5291
commit d85dac7a9a
1 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public boolean blobExists(String blobName) { public boolean blobExists(String blobName) {
logger.debug("blobExists({})", blobName);
try { try {
return blobStore.blobExists(blobStore.container(), buildKey(blobName)); return blobStore.blobExists(blobStore.container(), buildKey(blobName));
} catch (URISyntaxException | StorageException e) { } catch (URISyntaxException | StorageException e) {
@ -72,6 +73,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public InputStream readBlob(String blobName) throws IOException { public InputStream readBlob(String blobName) throws IOException {
logger.debug("readBlob({})", blobName);
try { try {
return blobStore.getInputStream(blobStore.container(), buildKey(blobName)); return blobStore.getInputStream(blobStore.container(), buildKey(blobName));
} catch (StorageException e) { } catch (StorageException e) {
@ -86,6 +88,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize) throws IOException { public void writeBlob(String blobName, InputStream inputStream, long blobSize) throws IOException {
logger.debug("writeBlob({}, stream, {})", blobName, blobSize);
try (OutputStream stream = createOutput(blobName)) { try (OutputStream stream = createOutput(blobName)) {
Streams.copy(inputStream, stream); Streams.copy(inputStream, stream);
} }
@ -93,6 +96,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public void writeBlob(String blobName, BytesReference bytes) throws IOException { public void writeBlob(String blobName, BytesReference bytes) throws IOException {
logger.debug("writeBlob({}, bytes)", blobName);
try (OutputStream stream = createOutput(blobName)) { try (OutputStream stream = createOutput(blobName)) {
bytes.writeTo(stream); bytes.writeTo(stream);
} }
@ -115,6 +119,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public void deleteBlob(String blobName) throws IOException { public void deleteBlob(String blobName) throws IOException {
logger.debug("deleteBlob({})", blobName);
try { try {
blobStore.deleteBlob(blobStore.container(), buildKey(blobName)); blobStore.deleteBlob(blobStore.container(), buildKey(blobName));
} catch (URISyntaxException | StorageException e) { } catch (URISyntaxException | StorageException e) {
@ -125,6 +130,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public Map<String, BlobMetaData> listBlobsByPrefix(@Nullable String prefix) throws IOException { public Map<String, BlobMetaData> listBlobsByPrefix(@Nullable String prefix) throws IOException {
logger.debug("listBlobsByPrefix({})", prefix);
try { try {
return blobStore.listBlobsByPrefix(blobStore.container(), keyPath, prefix); return blobStore.listBlobsByPrefix(blobStore.container(), keyPath, prefix);
@ -136,6 +142,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public void move(String sourceBlobName, String targetBlobName) throws IOException { public void move(String sourceBlobName, String targetBlobName) throws IOException {
logger.debug("move({}, {})", sourceBlobName, targetBlobName);
try { try {
String source = keyPath + sourceBlobName; String source = keyPath + sourceBlobName;
String target = keyPath + targetBlobName; String target = keyPath + targetBlobName;
@ -154,6 +161,7 @@ public class AzureBlobContainer extends AbstractBlobContainer {
@Override @Override
public Map<String, BlobMetaData> listBlobs() throws IOException { public Map<String, BlobMetaData> listBlobs() throws IOException {
logger.debug("listBlobs()");
return listBlobsByPrefix(null); return listBlobsByPrefix(null);
} }