forked from callistaenterprise/akka-cadec-2013
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
common/src/main/scala/se/callista/loganalyzer/AccessLog.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package se.callista.loganalyzer | ||
|
||
import java.text.SimpleDateFormat | ||
import java.util.Date | ||
|
||
case class AccessLog( | ||
ip: String, | ||
timestamp: Date, | ||
method: String, | ||
path: String, | ||
statusCode: Int, | ||
size: Int) { | ||
|
||
override def toString = { | ||
val formatter = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z") | ||
ip + " - - [" + formatter.format(timestamp) + "] " + method + " " + path + " " + statusCode + " " + size | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
common/src/main/scala/se/callista/loganalyzer/ConfirmationMessage.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package se.callista.loganalyzer | ||
|
||
case class ConfirmationMessage(id: Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
package se.callista.loganalyzer | ||
|
||
case class Count( | ||
status: HttpStatus, | ||
status: HttpStatus, // Success, ClientError or ServerError | ||
count: Int) { | ||
|
||
def toJson = "{ \"status\":\"%s\", \"count\": %s }".format(status, count) | ||
|
||
} | ||
|
||
abstract class HttpStatus | ||
|
||
case object Success extends HttpStatus { | ||
override def toString = "success" | ||
} | ||
|
||
case object ClientError extends HttpStatus{ | ||
override def toString = "clientError" | ||
} | ||
|
||
case object ServerError extends HttpStatus{ | ||
override def toString = "serverError" | ||
} |
6 changes: 6 additions & 0 deletions
6
common/src/main/scala/se/callista/loganalyzer/HandleUnprocessedLogs.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package se.callista.loganalyzer | ||
|
||
/** | ||
* Use this object to trigger LogAgent to handle unprocessed logs | ||
*/ | ||
case object HandleUnprocessedLogs |
15 changes: 15 additions & 0 deletions
15
common/src/main/scala/se/callista/loganalyzer/HttpStatus.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package se.callista.loganalyzer | ||
|
||
abstract class HttpStatus | ||
|
||
case object Success extends HttpStatus { | ||
override def toString = "success" | ||
} | ||
|
||
case object ClientError extends HttpStatus{ | ||
override def toString = "clientError" | ||
} | ||
|
||
case object ServerError extends HttpStatus{ | ||
override def toString = "serverError" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters