Skip to content

Commit

Permalink
BCDA-624: Use os.O_APPEND mode for error/request logs (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnagle authored Dec 4, 2018
1 parent a3147ab commit 2fcbe95
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bcda/client/bluebutton.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
filePath := os.Getenv("BCDA_BB_LOG")

/* #nosec -- 0640 permissions required for Splunk ingestion */
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY, 0640)
file, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0640)

if err == nil {
logger.SetOutput(file)
Expand Down
2 changes: 1 addition & 1 deletion bcda/logging/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewStructuredLogger() func(next http.Handler) http.Handler {
filePath := os.Getenv("BCDA_REQUEST_LOG")

/* #nosec -- 0640 permissions required for Splunk ingestion */
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY, 0640)
file, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0640)

if err == nil {
logger.SetOutput(file)
Expand Down
2 changes: 1 addition & 1 deletion bcda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func init() {
filePath := os.Getenv("BCDA_ERROR_LOG")

/* #nosec -- 0640 permissions required for Splunk ingestion */
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY, 0640)
file, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0640)

if err == nil {
log.SetOutput(file)
Expand Down

0 comments on commit 2fcbe95

Please sign in to comment.