- enable logging of akka system in bbb-web

This commit is contained in:
Richard Alam 2017-06-02 09:35:24 -07:00
parent 8beab449d5
commit 5fed6779d4
7 changed files with 43 additions and 47 deletions

View File

@ -5,6 +5,7 @@ import java.util.Map
import scala.collection.JavaConverters._
import akka.actor.ActorSystem
import akka.event.Logging
import org.bigbluebutton.api2.bus._
import org.bigbluebutton.api2.endpoint.redis.{AppsRedisSubscriberActor, MessageSender, RedisPublisher}
import org.bigbluebutton.api2.meeting.{CreateMeetingMsg, MeetingsManagerActor, RegisterUser}
@ -15,8 +16,14 @@ import scala.concurrent.duration._
class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW) extends IBbbWebApiGWApp with SystemConfiguration{
implicit val system = ActorSystem("bbb-web-common")
implicit val timeout = akka.util.Timeout(3 seconds)
val log = Logging(system, getClass)
println("*********** meetingManagerChannel = " + meetingManagerChannel)
log.debug("*********** meetingManagerChannel = " + meetingManagerChannel)
private val jsonMsgToAkkaAppsBus = new JsonMsgToAkkaAppsBus
private val redisPublisher = new RedisPublisher(system)
private val msgSender: MessageSender = new MessageSender(redisPublisher)
@ -56,6 +63,7 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW) extends IBb
* External APIs for Gateway
*/
def send(channel: String, json: String): Unit = {
log.debug("Sending msg. channel={} msg={}", channel, json)
jsonMsgToAkkaAppsBus.publish(JsonMsgToAkkaAppsBusMsg(toAkkaAppsJsonChannel, new JsonMsgToSendToAkkaApps(channel, json)))
}

View File

@ -54,10 +54,10 @@ class AppsRedisSubscriberActor(jsonMsgBus: JsonMsgFromAkkaAppsBus, oldMessageEve
}
def onPMessage(pmessage: PMessage) {
//log.debug(s"RECEIVED:\n ${pmessage.data.utf8String} \n")
log.debug(s"RECEIVED:\n ${pmessage.data.utf8String} \n")
val receivedJsonMessage = new OldReceivedJsonMessage(pmessage.patternMatched,
pmessage.channel, pmessage.data.utf8String)
oldMessageEventBus.publish(OldIncomingJsonMessage(fromAkkaAppsOldJsonChannel, receivedJsonMessage))
}
}
}

View File

@ -1,6 +1,7 @@
package org.bigbluebutton.api2.endpoint.redis
import akka.actor.ActorSystem
import akka.event.Logging
import akka.util.ByteString
import org.bigbluebutton.api2.SystemConfiguration
import redis.RedisClient
@ -9,12 +10,14 @@ class RedisPublisher(val system: ActorSystem) extends SystemConfiguration {
val redis = RedisClient(redisHost, redisPort)(system)
val log = Logging(system, getClass)
// Set the name of this client to be able to distinguish when doing
// CLIENT LIST on redis-cli
redis.clientSetname("BbbWebPub")
def publish(channel: String, data: String) {
println("PUBLISH TO \n[" + channel + "]: \n " + data + "\n")
log.debug("PUBLISH TO \n[" + channel + "]: \n " + data + "\n")
redis.publish(channel, ByteString(data))
}

View File

@ -101,7 +101,7 @@ class MeetingsManagerActor(val msgToAkkaAppsEventBus: MsgToAkkaAppsEventBus)
private def handleBbbCommonEnvCoreMsg(msg: BbbCommonEnvCoreMsg): Unit = {
msg.core match {
case m: MeetingCreatedEvtMsg => handleMeetingCreatedEvtMsg(m)
case _ => println("***** Cannot handle " + msg.envelope.name)
case _ => log.error("***** Cannot handle " + msg.envelope.name)
}
}
}

View File

@ -1,43 +0,0 @@
akka {
actor {
debug {
# enable DEBUG logging of all AutoReceiveMessages (Kill, PoisonPill et.c.)
autoreceive = on
# enable DEBUG logging of actor lifecycle changes
lifecycle = on
}
}
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
rediscala-publish-worker-dispatcher {
mailbox-type = "akka.dispatch.SingleConsumerOnlyUnboundedMailbox"
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 512
}
rediscala-subscriber-worker-dispatcher {
mailbox-type = "akka.dispatch.SingleConsumerOnlyUnboundedMailbox"
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 512
}
}
redis {
host="127.0.0.1"
port=6379
password=""
# recording keys should expire in 14 days
keyExpiry=1209600
}
eventBus {
meetingManagerChannel = "MeetingManagerChannel"
outMessageChannel = "OutgoingMessageChannel"
incomingJsonMsgChannel = "IncomingJsonMsgChannel"
outBbbMsgMsgChannel = "OutBbbMsgChannel"
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{ISO8601} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>logs/bbb-apps-akka.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>/var/log/bigbluebutton/bbb-web-akka.%d{yyyy-MM-dd}.log</FileNamePattern>
<!-- keep 30 days worth of history -->
<MaxHistory>5</MaxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{"yyyy-MM-dd HH:mm:ss,SSSXXX"} [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
<logger name="akka" level="INFO" />
<logger name="org.bigbluebutton" level="DEBUG" />
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE" />
</root>
</configuration>