Skip to content

Commit

Permalink
Update with correlation id
Browse files Browse the repository at this point in the history
  • Loading branch information
wsargent committed Mar 19, 2020
1 parent ac0fd23 commit 509ded0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ As with the other trace messages, these will all be written out to the ringbuffe

[System information](https://tersesystems.github.io/terse-logback/guide/systeminfo/) is provided using `logback-sigar`, which uses [Hyperic Sigar](https://github.com/hyperic/sigar) as a back end to provide CPU, memory and load information.

Hyperic Sigar is a Java agent that only runs in production mode, so if you try to run in development mode you will get "Sigar is not registered!" error messages.

## Error Reporting with Backtraces

Error Reporting is done through the error handlers. There are two integrations, [Sentry](https://sentry.io/welcome/) and [Honeycomb](https://www.honeycomb.io/).
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/LogController.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public CompletionStage<Result> list(Integer page) {
Integer offset = 50 * mult;
return finder.list(offset).thenApply(list -> {
scala.collection.mutable.Seq<LogEntry> scalaList = JavaConverters.asScalaBuffer(list);
return ok(views.html.log.list.render(scalaList.toSeq(), page + 1));
return ok(views.html.log.list.render(scalaList.toSeq(), scala.Option.empty(),page + 1));
});
}

public CompletionStage<Result> correlation(String correlationId, Integer page) {
return finder.findByCorrelation(correlationId).thenApply(list -> {
scala.collection.mutable.Seq<LogEntry> scalaList = JavaConverters.asScalaBuffer(list);
return ok(views.html.log.list.render(scalaList.toSeq(), page + 1));
return ok(views.html.log.list.render(scalaList.toSeq(), scala.Some.apply(correlationId),page + 1));
});
}
}
7 changes: 5 additions & 2 deletions app/views/log/list.scala.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
@import play.libs.Scala._

@(list: Seq[_root_.logging.LogEntry], nextPage: Int)
@(list: Seq[_root_.logging.LogEntry], correlationId: Option[String], nextPage: Int)

@main("Logs") {
<h1>Logs</h1>
<h1>Logs @correlationId.map{ cid =>
(showing only correlation id @cid)
}
</h1>
<p style="text-align: right; padding-right: 50px;">
<a href="@controllers.routes.LogController.list(nextPage)">Page @nextPage &ndash;&gt;</a>
</p>
Expand Down

0 comments on commit 509ded0

Please sign in to comment.