This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 45fca53  Include rotating user log filename in system logs. (#3830)
45fca53 is described below

commit 45fca53c7db25b8aa297ec8a070c5d057bbbc88e
Author: James Dubee <jwdu...@us.ibm.com>
AuthorDate: Tue Jul 3 03:10:10 2018 -0400

    Include rotating user log filename in system logs. (#3830)
---
 .../containerpool/logging/DockerToActivationFileLogStore.scala    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/common/scala/src/main/scala/whisk/core/containerpool/logging/DockerToActivationFileLogStore.scala
 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/DockerToActivationFileLogStore.scala
index 3368d2a..23d6657 100644
--- 
a/common/scala/src/main/scala/whisk/core/containerpool/logging/DockerToActivationFileLogStore.scala
+++ 
b/common/scala/src/main/scala/whisk/core/containerpool/logging/DockerToActivationFileLogStore.scala
@@ -27,7 +27,7 @@ import akka.stream.{Graph, SinkShape, UniformFanOutShape}
 import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Keep, MergeHub, Sink, 
Source}
 import akka.util.ByteString
 
-import whisk.common.TransactionId
+import whisk.common.{AkkaLogging, TransactionId}
 import whisk.core.containerpool.Container
 import whisk.core.entity.{ActivationLogs, ExecutableWhiskAction, Identity, 
WhiskActivation}
 import whisk.core.entity.size._
@@ -50,6 +50,8 @@ import scala.concurrent.Future
 class DockerToActivationFileLogStore(system: ActorSystem, 
destinationDirectory: Path = Paths.get("logs"))
     extends DockerToActivationLogStore(system) {
 
+  private val logging = new AkkaLogging(system.log)
+
   /**
    * End of an event as written to a file. Closes the json-object and also 
appends a newline.
    */
@@ -83,7 +85,9 @@ class DockerToActivationFileLogStore(system: ActorSystem, 
destinationDirectory:
           val size = element.size
           if (bytesRead + size > maxSize) {
             bytesRead = size
-            
Some(destinationDirectory.resolve(s"userlogs-${Instant.now.toEpochMilli}.log"))
+            val newLogFile = 
destinationDirectory.resolve(s"userlogs-${Instant.now.toEpochMilli}.log")
+            logging.info(this, s"Rotating log file to '$newLogFile'")
+            Some(newLogFile)
           } else {
             bytesRead += size
             None

Reply via email to