[ 
https://issues.apache.org/jira/browse/TWILL-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15718950#comment-15718950
 ] 

ASF GitHub Bot commented on TWILL-138:
--------------------------------------

Github user yaojiefeng commented on a diff in the pull request:

    https://github.com/apache/twill/pull/14#discussion_r90767535
  
    --- Diff: 
twill-yarn/src/main/java/org/apache/twill/internal/container/TwillContainerService.java
 ---
    @@ -51,29 +63,36 @@
       private final ClassLoader classLoader;
       private final BasicTwillContext context;
       private final ContainerLiveNodeData containerLiveNodeData;
    +  private final Map<String, LogEntry.Level> oldLogLevels;
    +  private final Map<String, LogEntry.Level> defaultLogLevels;
       private ExecutorService commandExecutor;
       private TwillRunnable runnable;
     
       public TwillContainerService(BasicTwillContext context, ContainerInfo 
containerInfo, ZKClient zkClient,
                                    RunId runId, TwillRunnableSpecification 
specification, ClassLoader classLoader,
    -                               Location applicationLocation) {
    +                               Location applicationLocation, Map<String, 
LogEntry.Level> defaultLogLevels,
    +                               Map<String, LogEntry.Level> logLevels) {
         super(zkClient, runId, applicationLocation);
     
         this.specification = specification;
         this.classLoader = classLoader;
    -    this.containerLiveNodeData = createLiveNodeData(containerInfo);
    +    this.defaultLogLevels = ImmutableMap.copyOf(defaultLogLevels);
    +    this.oldLogLevels = Collections.synchronizedMap(new 
HashMap<>(defaultLogLevels));
    --- End diff --
    
    The `defaultLogLevels` are the log levels passed with `TwillPreparer`, when 
resetting the log levels, we will need it to update the live node info to 
indicate the log levels. The `oldLogLevels` is the same as the 
`defaultLogLevels` when the runnable starts up. We will not update it for each 
log level change. It is used to save old log levels for loggers for the first 
time change as we do not know what is in the `logback.xml`. When reset, we 
reset based on this map.


> Runtime change of Application runnable log level
> ------------------------------------------------
>
>                 Key: TWILL-138
>                 URL: https://issues.apache.org/jira/browse/TWILL-138
>             Project: Apache Twill
>          Issue Type: New Feature
>          Components: core
>            Reporter: Henry Saputra
>
> With TWILL-24 is supported for setting log level when starting the Twill 
> application, next enhancement is to able to send command to update the 
> aggregate log level for a particular runnable in a Twill application.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to