{"action":"created","issue":{"url":"https://api.github.com/repos/mp911de/lettuce/issues/193","repository_url":"https://api.github.com/repos/mp911de/lettuce","labels_url":"https://api.github.com/repos/mp911de/lettuce/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/mp911de/lettuce/issues/193/comments","events_url":"https://api.github.com/repos/mp911de/lettuce/issues/193/events","html_url":"https://github.com/mp911de/lettuce/issues/193","id":132927686,"number":193,"title":"Adapt, redirect or suppress logging about reconnecting","user":{"login":"Gerard-at-Streamit","id":17175063,"avatar_url":"https://avatars.githubusercontent.com/u/17175063?v=3","gravatar_id":"","url":"https://api.github.com/users/Gerard-at-Streamit","html_url":"https://github.com/Gerard-at-Streamit","followers_url":"https://api.github.com/users/Gerard-at-Streamit/followers","following_url":"https://api.github.com/users/Gerard-at-Streamit/following{/other_user}","gists_url":"https://api.github.com/users/Gerard-at-Streamit/gists{/gist_id}","starred_url":"https://api.github.com/users/Gerard-at-Streamit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gerard-at-Streamit/subscriptions","organizations_url":"https://api.github.com/users/Gerard-at-Streamit/orgs","repos_url":"https://api.github.com/users/Gerard-at-Streamit/repos","events_url":"https://api.github.com/users/Gerard-at-Streamit/events{/privacy}","received_events_url":"https://api.github.com/users/Gerard-at-Streamit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mp911de/lettuce/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-11T09:41:40Z","updated_at":"2016-02-11T20:37:18Z","closed_at":null,"body":"Hi,\r\n\r\nEvery now and then I get the message that connection was lost and restored:\r\n\r\n152342 [pool-1-thread-1] INFO com.lambdaworks.redis.protocol.ConnectionWatchdog - Reconnecting, last destination was gar.redistogo.com/23.23.209.139:10105\r\n152498 [pool-1-thread-1] INFO com.lambdaworks.redis.protocol.ConnectionWatchdog - Reconnected to gar.redistogo.com/23.23.209.139:10105\r\n\r\nUnder certain circumstances I want to change the format, redirect (to different log file) or suppress the message. I tried Log4J and found no way to achieve this. None of the following worked:\r\n\r\nIn log4j.properties (tried one at a time):\r\nlog4j.logger.com.lambdaworks.redis.protocol.ConnectionWatchdog=FATAL\r\nlog4j.category.com.lambdaworks.redis.protocol.ConnectionWatchdog=warn, stdout\r\nlog4j.logger.io.netty=FATAL\r\nlog4j.logger.com.lambdaworks.*=FATAL\r\nlog4j.rootLogger=OFF, stdout # Enable logging for specific other classes\r\n\r\nIn the Java code (tried one at a time):\r\nLogger.getLogger(\"io.netty\").setLevel(Level.OFF);\r\nLogger.getLogger(\"com.lambdaworks.redis.protocol.ConnectionWatchdog\").setLevel(Level.OFF);\r\n\r\nCreated a logback.xml, log4j.xml; alas, no joy.\r\n\r\nNor was there a setting in this package that enabled me to change logging settings.\r\n\r\nPlease advise!\r\n\r\nKind regards, Gerard"},"comment":{"url":"https://api.github.com/repos/mp911de/lettuce/issues/comments/183051674","html_url":"https://github.com/mp911de/lettuce/issues/193#issuecomment-183051674","issue_url":"https://api.github.com/repos/mp911de/lettuce/issues/193","id":183051674,"user":{"login":"Gerard-at-Streamit","id":17175063,"avatar_url":"https://avatars.githubusercontent.com/u/17175063?v=3","gravatar_id":"","url":"https://api.github.com/users/Gerard-at-Streamit","html_url":"https://github.com/Gerard-at-Streamit","followers_url":"https://api.github.com/users/Gerard-at-Streamit/followers","following_url":"https://api.github.com/users/Gerard-at-Streamit/following{/other_user}","gists_url":"https://api.github.com/users/Gerard-at-Streamit/gists{/gist_id}","starred_url":"https://api.github.com/users/Gerard-at-Streamit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gerard-at-Streamit/subscriptions","organizations_url":"https://api.github.com/users/Gerard-at-Streamit/orgs","repos_url":"https://api.github.com/users/Gerard-at-Streamit/repos","events_url":"https://api.github.com/users/Gerard-at-Streamit/events{/privacy}","received_events_url":"https://api.github.com/users/Gerard-at-Streamit/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T20:37:17Z","updated_at":"2016-02-11T20:37:17Z","body":"Hi Mark,\n\n \n\nThank you for the superfast and comprehensive feedback. I use Log4J () and replaced the log4j.properties with the contents you proposed. However, this seems to be ignored by the particular class:\n\n \n\n2016-02-11 21:33:18 INFO  RedisListener:98 - Subscribed to customer1\n\n2016-02-11 21:33:19 INFO  RedisListener:64 - customer1={\"password\":\"i-d1949862\",\"appName\":\"live\",\"ipAddress\":\"52.90.201.151\",\"username\":\"wowza\"}\n\n152309 [pool-1-thread-1] INFO com.lambdaworks.redis.protocol.ConnectionWatchdog - Reconnecting, last destination was gar.redistogo.com/23.23.209.139:10105\n\n152453 [pool-1-thread-1] INFO com.lambdaworks.redis.protocol.ConnectionWatchdog - Reconnected to gar.redistogo.com/23.23.209.139:10105\n\n \n\nAs the logging shows, the config is read (the first lines are formatted as per the instructions you sent and I copied). The last two lines have a different formatting…\n\n \n\nAny help would be much appreciated.\n\n \n\nPS: Given that the reconnects are irregular even if nothing happens, seems to suggest to me that the server does not disconnect on idle. Otherwise the idle connectino would be broken at regular intervals it would seem. \n\n \n\nKind regards,\n\nGerard\n\n \n\n\nStreamit BV\n\nLangendijk 7, 5652 AX Eindhoven, Nederland\n\nKvK: 17192664\n\n \n\n\nEmail:  <mailto:gerard@streamit.eu> gerard@streamit.eu\n\nTel.nr: 040 2556036\n\nWeb:  <http://www.streamit.eu/> www.streamit.eu\n\nSkype: gerardhollemans\n\n \n\n \n\nFrom: Mark Paluch [mailto:notifications@github.com] \nSent: Thursday, February 11, 2016 12:29\nTo: mp911de/lettuce <lettuce@noreply.github.com>\nCc: Gerard-at-Streamit <gerard@streamit.eu>\nSubject: Re: [lettuce] Adapt, redirect or suppress logging about reconnecting (#193)\n\n \n\nGerard, \n\nthanks for your ticket. Lettuce uses netty's logger resolution to find the available logger infrastructure. The order is:\n\n1.\tUse slf4j if possible\n2.\tUse log4j if possible\n3.\tFallback to java.util.logging if slf4j/log4j not available.\n\nYou need to check your log frameworks that are on the class-path.\n\nThe class, you're interested in muting is com.lambdaworks.redis.protocol.ConnectionWatchdog, setting the log-level to WARN or ERROR might help you to reduce the noise. An increased number of reconnects is a hint that either the network is unstable or that Redis drops inactive connections (can be configured).\n\nI attached a log4j.properties that works for this case:\n\nlog4j.rootLogger=INFO, stdout\n \nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.Target=System.out\nlog4j.appender.stdout.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n\n \nlog4j.logger.com.lambdaworks.redis.protocol.ConnectionWatchdog=ERROR\n\nPlease come back to me if that doesn't help.\n\n—\nReply to this email directly or view it on GitHub <https://github.com/mp911de/lettuce/issues/193#issuecomment-182816241> .  <https://github.com/notifications/beacon/AQYSF3aj87WAbmCxqrCmJ2vLpLzWDLKeks5pjGf9gaJpZM4HYAUt.gif> \n\n"}}