Skip to content

Commit 73e99c4

Browse files
authored
fix: Do not pollute the parent logger context with remote endpoint id. (#2309)
1 parent bee626b commit 73e99c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jvb/src/main/kotlin/org/jitsi/videobridge/cc/allocation/SingleSourceAllocation.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.jitsi.utils.logging.DiagnosticContext
2323
import org.jitsi.utils.logging.TimeSeriesLogger
2424
import org.jitsi.utils.logging2.Logger
2525
import org.jitsi.utils.logging2.LoggerImpl
26+
import org.jitsi.utils.logging2.createChildLogger
2627
import org.jitsi.videobridge.cc.config.BitrateControllerConfig.Companion.config
2728
import java.lang.Integer.max
2829
import java.time.Clock
@@ -44,8 +45,12 @@ internal class SingleSourceAllocation(
4445
private val onStage: Boolean,
4546
diagnosticContext: DiagnosticContext,
4647
clock: Clock,
47-
val logger: Logger = LoggerImpl(SingleSourceAllocation::class.qualifiedName)
48+
parentLogger: Logger = LoggerImpl(SingleSourceAllocation::class.qualifiedName)
4849
) {
50+
val logger = createChildLogger(parentLogger).apply {
51+
addContext(mapOf("remote_endpoint_id" to endpointId))
52+
}
53+
4954
/**
5055
* The immutable list of layers to be considered when allocating bandwidth.
5156
*/
@@ -69,7 +74,6 @@ internal class SingleSourceAllocation(
6974
}
7075
timeSeriesLogger.trace(ratesTimeSeriesPoint)
7176
}
72-
logger.addContext(mapOf("remote_endpoint_id" to endpointId))
7377
}
7478

7579
fun isOnStage() = onStage

0 commit comments

Comments
 (0)