Skip to content

Commit 0d09305

Browse files
authored
Reduce excessive logging (#1213)
* fix: Do not override log level for brewery rooms. * Remove topology strategy log, too verbose. * log: Move some logs from INFO to DEBUG.
1 parent 34b4a33 commit 0d09305

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class XmppProvider(val config: XmppConnectionConfig, parentLogger: Logger) {
258258
}
259259

260260
@Throws(RoomExistsException::class)
261-
fun createRoom(name: EntityBareJid): ChatRoom = muc.createChatRoom(name)
261+
fun createRoom(name: EntityBareJid): ChatRoom = muc.createChatRoom(name, null)
262262
fun findOrCreateRoom(name: EntityBareJid, logLevel: Level): ChatRoom = muc.findOrCreateRoom(name, logLevel)
263263

264264
fun discoverFeatures(jid: EntityFullJid): Set<Features> {
@@ -363,7 +363,7 @@ private class Muc(val xmppProvider: XmppProvider) {
363363
private val rooms: MutableMap<EntityBareJid, ChatRoomImpl> = HashMap()
364364

365365
@Throws(RoomExistsException::class)
366-
fun createChatRoom(roomJid: EntityBareJid, logLevel: Level = Level.ALL): ChatRoom {
366+
fun createChatRoom(roomJid: EntityBareJid, logLevel: Level? = Level.ALL): ChatRoom {
367367
synchronized(rooms) {
368368
if (rooms.containsKey(roomJid)) {
369369
throw RoomExistsException("Room '$roomJid' exists")

jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/jingle/JingleSession.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class JingleSession(
156156
/** Whether to send a session-terminate IQ, or only terminate the session locally. */
157157
sendIq: Boolean
158158
) {
159-
logger.info("Terminating session with $remoteJid, reason=$reason, sendIq=$sendIq")
159+
logger.debug("Terminating session with $remoteJid, reason=$reason, sendIq=$sendIq")
160160
val oldState = state
161161
state = State.ENDED
162162

jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/muc/ChatRoomImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ import java.util.logging.Level
6868
class ChatRoomImpl(
6969
override val xmppProvider: XmppProvider,
7070
override val roomJid: EntityBareJid,
71-
logLevel: Level,
71+
logLevel: Level?,
7272
/** Callback to call when the room is left. */
7373
private val leaveCallback: (ChatRoomImpl) -> Unit
7474
) : ChatRoom, PresenceListener {
7575
private val logger = createLogger().apply {
76-
level = logLevel
76+
logLevel?.let { level = it }
7777
addContext("room", roomJid.toString())
7878
}
7979

jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/BridgeSelectionStrategy.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class BridgeSelectionStrategy {
4747
if (bridge != null) {
4848
logger.info(
4949
"Selected initial bridge $bridge with reported stress=${bridge.lastReportedStressLevel} " +
50-
"for participantProperties=$participantProperties using strategy ${this.javaClass.simpleName}"
50+
"for participantProperties=$participantProperties"
5151
)
5252
} else {
5353
logger.warn(

jicofo-selector/src/main/kotlin/org/jitsi/jicofo/bridge/colibri/ColibriV2SessionManager.kt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
2222
import org.jitsi.jicofo.OctoConfig
2323
import org.jitsi.jicofo.TaskPools
2424
import org.jitsi.jicofo.bridge.Bridge
25-
import org.jitsi.jicofo.bridge.BridgeConfig
25+
import org.jitsi.jicofo.bridge.BridgeConfig.Companion.config
2626
import org.jitsi.jicofo.bridge.BridgeSelector
2727
import org.jitsi.jicofo.bridge.Cascade
2828
import org.jitsi.jicofo.bridge.CascadeRepair
@@ -76,10 +76,6 @@ class ColibriV2SessionManager(
7676
override fun addListener(listener: ColibriSessionManager.Listener) = eventEmitter.addHandler(listener)
7777
override fun removeListener(listener: ColibriSessionManager.Listener) = eventEmitter.removeHandler(listener)
7878

79-
private val topologySelectionStrategy = BridgeConfig.config.topologyStrategy.also {
80-
logger.info("Using ${it.javaClass.name}")
81-
}
82-
8379
/**
8480
* The colibri2 sessions that are currently active, mapped by the relayId of the [Bridge] that they use.
8581
*/
@@ -124,14 +120,14 @@ class ColibriV2SessionManager(
124120
logger.debug { "Asked to remove $participantId" }
125121

126122
participants[participantId]?.let {
127-
logger.info("Removing ${it.id}")
123+
logger.debug("Removing ${it.id}")
128124
removeParticipantInfosBySession(mapOf(it.session to singletonList(it)))
129125
} ?: logger.warn("Can not remove $participantId, no participantInfo")
130126
Unit
131127
}
132128

133129
private fun repairMesh(cascade: ColibriV2SessionManager, disconnectedMeshes: Set<Set<Colibri2Session>>) =
134-
topologySelectionStrategy.repairMesh(cascade, disconnectedMeshes)
130+
config.topologyStrategy.repairMesh(cascade, disconnectedMeshes)
135131

136132
private fun removeSession(session: Colibri2Session): Set<ParticipantInfo> {
137133
val participants = getSessionParticipants(session)
@@ -327,7 +323,7 @@ class ColibriV2SessionManager(
327323
created = it.second
328324
}
329325
logger.info(
330-
"Selected ${bridge.jid.resourceOrNull} for $${participant.id} " +
326+
"Selected ${bridge.jid.resourceOrNull} for ${participant.id} " +
331327
"(visitor=${participant.visitor}, session exists: ${!created})"
332328
)
333329
if (visitor != session.visitor) {
@@ -341,7 +337,7 @@ class ColibriV2SessionManager(
341337
stanzaCollector = session.sendAllocationRequest(participantInfo)
342338
add(participantInfo)
343339
if (created) {
344-
val topologySelectionResult = topologySelectionStrategy.connectNode(
340+
val topologySelectionResult = config.topologyStrategy.connectNode(
345341
this,
346342
session
347343
)
@@ -560,7 +556,7 @@ class ColibriV2SessionManager(
560556
initialLastN: InitialLastN?,
561557
suppressLocalBridgeUpdate: Boolean
562558
) = synchronized(syncRoot) {
563-
logger.info("Updating $participantId with transport=$transport, sources=$sources")
559+
logger.debug("Updating $participantId with transport=$transport, sources=$sources")
564560

565561
val participantInfo = participants[participantId]
566562
?: run {

0 commit comments

Comments
 (0)