{"action":"published","release":{"url":"https://api.github.com/repos/cmebarrow/log4j.util/releases/1797765","assets_url":"https://api.github.com/repos/cmebarrow/log4j.util/releases/1797765/assets","upload_url":"https://uploads.github.com/repos/cmebarrow/log4j.util/releases/1797765/assets{?name}","html_url":"https://github.com/cmebarrow/log4j.util/releases/tag/1.0.0.1-alpha","id":1797765,"tag_name":"1.0.0.1-alpha","target_commitish":"master","name":"Release 1.0.0.1-alpha","draft":false,"author":{"login":"cmebarrow","id":3606936,"avatar_url":"https://avatars.githubusercontent.com/u/3606936?v=3","gravatar_id":"","url":"https://api.github.com/users/cmebarrow","html_url":"https://github.com/cmebarrow","followers_url":"https://api.github.com/users/cmebarrow/followers","following_url":"https://api.github.com/users/cmebarrow/following{/other_user}","gists_url":"https://api.github.com/users/cmebarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/cmebarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmebarrow/subscriptions","organizations_url":"https://api.github.com/users/cmebarrow/orgs","repos_url":"https://api.github.com/users/cmebarrow/repos","events_url":"https://api.github.com/users/cmebarrow/events{/privacy}","received_events_url":"https://api.github.com/users/cmebarrow/received_events","type":"User","site_admin":false},"prerelease":true,"created_at":"2015-09-11T03:02:24Z","published_at":"2015-09-11T03:20:13Z","assets":[{"url":"https://api.github.com/repos/cmebarrow/log4j.util/releases/assets/856104","id":856104,"name":"log4j.util-1.0.0.1-alpha.jar","label":null,"uploader":{"login":"cmebarrow","id":3606936,"avatar_url":"https://avatars.githubusercontent.com/u/3606936?v=3","gravatar_id":"","url":"https://api.github.com/users/cmebarrow","html_url":"https://github.com/cmebarrow","followers_url":"https://api.github.com/users/cmebarrow/followers","following_url":"https://api.github.com/users/cmebarrow/following{/other_user}","gists_url":"https://api.github.com/users/cmebarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/cmebarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmebarrow/subscriptions","organizations_url":"https://api.github.com/users/cmebarrow/orgs","repos_url":"https://api.github.com/users/cmebarrow/repos","events_url":"https://api.github.com/users/cmebarrow/events{/privacy}","received_events_url":"https://api.github.com/users/cmebarrow/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":6640,"download_count":0,"created_at":"2015-09-11T03:20:06Z","updated_at":"2015-09-11T03:20:07Z","browser_download_url":"https://github.com/cmebarrow/log4j.util/releases/download/1.0.0.1-alpha/log4j.util-1.0.0.1-alpha.jar"}],"tarball_url":"https://api.github.com/repos/cmebarrow/log4j.util/tarball/1.0.0.1-alpha","zipball_url":"https://api.github.com/repos/cmebarrow/log4j.util/zipball/1.0.0.1-alpha","body":"### Example usage\r\n\r\nCopy the jar file into Kaazing WebSocket Gateway lib directory\r\n\r\nEdit log4j config.xml to:\r\n\r\n- add the following appender:\r\n```\r\n   <appender name=\"Diagnostics\" class=\"org.kaazing.log4j.appenders.TriggeredRollingFileAppender\">\r\n        <param name=\"File\" value=\"${GATEWAY_LOG_DIRECTORY}/diagnostics.log\"/>\r\n        <param name=\"Append\" value=\"false\"/>\r\n        <param name=\"MaximumMessages\" value=\"20000\"/>\r\n        <param name=\"truncateAfter\" value=\"200\"/>\r\n        <param name=\"triggerPattern\" value=\".*Unexpected exception on client connection.*\"/>\r\n        <param name=\"MaxFileSize\" value=\"50MB\" />\r\n        <param name = \"MaxBackupIndex\" value = \"10\" />\r\n        <layout class=\"org.apache.log4j.PatternLayout\">\r\n            <param name=\"ConversionPattern\" value=\"%d [%t] [%c] %-5p %m%n\"/>\r\n        </layout>\r\n    </appender>\r\n```\r\nSet the triggerPattern to a regular expression which will match log messages that represent a condition you need trace level messages for.\r\n\r\n- Change the ErrorFile appender to add a LevelRangeFilter so it only logs info messages or above:\r\n```\r\n    <appender name=\"ErrorFile\" class=\"org.apache.log4j.RollingFileAppender\">\r\n        <param name=\"File\" value=\"${GATEWAY_LOG_DIRECTORY}/error.log\"/>\r\n        <param name=\"Append\" value=\"false\"/>\r\n        <!-- max file size default is 10MB -->\r\n        <!--param name=\"MaxFileSize\" value=\"100000\"/-->\r\n\r\n        <layout class=\"org.apache.log4j.PatternLayout\">\r\n            <param name=\"ConversionPattern\" value=\"%d [%t] %-5p %m%n\"/>\r\n        </layout>\r\n        <filter class=\"org.apache.log4j.varia.LevelRangeFilter\">\r\n            <param name=\"LevelMin\" value=\"INFO\" />\r\n        </filter>\r\n    </appender>\r\n```\r\n- Change the root logger to the following\r\n```\r\n   <root>\r\n       <priority value=\"trace\"/>\r\n       <appender-ref ref=\"ErrorFile\"/>\r\n       <appender-ref ref=\"Diagnostics\"/>\r\n   </root>\r\n```\r\nStart up the gateway\r\n\r\nWhen log messages of interest are logged by the gateway the Diagnostics appender will write the last trace level log N messages to the diagnostics.log file."}}