|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.message.LocalizedMessage
public class LocalizedMessage
This class is not the recommended way to Localize messages. It is provided to provide some level of compatibility with Log4j 1.x. The recommended way to localize messages is to simply log a message id. Log events should then be recorded without formatting into some kind of data store. The application that is used to read the events and display them to the user should also localize and format the messages for the end user.
Method Summary | |
---|---|
protected ResourceBundle |
getBundle(String key,
Locale locale,
boolean loop)
Override this to use a ResourceBundle.Control in Java 6 |
String |
getFormat()
Gets the format portion of the Message. |
String |
getFormattedMessage()
Returns the formatted message after looking up the format in the resource bundle. |
String |
getLoggerName()
Returns the name of the Logger. |
Object[] |
getParameters()
Gets parameter values, if any. |
Throwable |
getThrowable()
Gets the throwable, if any. |
void |
setLoggerName(String name)
Set the name of the Logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalizedMessage(String messagePattern, Object[] arguments)
messagePattern
- the message pattern that to be checked for placeholders.arguments
- the argument array to be converted.public LocalizedMessage(String bundleId, String key, Object[] arguments)
public LocalizedMessage(ResourceBundle bundle, String key, Object[] arguments)
public LocalizedMessage(String bundleId, Locale locale, String key, Object[] arguments)
public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object[] arguments)
public LocalizedMessage(Locale locale, String key, Object[] arguments)
public LocalizedMessage(String messagePattern, Object arg)
public LocalizedMessage(String bundleId, String key, Object arg)
public LocalizedMessage(ResourceBundle bundle, String key, Object arg)
public LocalizedMessage(String bundleId, Locale locale, String key, Object arg)
public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object arg)
public LocalizedMessage(Locale locale, String key, Object arg)
public LocalizedMessage(String messagePattern, Object arg1, Object arg2)
public LocalizedMessage(String bundleId, String key, Object arg1, Object arg2)
public LocalizedMessage(ResourceBundle bundle, String key, Object arg1, Object arg2)
public LocalizedMessage(String bundleId, Locale locale, String key, Object arg1, Object arg2)
public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object arg1, Object arg2)
public LocalizedMessage(Locale locale, String key, Object arg1, Object arg2)
Method Detail |
---|
public void setLoggerName(String name)
setLoggerName
in interface LoggerNameAwareMessage
name
- The name of the Logger.public String getLoggerName()
getLoggerName
in interface LoggerNameAwareMessage
public String getFormattedMessage()
getFormattedMessage
in interface Message
public String getFormat()
Message
getFormat
in interface Message
public Object[] getParameters()
Message
getParameters
in interface Message
public Throwable getThrowable()
Message
getThrowable
in interface Message
protected ResourceBundle getBundle(String key, Locale locale, boolean loop)
key
- The key to the bundle.locale
- The locale to use when formatting the message.loop
- If true the key will be treated as a package or class name and a resource bundle will
be located based on all or part of the package name. If false the key is expected to be the exact bundle id.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.