{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/logstash/pulls/comments/75579525","id":75579525,"diff_hunk":"@@ -148,25 +148,32 @@ def run(args)\n     begin\n       LogStash::SETTINGS.from_yaml(LogStash::SETTINGS.get(\"path.settings\"))\n     rescue => e\n-      @logger.subscribe(STDOUT)\n-      @logger.warn(\"Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \\\"--path.settings=/path/..\\\" in the command line options\")\n-      @logger.fatal(\"Failed to load settings file from \\\"path.settings\\\". Aborting...\", \"path.settings\" => LogStash::SETTINGS.get(\"path.settings\"), \"exception\" => e.class, \"message\" => e.message)\n+      $stderr.puts \"ERROR: Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \\\"--path.settings=/path/..\\\" in the command line options\"\n+      $stderr.puts \"ERROR: Failed to load settings file from \\\"path.settings\\\". Aborting... path.setting=#{LogStash::SETTINGS.get(\"path.settings\")}, exception=#{e.class}, message=>#{e.message}\"\n       exit(-1)\n     end\n \n+    # Configure Logstash logging facility, this need to be done before everything else to\n+    # make sure the logger has the correct settings and the log level is correctly defined.\n+    # TODO(talevy): cleanly support `path.logs` setting in log4j\n+    log4j_config_location = setting(\"path.settings\") + \"/log4j2.properties\"\n+    unless java.lang.System.getProperty(\"log4j.configurationFile\")\n+      LogStash::Logging::Logger::initialize(log4j_config_location)\n+    end","path":"logstash-core/lib/logstash/runner.rb","position":56,"original_position":56,"commit_id":"9c625259a4729548fb1c0acea4e43a21ad51c65f","original_commit_id":"df543f58ba4ee7a14cf76b232401b50c4f09f5f2","user":{"login":"fbaligand","id":3750300,"avatar_url":"https://avatars.githubusercontent.com/u/3750300?v=3","gravatar_id":"","url":"https://api.github.com/users/fbaligand","html_url":"https://github.com/fbaligand","followers_url":"https://api.github.com/users/fbaligand/followers","following_url":"https://api.github.com/users/fbaligand/following{/other_user}","gists_url":"https://api.github.com/users/fbaligand/gists{/gist_id}","starred_url":"https://api.github.com/users/fbaligand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbaligand/subscriptions","organizations_url":"https://api.github.com/users/fbaligand/orgs","repos_url":"https://api.github.com/users/fbaligand/repos","events_url":"https://api.github.com/users/fbaligand/events{/privacy}","received_events_url":"https://api.github.com/users/fbaligand/received_events","type":"User","site_admin":false},"body":"To inject `path.log` and `log.level` as log4j2 `Lookup`, I think we could do it easily like this :\r\n- create a java class like this : [LogstashLookup.java](https://gist.github.com/fbaligand/bedeb87a18b876f1d057d43ee171e05c)\r\n- just before log4j initialization, call `LogstashLookup.setLogstashSettings(Logstash::SETTINGS.to_hash)`\r\n- in `log4j2.properties`, add references `${logstash:path.log}` and `${logstash:log.level}`\r\n\r\nGreat, no ? :)","created_at":"2016-08-20T14:29:27Z","updated_at":"2016-08-20T14:29:27Z","html_url":"https://github.com/elastic/logstash/pull/5651#discussion_r75579525","pull_request_url":"https://api.github.com/repos/elastic/logstash/pulls/5651","_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments/75579525"},"html":{"href":"https://github.com/elastic/logstash/pull/5651#discussion_r75579525"},"pull_request":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5651"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/logstash/pulls/5651","id":78024137,"html_url":"https://github.com/elastic/logstash/pull/5651","diff_url":"https://github.com/elastic/logstash/pull/5651.diff","patch_url":"https://github.com/elastic/logstash/pull/5651.patch","issue_url":"https://api.github.com/repos/elastic/logstash/issues/5651","number":5651,"state":"open","locked":false,"title":"Migrate Logstash to Log4j2 Logging","user":{"login":"talevy","id":388837,"avatar_url":"https://avatars.githubusercontent.com/u/388837?v=3","gravatar_id":"","url":"https://api.github.com/users/talevy","html_url":"https://github.com/talevy","followers_url":"https://api.github.com/users/talevy/followers","following_url":"https://api.github.com/users/talevy/following{/other_user}","gists_url":"https://api.github.com/users/talevy/gists{/gist_id}","starred_url":"https://api.github.com/users/talevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talevy/subscriptions","organizations_url":"https://api.github.com/users/talevy/orgs","repos_url":"https://api.github.com/users/talevy/repos","events_url":"https://api.github.com/users/talevy/events{/privacy}","received_events_url":"https://api.github.com/users/talevy/received_events","type":"User","site_admin":false},"body":"Meta issue describing this issue: https://github.com/elastic/logstash/issues/5650\r\n\r\n_****Quoted from the meta issue****_\r\n\r\n**Goal:**\r\n* Unify logging across Logstash's Java and Ruby code.\r\n* Support changing logging level dynamically at runtime through REST endpoints\r\n* Support complete JSON logging\r\n* Provide a strategy for reading in its own JSON logs as input for self monitoring\r\n\r\n**Proposed Implementation:**\r\nMigrate from Cabin to Log4j2 as the logging library for Logstash Core and its plugins.\r\n\r\n**Reason for library change:**\r\nLogstash and its plugin's usage of Java libraries that use Log4j/SLF4j is growing. This is leading to un-captured logging by core as it is running the pipeline. [Cabin](https://github.com/jordansissel/ruby-cabin) is the current logging library used by Logstash, but it's support for these java libraries is limited. Configuration of these java loggers is also not managed by Logstash natively, this yields confusing warning messages when using specific plugins, like Kafka. Even Logstash's core (Logstash Event in Java) is straying away from Cabin-friendly logging land.","created_at":"2016-07-19T18:19:52Z","updated_at":"2016-08-20T14:29:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a0b2eb37f7f4c34ffe7e36629908790429c58e3","assignee":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"assignees":[{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/logstash/pulls/5651/commits","review_comments_url":"https://api.github.com/repos/elastic/logstash/pulls/5651/comments","review_comment_url":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/5651/comments","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/9c625259a4729548fb1c0acea4e43a21ad51c65f","head":{"label":"elastic:feature/log4j2-logging","ref":"feature/log4j2-logging","sha":"9c625259a4729548fb1c0acea4e43a21ad51c65f","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elastic/logstash","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/logstash","description":"logstash - transport and process your logs, events, or other data","fork":false,"url":"https://api.github.com/repos/elastic/logstash","forks_url":"https://api.github.com/repos/elastic/logstash/forks","keys_url":"https://api.github.com/repos/elastic/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/logstash/teams","hooks_url":"https://api.github.com/repos/elastic/logstash/hooks","issue_events_url":"https://api.github.com/repos/elastic/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/logstash/events","assignees_url":"https://api.github.com/repos/elastic/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/logstash/tags","blobs_url":"https://api.github.com/repos/elastic/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/logstash/languages","stargazers_url":"https://api.github.com/repos/elastic/logstash/stargazers","contributors_url":"https://api.github.com/repos/elastic/logstash/contributors","subscribers_url":"https://api.github.com/repos/elastic/logstash/subscribers","subscription_url":"https://api.github.com/repos/elastic/logstash/subscription","commits_url":"https://api.github.com/repos/elastic/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/logstash/merges","archive_url":"https://api.github.com/repos/elastic/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/logstash/downloads","issues_url":"https://api.github.com/repos/elastic/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elastic/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/logstash/deployments","created_at":"2010-11-18T01:31:50Z","updated_at":"2016-08-20T10:03:26Z","pushed_at":"2016-08-19T23:49:34Z","git_url":"git://github.com/elastic/logstash.git","ssh_url":"git@github.com:elastic/logstash.git","clone_url":"https://github.com/elastic/logstash.git","svn_url":"https://github.com/elastic/logstash","homepage":"https://www.elastic.co/products/logstash","size":89387,"stargazers_count":6328,"watchers_count":6328,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1874,"mirror_url":null,"open_issues_count":828,"forks":1874,"open_issues":828,"watchers":6328,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"22c857556f4b11a9fd6cfd979acbf9f9f9f59720","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elastic/logstash","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/logstash","description":"logstash - transport and process your logs, events, or other data","fork":false,"url":"https://api.github.com/repos/elastic/logstash","forks_url":"https://api.github.com/repos/elastic/logstash/forks","keys_url":"https://api.github.com/repos/elastic/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/logstash/teams","hooks_url":"https://api.github.com/repos/elastic/logstash/hooks","issue_events_url":"https://api.github.com/repos/elastic/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/logstash/events","assignees_url":"https://api.github.com/repos/elastic/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/logstash/tags","blobs_url":"https://api.github.com/repos/elastic/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/logstash/languages","stargazers_url":"https://api.github.com/repos/elastic/logstash/stargazers","contributors_url":"https://api.github.com/repos/elastic/logstash/contributors","subscribers_url":"https://api.github.com/repos/elastic/logstash/subscribers","subscription_url":"https://api.github.com/repos/elastic/logstash/subscription","commits_url":"https://api.github.com/repos/elastic/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/logstash/merges","archive_url":"https://api.github.com/repos/elastic/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/logstash/downloads","issues_url":"https://api.github.com/repos/elastic/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elastic/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/logstash/deployments","created_at":"2010-11-18T01:31:50Z","updated_at":"2016-08-20T10:03:26Z","pushed_at":"2016-08-19T23:49:34Z","git_url":"git://github.com/elastic/logstash.git","ssh_url":"git@github.com:elastic/logstash.git","clone_url":"https://github.com/elastic/logstash.git","svn_url":"https://github.com/elastic/logstash","homepage":"https://www.elastic.co/products/logstash","size":89387,"stargazers_count":6328,"watchers_count":6328,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1874,"mirror_url":null,"open_issues_count":828,"forks":1874,"open_issues":828,"watchers":6328,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5651"},"html":{"href":"https://github.com/elastic/logstash/pull/5651"},"issue":{"href":"https://api.github.com/repos/elastic/logstash/issues/5651"},"comments":{"href":"https://api.github.com/repos/elastic/logstash/issues/5651/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5651/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5651/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/logstash/statuses/9c625259a4729548fb1c0acea4e43a21ad51c65f"}}}}
{"actor":{"display_login":"fbaligand"}}