James Perkins [
http://community.jboss.org/people/jamezp] modified the document:
"Logging for JBoss Application Server 7 Subsystems"
To view the document, visit:
http://community.jboss.org/docs/DOC-17334
--------------------------------------------------------------
h3. *General Rules:*
* All exceptions and messages require a translation method in the @MessageBundle.
* All info and higher messages being logged require a translation method in the
@MessageLogger.
* Messages in both the @MessageBundle and @MessageLogger should have an id***. Note
though there are cases, specifically some methods in the @MessageBundle, that do not need
id's. These typically include messages that are not being used in exceptions.
*** A list of id's can be found here
http://community.jboss.org/docs/DOC-16810
http://community.jboss.org/wiki/LoggingIds
h3. *Examples:*
*
*
*Before:*
@Override
public void start(StartContext context) throws StartException {
try {
final JBossThreadFactory threadFactory = new JBossThreadFactory(new
ThreadGroup("ServerDeploymentRepository-temp-threads"), Boolean.FALSE, null,
"%G - %t", null, null, AccessController.getContext());
tempFileProvider = TempFileProvider.create("temp",
Executors.newScheduledThreadPool(2, threadFactory));
} catch (IOException e) {
throw new StartException("Failed to create temp file provider");
}
log.debugf("%s started", ServerDeploymentRepository.class.getSimpleName());
}
*Methods added to DeploymentRepositoryMessages:*
/**
* Creates an exception indicating a failure to create a temp file provider.
*
* @return a {@link StartException} for the error.
*/
@Message(id = 14900, value = "Failed to create temp file provider")
StartException failedCreatingTempProvider();
*After:*
@Override
public void start(StartContext context) throws StartException {
try {
final JBossThreadFactory threadFactory = new JBossThreadFactory(new
ThreadGroup("ServerDeploymentRepository-temp-threads"), Boolean.FALSE, null,
"%G - %t", null, null, AccessController.getContext());
tempFileProvider = TempFileProvider.create("temp",
Executors.newScheduledThreadPool(2, threadFactory));
} catch (IOException e) {
throw MESSAGES.failedCreatingTempProvider();
}
ROOT_LOGGER.debugf("%s started",
ServerDeploymentRepository.class.getSimpleName());
}
--------------------------------------------------------------
Comment by going to Community
[
http://community.jboss.org/docs/DOC-17334]
Create a new document in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=102&am...]