{"id":8833,"date":"2012-09-26T21:56:29","date_gmt":"2012-09-26T16:26:29","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=8833"},"modified":"2012-09-26T21:56:29","modified_gmt":"2012-09-26T16:26:29","slug":"log-annotation","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/log-annotation\/","title":{"rendered":"@Log annotation"},"content":{"rendered":"<p>@Log : This annotation provides the log object in groovy class. By using it you don&#8217;t need to create the Logger object, it automatically provides log object.<\/p>\n<p style='padding-bottom:10px'>\n<p>Example:<\/p>\n<p style='padding-bottom:10px'>\n<p>[groovy]<br \/>\nimport groovy.util.logging.Log<\/p>\n<p>@Log<br \/>\nclass Person {<br \/>\n    String name<br \/>\n    String address<br \/>\n    String city<\/p>\n<p>    public void logDetails(){<br \/>\n        log.info(&quot;Name:::${name}&#8212;&gt;Address ::: ${address}&#8212;&gt; city :::${city}&quot;)<br \/>\n    }<br \/>\n}<\/p>\n<p>new Person(name:&quot;Mohit Garg&quot;,address:&quot;Address&quot;,city: &quot;city&quot;).logDetails()<br \/>\n[\/groovy]<\/p>\n<p style='padding-bottom:10px'>\n<p>It logs the details of the person object.<\/p>\n<p>Hope this will help you \ud83d\ude42<\/p>\n<p style='padding-bottom:10px'>\n","protected":false},"excerpt":{"rendered":"<p>@Log : This annotation provides the log object in groovy class. By using it you don&#8217;t need to create the Logger object, it automatically provides log object. Example: [groovy] import groovy.util.logging.Log @Log class Person { String name String address String city public void logDetails(){ log.info(&quot;Name:::${name}&#8212;&gt;Address ::: ${address}&#8212;&gt; city :::${city}&quot;) } } new Person(name:&quot;Mohit Garg&quot;,address:&quot;Address&quot;,city: &quot;city&quot;).logDetails() [&hellip;]<\/p>\n","protected":false},"author":47,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":6},"categories":[1],"tags":[9,471,288],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/8833"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=8833"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/8833\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=8833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=8833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=8833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}