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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3412d9c  Fixed the filename of the log files in threaded mode (#1890)
3412d9c is described below

commit 3412d9c969608f81bc8d53a30237967003738575
Author: Sanjeev Kulkarni <[email protected]>
AuthorDate: Fri Jun 1 10:55:39 2018 -0700

    Fixed the filename of the log files in threaded mode (#1890)
---
 conf/log4j2.yaml                                                        | 2 +-
 .../java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/conf/log4j2.yaml b/conf/log4j2.yaml
index 57ce64f..2462ba6 100644
--- a/conf/log4j2.yaml
+++ b/conf/log4j2.yaml
@@ -126,7 +126,7 @@ Configuration:
                   -
                     RollingFile:
                       name: "Rolling-${ctx:function}"
-                      fileName : 
"${sys:pulsar.log.dir}/functions/${ctx:function}/${sys:pulsar.log.file}-${ctx:instance}.log"
+                      fileName : 
"${sys:pulsar.log.dir}/functions/${ctx:function}/${ctx:functionname}-${ctx:instance}.log"
                       filePattern : 
"${sys:pulsar.log.dir}/functions/${sys:pulsar.log.file}-${ctx:instance}-%d{MM-dd-yyyy}-%i.log.gz"
                       PatternLayout:
                         Pattern: "%d{ABSOLUTE} %level{length=5} [%thread] 
[instance: %X{instance}] %logger{1} - %msg%n"
diff --git 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
index 10c93ec..961f28e 100644
--- 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
+++ 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
@@ -126,6 +126,7 @@ public class JavaInstanceRunnable implements AutoCloseable, 
Runnable {
     JavaInstance setupJavaInstance() throws Exception {
         // initialize the thread context
         ThreadContext.put("function", 
FunctionDetailsUtils.getFullyQualifiedName(instanceConfig.getFunctionDetails()));
+        ThreadContext.put("functionname", 
instanceConfig.getFunctionDetails().getName());
         ThreadContext.put("instance", instanceConfig.getInstanceId());
 
         log.info("Starting Java Instance {}", 
instanceConfig.getFunctionDetails().getName());

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to