tags:

views:

54

answers:

1

what is best way to use logger in JSF application

+1  A: 

Well, for example using log4j:

public class SomeManagedBean {
    private static final Logger logger = Logger.getLogger(SomeManagedBean.class);

    public String someAction() {
       logger.debug("Action 'someAction()` executed");
       // some code
    }
}
Bozho
thank u bozho.. i am using netbeans ide, is there any plug-in available to insert logger code automatically instead of writing it every-time for each method and class.
rahul_d_m
not any that I'm aware of. But it is fairly simple ti write it by hand - you'll get used to it.
Bozho