{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/50623545","id":50623545,"diff_hunk":"@@ -0,0 +1,105 @@\n+package cromwell.logging\n+\n+import akka.actor.{ActorContext, Actor, ActorLogging, Props}\n+import akka.util.Timeout\n+import org.slf4j.{Logger, LoggerFactory}\n+import scala.concurrent.duration._\n+import cromwell.pubsub.{Subscriber, PubSubMediator}\n+import scala.language.postfixOps\n+\n+/**\n+  * Created by himanshu on 1/13/16.\n+  */\n+/**\n+  * LogWrapper is used to realize different types of logger\n+  * For example there is WorkflowLogger a specific implementation\n+  * of LogWrapper.\n+  */\n+trait LogWrapper {\n+  def debug(message : String)\n+  def debug(message : String , t : Throwable)\n+  def warn(message: String)\n+  def warn(message: String, t : Throwable)\n+  def error(message: String)\n+  def error(message: String , t : Throwable)\n+  def trace(message: String)\n+  def trace(message: String, t : Throwable)\n+  def info(message: String)\n+  def info(message: String, t : Throwable)\n+}\n+\n+/**\n+  * Workflow execution event topics that business logging\n+  * subscribed to and expecting,\n+  */\n+sealed trait WorkflowEvent\n+case object CallExecutionEvent extends WorkflowEvent\n+case object WorkflowExecutionEvent extends WorkflowEvent\n+\n+/**\n+  * To report Business logging received as event from\n+  * different components inside cromwell.\n+  */\n+trait BusinessLogEvent extends LogWrapper{\n+  def eventLogger() : Logger = LoggerFactory.getLogger(\"cromwell.logging.BusinessLogEvent\")\n+\n+  override def info(message: String) = eventLogger().info(message)\n+  override def info(message: String, t : Throwable) = eventLogger().info(message,t)\n+\n+  override def debug(message : String) = eventLogger().debug(message)\n+  override def debug(message : String , t : Throwable) = eventLogger().debug(message,t)\n+\n+  override def warn(message: String) = eventLogger().warn(message)\n+  override def warn(message: String, t : Throwable) = eventLogger().warn(message,t)\n+\n+  override def error(message: String) = eventLogger().error(message)\n+  override def error(message: String , t : Throwable) = eventLogger().error(message,t)\n+\n+  override def trace(message: String) = eventLogger().trace(message)\n+  override def trace(message: String, t : Throwable) = eventLogger().trace(message,t)\n+\n+  def logEvent(message: String): Unit = {\n+    info(message)\n+  }\n+\n+  /**\n+    * This method receive events from different actor inside cromwell engine\n+    * like WorkflowActor , CallActor and so on.\n+    */\n+  def onBusinessLoggingEvent() :(WorkflowEvent,Any) =>Option[Unit] = (topic: WorkflowEvent, payload: Any) => Some(topic) collect {","path":"cromwell-logging/src/main/scala/cromwell/logging/BusinessLogging.scala","position":69,"original_position":69,"commit_id":"6e1d74f59e4c63690e52e4c6e0ec8bbe5d8f89a7","original_commit_id":"6e1d74f59e4c63690e52e4c6e0ec8bbe5d8f89a7","user":{"login":"cjllanwarne","id":13006282,"avatar_url":"https://avatars.githubusercontent.com/u/13006282?v=3","gravatar_id":"","url":"https://api.github.com/users/cjllanwarne","html_url":"https://github.com/cjllanwarne","followers_url":"https://api.github.com/users/cjllanwarne/followers","following_url":"https://api.github.com/users/cjllanwarne/following{/other_user}","gists_url":"https://api.github.com/users/cjllanwarne/gists{/gist_id}","starred_url":"https://api.github.com/users/cjllanwarne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjllanwarne/subscriptions","organizations_url":"https://api.github.com/users/cjllanwarne/orgs","repos_url":"https://api.github.com/users/cjllanwarne/repos","events_url":"https://api.github.com/users/cjllanwarne/events{/privacy}","received_events_url":"https://api.github.com/users/cjllanwarne/received_events","type":"User","site_admin":false},"body":"Are we seriously entertaining the prospect of passing nulls around? :-/","created_at":"2016-01-23T18:24:42Z","updated_at":"2016-01-23T18:24:42Z","html_url":"https://github.com/broadinstitute/cromwell/pull/400#discussion_r50623545","pull_request_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/50623545"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/400#discussion_r50623545"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400","id":56954832,"html_url":"https://github.com/broadinstitute/cromwell/pull/400","diff_url":"https://github.com/broadinstitute/cromwell/pull/400.diff","patch_url":"https://github.com/broadinstitute/cromwell/pull/400.patch","issue_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/400","number":400,"state":"open","locked":false,"title":"[DONT MERGE] business logging and Pub sub ","user":{"login":"jainh","id":10890082,"avatar_url":"https://avatars.githubusercontent.com/u/10890082?v=3","gravatar_id":"","url":"https://api.github.com/users/jainh","html_url":"https://github.com/jainh","followers_url":"https://api.github.com/users/jainh/followers","following_url":"https://api.github.com/users/jainh/following{/other_user}","gists_url":"https://api.github.com/users/jainh/gists{/gist_id}","starred_url":"https://api.github.com/users/jainh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jainh/subscriptions","organizations_url":"https://api.github.com/users/jainh/orgs","repos_url":"https://api.github.com/users/jainh/repos","events_url":"https://api.github.com/users/jainh/events{/privacy}","received_events_url":"https://api.github.com/users/jainh/received_events","type":"User","site_admin":false},"body":"This contains a feature of accepting business events like workflow execution events and other events through the event bus provided by Akka framework and delegate them to centralized logging like Logstash, Fluentd etc for further Monitoring/UI status. There is also a wrapper that encapsulate event bus subscription/publication behaviour. ","created_at":"2016-01-22T23:14:34Z","updated_at":"2016-01-23T18:24:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"163b15a9e9ee30d4b4f2a7b0077be921c2663241","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/400/comments","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/6e1d74f59e4c63690e52e4c6e0ec8bbe5d8f89a7","head":{"label":"broadinstitute:PubSubBusinessLogging","ref":"PubSubBusinessLogging","sha":"6e1d74f59e4c63690e52e4c6e0ec8bbe5d8f89a7","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-01-19T15:19:09Z","pushed_at":"2016-01-22T23:14:38Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":4811,"stargazers_count":23,"watchers_count":23,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":10,"forks":7,"open_issues":10,"watchers":23,"default_branch":"develop"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"44468d305aaadf269355ec52c1ef7998419e14b4","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-01-19T15:19:09Z","pushed_at":"2016-01-22T23:14:38Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":4811,"stargazers_count":23,"watchers_count":23,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":10,"forks":7,"open_issues":10,"watchers":23,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/400"},"issue":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/400"},"comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/400/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/400/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/cromwell/statuses/6e1d74f59e4c63690e52e4c6e0ec8bbe5d8f89a7"}}}}