summaryrefslogtreecommitdiff
path: root/src/main/scala/com/tylerstonge/honeypot/reporter/LogReporter.scala
blob: 9b3f28ffd606a594b7709a0aa6b681b95aff9c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.tylerstonge.honeypot.reporter

import akka.actor.{Actor, Props}
import akka.event.{Logging, LoggingAdapter}
import com.tylerstonge.honeypot.messages.{MFoundFile, MFoundPassword, MFoundUsername}

class LogReporter extends Actor {

  val log: LoggingAdapter = Logging(context.system, this)

  context.system.eventStream.subscribe(self, classOf[MFoundUsername])
  context.system.eventStream.subscribe(self, classOf[MFoundPassword])
  context.system.eventStream.subscribe(self, classOf[MFoundFile])

  override def receive: Receive = {
    case msg: MFoundUsername => log.info(">> REPORTER >> :: {}", msg.username)
    case msg: MFoundPassword => log.info(">> REPORTER >> :: {}", msg.password)
    case msg: MFoundFile => log.info(">> REPORTER >> :: {}", msg.filename)
  }
}