This appendix provides a reference to elements of the msgcat.dtd
schema, the schema behind XML you use to configure message catalog elements for log messages you can localize.
Oracle CEP provides a number of message catalog elements that you use to define log messages that you can localize.
The top-level Oracle CEP message catalog elements are organized into the following hierarchies, depending on message catalog type:
This section provides the following message catalog examples:
Example G-3 Log Message Catalog
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Example G-4 Simple Text Catalog
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog> l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0"> <message messageid="FileMenuTitle"> <messagebody> File </messagebody> </message> </message_catalog>
This element represents the log message catalog.
The message_catalog
element supports the following child elements:
Table G-1 lists the attributes of the message_catalog
element.
Table G-1 Attributes of the message_catalog Element
Attribute | Description | Data Type | Required? |
---|---|---|---|
|
Java package containing generated Logger classes for this catalog. The classes are named after the catalog file name. For example, for a catalog using Syntax: standard Java package syntax. Example: Default: |
|
No. |
|
A Java package containing generated LogLocalizer properties for the catalog. For example, for a catalog called
Syntax: standard Java package syntax. Example: Default: |
|
No. |
|
An acronym identifying the subsystem associated with this catalog. The name of the subsystem is included in the server log and is used for message isolation purposes. Example: |
|
Yes. |
|
Specifies the version of the Use: Must be Syntax: Example: |
|
Yes. |
|
Specifies the lowest message ID used in this catalog.Syntax: one to six decimal digits.Example: Valid values are:
|
|
No. |
|
Specifies the highest message ID used in this catalog. Syntax: one to six decimal digits. Example: Valid values are:
|
|
No. |
|
Indicates whether to generate additional methods that return loggable objects. Example: Valid values are:
Default: |
|
|
|
Specifies a <[prefix-]id> Where For example, if prefix is Syntax: any Example: Valid values are:
|
|
No. |
|
An optional attribute that serves to document the catalog content. Example: |
|
No. |
The following example shows how to use the message_catalog
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Use this element to define a formal log message.
The logmessage
component configuration element supports the following child elements:
Table G-2 lists the attributes of the logmessage
component configuration element.
Table G-2 Attributes of the logmessage Element
Attribute | Description | Data Type | Required? |
---|---|---|---|
|
Unique identifier for this log message. Uniqueness should extend across all catalogs. Value must be in range defined by Use: Value must be in the range defined by the Syntax: one to six decimal digits. Example: |
|
Yes. |
|
Date/time stamp used for managing modifications to this message. The date is supplied by utilities that run on the catalogs. Use: The date is supplied by utilities that run on the catalogs. Syntax: |
|
No. |
|
Indicates the severity of the log message. User-defined catalogs may only use Valid values:
Example: |
|
Yes. |
|
Method signature for logging this message. The syntax is the standard Java method signature, without the qualifiers, semicolon, and extensions. Argument types can be any Java primitive or class. Classes must be fully qualified if not in Arguments can be any valid name, but should follow the convention of |
|
Yes. |
|
Specifies type of method to generate. Methods can be:
Valid values are:
Default: |
|
No. |
|
Indicates whether to generate a stack trace for Throwable arguments. When the value is Valid values are:
Default: |
|
No. |
|
Indicates whether message is retired. A retired message is one that was used in a previous release but is now obsolete and not used in the current version. Retired messages are not represented in any generated classes or resource bundles. Valid values are:
Default: |
|
No. |
The following example shows how to use the logmessage
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Use this element to define an informal log message.
Table G-3 lists the attributes of the message
element.
Table G-3 Attributes of the message Element
Attribute | Description | Data Type | Required? |
---|---|---|---|
|
Unique identifier for this log message in alpha-numeric string format. Uniqueness is required only within the context of this catalog. |
|
Yes. |
|
Date/time stamp used for managing modifications to this message. The date is supplied by utilities that run on the catalogs. Use: The date is supplied by utilities that run on the catalogs. Syntax: |
|
No. |
|
Method signature for formatting this message. The syntax is a standard Java method signature, less return type, qualifiers, semicolon, and extensions. The return type is always For each argument there must be at least one corresponding placeholder in the Example: This example would result in a method in the public String getNoAuthorization(String filename, java.util.Date creDate) |
|
No. |
|
Indicates whether message is retired. A retired message is one that was used in a previous release but is now obsolete and not used in the current version. Retired messages are not represented in any generated classes or resource bundles. Valid values are:
Default: |
|
No. |
The following example shows how to use the message
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog> l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0"> <message messageid="FileMenuTitle"> <messagebody> File </messagebody> </message> </message_catalog>
Use this element to define a short description for this message.
The messagebody element can contain a 0 to 10 placeholder as {n}
, to be replaced by the appropriate argument when the log message is localized.
The message body must include placeholders for all arguments listed in the corresponding method attribute, unless the last argument is throwable or a subclass.
Be careful when using single quotes, because these are specially parsed by java.text.MessageFormat
. If it is appropriate to quote a message argument, use double quotes (Section G.5.3, "Example" shows). If a message has one or more placeholders, in order for a single quote to appear correctly (for example, as an apostrophe), it must be followed by a second single quote.
Syntax: a String
The following example shows how to use the messagebody
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, "{0}" on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Use this element to define a detailed description of the event. This element may contain any argument place holders.
Syntax: a String
The following example shows how to use the messagedetail
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Use this element to define the root cause of the problem. This element can contain any argument place holders.
Syntax: a String
.
The following example shows how to use the cause
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>
Use this element to define the recommended resolution. This element can contain any argument place holders.
Syntax: a String
.
The following example shows how to use the action
element in log message catalog file:
<?xml version="1.0"?> <!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> <message_catalog l10n_package="programs.utils" i18n_package="programs.utils" subsystem="MYUTIL" version="1.0" baseid="600000" endid="600100"> <logmessage messageid="600001" severity="warning" method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)"> <messagebody> Could not open file, {0} on {1,date} after {2,number} attempts. </messagebody> <messagedetail> The configuration for this application will be defaulted to factory settings. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable. </messagedetail> <cause> The user is not authorized to use custom configurations. Custom configuration information resides in file, {0}, created on {1,date}, but is not readable.The attempt has been logged to the security log. </cause> <action> The user needs to gain approriate authorization or learn to live with the default settings. </action> </logmessage> </message_catalog>