You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/07/28 14:21:31 UTC
[GitHub] markusthoemmes commented on a change in pull request #3903:
Manually create user log files
markusthoemmes commented on a change in pull request #3903: Manually create user log files
URL: https://github.com/apache/incubator-openwhisk/pull/3903#discussion_r205944684
##########
File path: common/scala/src/main/scala/whisk/core/containerpool/logging/DockerToActivationFileLogStore.scala
##########
@@ -87,9 +92,11 @@ class DockerToActivationFileLogStore(system: ActorSystem, destinationDirectory:
val size = element.size
if (bytesRead + size > maxSize) {
bytesRead = size
- val newLogFile = destinationDirectory.resolve(s"userlogs-${Instant.now.toEpochMilli}.log")
- logging.info(this, s"Rotating log file to '$newLogFile'")
- Some(newLogFile)
+ val logFilePath = destinationDirectory.resolve(s"userlogs-${Instant.now.toEpochMilli}.log")
+ logging.info(this, s"Rotating log file to '$logFilePath'")
+ Files.createFile(logFilePath, attr)
+ Files.setPosixFilePermissions(logFilePath, perms)
Review comment:
Both of these can throw an IOException. I'm assuming such an error would cause the wrapping RetrySink to trigger a restart? Should we make sure the message is logged accordingly?
These two lines seem to be redundant, aren't the parameters already passed in the `createFile` call?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services