Announcement Announcement Module
Collapse
No announcement yet.
Insert logger initilasation automatically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Insert logger initilasation automatically

    Hi,

    Nearly all of my classes have the following logger initialisation line:

    Code:
    public class JDBCHelper {
        protected Logger logger = Logger.getLogger(JDBCHelper.class);
        ...
    }
    Would it be possible, apparently using Spring's AOP, to automatically initialise those Logger objects, so the line would be just like:

    Code:
    public class JDBCHelper {
        protected Logger logger;
        ...
    }
    Not only the code would be more terse, but also the logging implementation would be more abstract, allowing easier changes if needed.

    Thanks,

  • #2
    currently, the logger no need to change.
    AOP is not to be abused.

    Comment

    Working...
    X