dev@glassfish.java.net

Re: Looking for clarification on message ID syntax

From: Carla Mott <Carla.Mott_at_Sun.COM>
Date: Fri, 23 Oct 2009 14:48:39 -0700

Hi Skehar,

I've looked through old functional specs and only have the info below
which lists the message id prefix. I did find an older version of the
  Uniform Logging Format document which is referenced in some of the
functional specs for logging. Basically everything I found is at least
6 years old. See excerpt below from that doc. I also looked at the
javadocs pointer you sent. You can see from the text below that we
didn't address white space in the message id.

I know that the code in the logviewer backend looks through the message
body (the message id is supposed to be the beginning chars of that) and
looks for a ':' as a delimiter and assumes that everything before that
is a message id.

I think it is reasonable to update the spec for the message id and spell
out what we want. We can look at the level of effort to clean up
message ids if needed. Remember the messageid is used as part of the
key for the diagnostic information that is in the resource bundle too.

Carla


Excerpt from Uniform Logging doc.
Appendix C: Recommendations: Unique MessageIDs and Internationalization

This appendix provides recommendations for generating unique MessageIDs
and internationalization for log messages.

1. Unique MessageIDs
A product can use its own mechanism for generating unique MessageIDs.
However, it is strongly recommended that every product use the following
convention, which was developed and implemented by Application Server 7.0.

A MessageId has two parts: 1) the module prefix and 2) unique number
within the module.


Module prefix. It is a string and shall be unique to identify a module
within a product. For example, the prefixes for CORBA and JavaMail
modules in Application Server 8.0 can be IOP and JML respectively.

Unique number: It is an integer and shall be unique within a module. In
general, a module is developed by a small team of people and generating
unique numbers for log messages within the module can be managed easily;
for example, unique numbers and their brief descriptions can be defined
in header/Java Interface files and can be maintained in the source code
control system.

2. Internationalization
<snip>


Message id prefix for the components:

Area Log Domains Constant Message IDPrefix
Enterprise ROOT_LOGGER UTIL/LCM
Server SERVER_LOGGER SERVER
EJB Container EJB_LOGGER EJB
MDB Container MDB_LOGGER MDB
AppClient Container ACC_LOGGER ACC
Web Container WEB_LOGGER WEB
Class Loader LOADER_LOGGER LDR
Config CONFIG_LOGGER CONF
Core CORE_LOGGER CORE
Naming NAMING_LOGGER JNDI/NAM
Security SECURITY_LOGGER SEC
Transaction TRANSACTION_LOGGER JTS
Admin ADMIN_LOGGER ADM
Deployment DPL_LOGGER DPL
Verifier APPVERIFY_LOGGER VRFY
Util UTIL_LOGGER UTIL
JaxR JAXR_LOGGER JAXR
JaxRPC JAXRPC_LOGGER JAXRPC
SAAJ SAAJ_LOGGER SAAJ
CORBA CORBA_LOGGER IOP
JavaMail JAVAMAIL_LOGGER JML
JMS JMS_LOGGER JMS
JTA JTA_LOGGER JTX
Connector RAR_LOGGER RAR
CMP CMP_LOGGER CMP
JDO JDO_LOGGER JDO


Sekhar Vajjhala wrote:
> I am looking for clarification on the GlassFish V3 message ID syntax :
>
> To develop the tool (discussed in another thread), I started with the
> GlassFish V3 messaging log format described in
> http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishV3LoggingMessageFormat
>
> . However, that messaging format is not detailed enough - for
> e.g. treatment of white spaces, separator between key value pairs,
> line continuations etc. Since we are looking for messages in
> LogStrings.properties, one assumption I am making is that the syntax
> of the message IDs follows the syntax described in the Java doc for
> Properties (
> http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.Reader%29
>
> ).
>
> Must message ID present in GF V3 resource bundles
> comply with the syntax described in the above javadoc ? Or are there
> different requirements on the syntax ?
>
> The tool currently checks for some of the syntax described in the
> javadoc that I referenced above (and I can add the rest of the checks i.e.
> unless there message ID syntax requirements are different from those in
> the javadoc).
> So the tool will for e.g.
>
> 1. flag an error for text of a message id can be split across multiple
> lines. e.g.
> sgmt.instancehang_hctimeout=SGMT0232: Instance hang check - The
> threshold timeout= {1} specified for server: {0} is l
> ess than the load balancer health checker configured for it. Raising
> this timeout to its load balancer health checker va
> lue of {2}.
>
> 2. Some messages ids have a white space after = e.g.
> enterprise_util.UNIX.error.0 = UTIL9000: UNIX command completed
> successfully.
>
> 3. A space betweeen upppercase message id and number. e.g. ( RAR 7014 )
> below
> error_reading_connectorservice_elt=RAR 7014: Error reading Connector
> Service Element from domain.xml while trying to get
> shutdown-timeout-in-seconds value. Continuing wih the default shutdown
> timeout value
>
> Sekhar Vajjhala
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>