What you mean by 'implement' logging?
Do you want to use log4j in your application?
With JBoss 5/6/7 I recomment to use slf4j, the use is similar to log4j but you can use different loggin implementations.
Use in your classes:
private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(MyClass.class);
In that case you can use the category "x.x.MyClass" to set the logging level witin the jboss-logging.xml
Also I would recommend to use AS7 if you start because AS6 is not longer an active development branch.
Yes. I want to use log4j in my application. Actually we are using reporting tool which won't support the JBoss 7. That why we choose the version 6.
Regarding the logging implementation,
I declare the "logger" variable in the class level.
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(ConnectionCache.class);
and used in the class
logger.info("SQL value >>>> " +sql );
In the jboss-logging.xml
The ConnectionCache class is come under org.ezpar.fairfax package. Do you want implement in same way ?
To avoid compilation error for org.slf4j.LoggerFactory I added nlog4j-1.2.19.jar in classpath. Do you want to use different jar file ?
Where log file will create? Should I need to define path somewhere in the jboss-logging.xml or default folder( \server\default\log) ? Could you please explain steps to complete the logging process ?
nlog... looks like a slf4j library in mvn repo.
If you use AS7 you should use the jboss equivalent and make sure that you mark it as 'provided' that it is not packed in your application.
The implementation example looks good.
You do not need any extra configuration, the default installation of JBoss will have a root-logger on level INFO.
The log file is located in .../server/<profile>/log (AS4/5/6) or in the standalone or domain logging directories as server.log.
You can change the log level (as you mentioned before) or specify a separate log file in the JBoss logging configuration.