Sunday, March 24, 2013

Java: Bad protected log and no chance to fix it

This post is related to the final question asked in one of mine previous post Java: Bad protected final log. How to resolve the problem of a bad log declaration, like the one below, without editing the code?
    protected final Logger log = LoggerFactory.getLogger(this.getClass());

First of all you should use slf4j , bridge every log framework to slf4j, then use logback as implementation for logging.
Then simply add or edit your logback configuration introducing the caller class as parameter. For example if you have a logback.xml file like this:

    
        
            %-5level %logger - %msg %xEx%n
        
    

    
        
    


change it into:

    
        
            %-5level %class - %msg %xEx%n
        
    

    
        
    



Now the problem is solved but remember: you are paying with performance, finding the caller requires more computational time than printing logger's name.

Related posts:

Wednesday, March 20, 2013

Lucene AppEngine 4.2 is out

I'm glad to announce the release of new versions of Lucene AppEngine project.

Big news! Performance improvements and memcache support!


What's new in LAE project:
  • Released LAE 4.1.0 as stable with performance improvements;
  • Released LAE-3.6.3-SNAPSHOT with performance improvements (base on Lucene 3.6.2);
  • Released LAE-4.2.0-SNAPSHOT with performance improvements and memcache support;
  • All released libraries available into maven repository, see project home page for details;

What's new in LAE examples and in Live Demo:
  • Aligned LAE Examples to latest LAE 4.2.0-SNAPSHOT version;
  • Live Demo up and running with latest LAE 4.2.0-SNAPSHOT version.

Enjoy!