//used to get logger with category name
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("GENERAL");
// set thread context values (optional)
ThreadContext.put("id", "My id");
ThreadContext.put("action_name", "My Action");
logger.info("Logging info");
logger.error("Logging error");
//by default the text will be displayed in the form of:
//0000-00-00 00:00:00,000 [THREAD] [My id My Action] INFO GENERAL - Logging info
//0000-00-00 00:00:00,000 [THREAD] [My id My Action] ERROR GENERAL - Logging error