Search in sources :

Example 1 with LogLevelUpdater

use of co.cask.cdap.app.runtime.LogLevelUpdater in project cdap by caskdata.

the class ProgramLifecycleService method resetLogLevels.

/**
   * Helper method to reset log levels for Worker, Flow or Service.
   */
private void resetLogLevels(ProgramId programId, Set<String> loggerNames, @Nullable String component, @Nullable String runId) throws Exception {
    List<ProgramRuntimeService.RuntimeInfo> runtimeInfos = findRuntimeInfo(programId, runId);
    ProgramRuntimeService.RuntimeInfo runtimeInfo = runtimeInfos.isEmpty() ? null : runtimeInfos.get(0);
    if (runtimeInfo != null) {
        LogLevelUpdater logLevelUpdater = getLogLevelUpdater(runtimeInfo);
        logLevelUpdater.resetLogLevels(loggerNames, component);
    }
}
Also used : RuntimeInfo(co.cask.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) RuntimeInfo(co.cask.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) LogLevelUpdater(co.cask.cdap.app.runtime.LogLevelUpdater) ProgramRuntimeService(co.cask.cdap.app.runtime.ProgramRuntimeService)

Example 2 with LogLevelUpdater

use of co.cask.cdap.app.runtime.LogLevelUpdater in project cdap by caskdata.

the class ProgramLifecycleService method updateLogLevels.

/**
   * Helper method to update log levels for Worker, Flow, or Service.
   */
private void updateLogLevels(ProgramId programId, Map<String, LogEntry.Level> logLevels, @Nullable String component, @Nullable String runId) throws Exception {
    List<ProgramRuntimeService.RuntimeInfo> runtimeInfos = findRuntimeInfo(programId, runId);
    ProgramRuntimeService.RuntimeInfo runtimeInfo = runtimeInfos.isEmpty() ? null : runtimeInfos.get(0);
    if (runtimeInfo != null) {
        LogLevelUpdater logLevelUpdater = getLogLevelUpdater(runtimeInfo);
        logLevelUpdater.updateLogLevels(logLevels, component);
    }
}
Also used : RuntimeInfo(co.cask.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) RuntimeInfo(co.cask.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) LogLevelUpdater(co.cask.cdap.app.runtime.LogLevelUpdater) ProgramRuntimeService(co.cask.cdap.app.runtime.ProgramRuntimeService)

Aggregations

LogLevelUpdater (co.cask.cdap.app.runtime.LogLevelUpdater)2 ProgramRuntimeService (co.cask.cdap.app.runtime.ProgramRuntimeService)2 RuntimeInfo (co.cask.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo)2