Search in sources :

Example 1 with LogLevelUpdater

use of io.cdap.cdap.app.runtime.LogLevelUpdater in project cdap by caskdata.

the class ProgramLifecycleService method updateLogLevels.

/**
 * Helper method to update log levels for Worker or Service.
 */
private void updateLogLevels(ProgramId programId, Map<String, LogEntry.Level> logLevels, @Nullable String runId) throws Exception {
    ProgramRuntimeService.RuntimeInfo runtimeInfo = findRuntimeInfo(programId, runId).values().stream().findFirst().orElse(null);
    if (runtimeInfo != null) {
        LogLevelUpdater logLevelUpdater = getLogLevelUpdater(runtimeInfo);
        logLevelUpdater.updateLogLevels(logLevels, null);
    }
}
Also used : RuntimeInfo(io.cdap.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) LogLevelUpdater(io.cdap.cdap.app.runtime.LogLevelUpdater) ProgramRuntimeService(io.cdap.cdap.app.runtime.ProgramRuntimeService)

Example 2 with LogLevelUpdater

use of io.cdap.cdap.app.runtime.LogLevelUpdater in project cdap by caskdata.

the class ProgramLifecycleService method resetLogLevels.

/**
 * Helper method to reset log levels for Worker or Service.
 */
private void resetLogLevels(ProgramId programId, Set<String> loggerNames, @Nullable String runId) throws Exception {
    ProgramRuntimeService.RuntimeInfo runtimeInfo = findRuntimeInfo(programId, runId).values().stream().findFirst().orElse(null);
    if (runtimeInfo != null) {
        LogLevelUpdater logLevelUpdater = getLogLevelUpdater(runtimeInfo);
        logLevelUpdater.resetLogLevels(loggerNames, null);
    }
}
Also used : RuntimeInfo(io.cdap.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo) LogLevelUpdater(io.cdap.cdap.app.runtime.LogLevelUpdater) ProgramRuntimeService(io.cdap.cdap.app.runtime.ProgramRuntimeService)

Aggregations

LogLevelUpdater (io.cdap.cdap.app.runtime.LogLevelUpdater)2 ProgramRuntimeService (io.cdap.cdap.app.runtime.ProgramRuntimeService)2 RuntimeInfo (io.cdap.cdap.app.runtime.ProgramRuntimeService.RuntimeInfo)2