summaryrefslogtreecommitdiffstats
path: root/utils/file.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-09-05 15:24:21 -0400
committerGitHub <noreply@github.com>2017-09-05 15:24:21 -0400
commit09f8267751c71bdb6d8ba2757a1e4ffe62ccf5c3 (patch)
treed540c42e07195d62c8555c05ca5e57becf5542a6 /utils/file.go
parentcc289d70610ada2797c7a07dce013fd4d89bcc10 (diff)
downloadchat-09f8267751c71bdb6d8ba2757a1e4ffe62ccf5c3.tar.gz
chat-09f8267751c71bdb6d8ba2757a1e4ffe62ccf5c3.tar.bz2
chat-09f8267751c71bdb6d8ba2757a1e4ffe62ccf5c3.zip
PLT-7517 Added setting to enable tracing of Amazon S3 connections (#7349)
* PLT-7517 Added setting to enable tracing of Amazon S3 connections * Removed unnecessary placeholders on boolean settings * Added AmazonS3Trace to diagnostics * Updated AmazonS3Trace setting name in system console * Removing extra colon
Diffstat (limited to 'utils/file.go')
-rw-r--r--utils/file.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/file.go b/utils/file.go
index 0ba132b09..19fa335c4 100644
--- a/utils/file.go
+++ b/utils/file.go
@@ -33,7 +33,17 @@ func s3New(endpoint, accessKey, secretKey string, secure bool, signV2 bool, regi
} else {
creds = credentials.NewStatic(accessKey, secretKey, "", credentials.SignatureV4)
}
- return s3.NewWithCredentials(endpoint, creds, secure, region)
+
+ s3Clnt, err := s3.NewWithCredentials(endpoint, creds, secure, region)
+ if err != nil {
+ return nil, err
+ }
+
+ if *Cfg.FileSettings.AmazonS3Trace {
+ s3Clnt.TraceOn(os.Stdout)
+ }
+
+ return s3Clnt, nil
}
func TestFileConnection() *model.AppError {