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

Yaojie Feng commented on TWILL-138:
-----------------------------------

To do this, we will first finish TWILL-195. After that, we will make following 
API changes to TwillPreparer and TwillController:
For TwillPreparer, we add:
{code}
TwillPreparer setLogLevel(Map<String, LogEntry.Level> logLevelAppArgs);
{code}
and 
{code}
TwillPreparer setLogLevel(String runnableName, Map<String, LogEntry.Level> 
logLevelRunnableArgs);
{code}
The first method will accept a map which contains logger name and log level 
that need to be changed for the whole application. 
The second method will accept a runnableName, and a map of logger name and log 
level for that runnable.
Implementation: With TWILL-195, we can pass the runtime specification to 
application using TwillRuntimeSpecification. So we store the log level 
arguments as a map: Map<String, Map<String, Log.Entry level>> and pass it with 
TwillRuntimeSpecification. Therefore, we can get it from the 
ApplicationMasterService and TwillContainerService and set the log level once 
the application starts.

For TwillController, we add: 
{code}
Future<String> setLogLevel(LogEntry.Level logLevel);
{code}
{code}
Future<String> setLogLevel(Map<String, LogEntry.Level> logLevelAppArgs);
{code}
{code}
Future<String> setLogLevel(String runnableName, Map<String, LogEntry.Level> 
logLevels);
{code}
The functionalities are similar to those in TwillPreparer. With these methods, 
we will be able to set log level during runtime by passing to either the whole 
application or a specific runnable.
Implementation: Using messages to send out the log level change request. 
TwillController will send messages to zookeeper. Message will be received by 
ApplicationMasterService and be propagated to corresponding runnables using 
RunningContainers. The corresponding TwillContainerService will receive the 
message and change the log level for corresponding logger. If it is successful, 
update the corresponding log information in resources for each container. 

> 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