{"action":"created","issue":{"url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/61","labels_url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/61/comments","events_url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/61/events","html_url":"https://github.com/dwbutler/logstash-logger/issues/61","id":109891747,"number":61,"title":"Multi_logger doesn't respect specified logging formatter","user":{"login":"KnownSubset","id":948512,"avatar_url":"https://avatars.githubusercontent.com/u/948512?v=3","gravatar_id":"","url":"https://api.github.com/users/KnownSubset","html_url":"https://github.com/KnownSubset","followers_url":"https://api.github.com/users/KnownSubset/followers","following_url":"https://api.github.com/users/KnownSubset/following{/other_user}","gists_url":"https://api.github.com/users/KnownSubset/gists{/gist_id}","starred_url":"https://api.github.com/users/KnownSubset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KnownSubset/subscriptions","organizations_url":"https://api.github.com/users/KnownSubset/orgs","repos_url":"https://api.github.com/users/KnownSubset/repos","events_url":"https://api.github.com/users/KnownSubset/events{/privacy}","received_events_url":"https://api.github.com/users/KnownSubset/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dwbutler/logstash-logger/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-05T21:39:10Z","updated_at":"2015-10-06T02:45:56Z","closed_at":null,"body":"When configuring a **multi_logger** LogStashLogger, the provided formatter is ignored and the default formatter is used.  The specified formatter should the one that is used to write out to the output.\r\n\r\nExample configuration\r\n```\r\nconfig.logger = LogStashLogger.new(\r\n  type: :multi_logger,\r\n  outputs: [\r\n    { type: :file, path: \"log/development.log\", formatter: ::Logger::Formatter, sync: true }\r\n  ]\r\n)\r\n```\r\nLog file output:\r\n```\r\n{\"message\":\"\",\"@timestamp\":\"2015-10-05...\",\"@version\":\"1\"...}\r\n{\"message\":\"\",\"@timestamp\":\"2015-10-05...\",\"@version\":\"1\"...}\r\n{\"message\":\"Started GET \\\"/\\\" for 192.168.59.3 at 2015-10-05 21:32:33 +0000\",\"@timestamp\":\"2015-10-05...\",\"@version\":\"1\"...}\r\n```"},"comment":{"url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/comments/145728130","html_url":"https://github.com/dwbutler/logstash-logger/issues/61#issuecomment-145728130","issue_url":"https://api.github.com/repos/dwbutler/logstash-logger/issues/61","id":145728130,"user":{"login":"dwbutler","id":746336,"avatar_url":"https://avatars.githubusercontent.com/u/746336?v=3","gravatar_id":"","url":"https://api.github.com/users/dwbutler","html_url":"https://github.com/dwbutler","followers_url":"https://api.github.com/users/dwbutler/followers","following_url":"https://api.github.com/users/dwbutler/following{/other_user}","gists_url":"https://api.github.com/users/dwbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/dwbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwbutler/subscriptions","organizations_url":"https://api.github.com/users/dwbutler/orgs","repos_url":"https://api.github.com/users/dwbutler/repos","events_url":"https://api.github.com/users/dwbutler/events{/privacy}","received_events_url":"https://api.github.com/users/dwbutler/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T02:45:56Z","updated_at":"2015-10-06T02:45:56Z","body":"The problem is in the implementation of [MultiLogger#formatter=](https://github.com/dwbutler/logstash-logger/blob/master/lib/logstash-logger/multi_logger.rb#L25-L29), which overrides the formatter on each logger. LogStashLogger sets the formatter to the default `JsonLines` if no formatter is specified.\r\n\r\nI think it would be reasonable to change the implementation of MultiLogger so it only sets the formatter of each logger if a formatter isn't already specified."}}