| java.lang.Object java.util.logging.Formatter org.objectweb.util.monolog.wrapper.javaLog.MonologFormatter
MonologFormatter | public class MonologFormatter extends Formatter (Code) | | The goal of this class is to format a LogRecord with regard to a pattern.
In order to support support additional logging layer on top monolog, this
class permits to specify package name or class names of its own logging layer.
By default the org.apache.commons.logging package is included. To specify
the list of names you have to assign the system property 'monolog.wrappers'
with a list (separated with commas or white spaces) of your names.
author: S.Chassande-Barrioz |
Method Summary | |
public String | format(LogRecord record) Format the given log record and return the formatted string.
The resulting formatted String will normally include a
localized and formated version of the LogRecord's message field.
The Formatter.formatMessage convenience method can (optionally)
be used to localize and format the message field.
Parameters: record - the log record to be formatted. | public void | format(Date date, StringBuffer sbuf) | public String | format(String msg, String levelName, String topic, long time) | public static String[] | getContext() Calculate the class name, the method name and the line number of the
logger user. | public String | getPattern() | public void | setPattern(String p) |
WRAPPERS_PROPERTY | final public static String WRAPPERS_PROPERTY(Code) | | |
pattern | int[] pattern(Code) | | An array of pattern id representing the user pattern
|
strPattern | String strPattern(Code) | | the pattern in the string format (user value)
|
strings | String[] strings(Code) | | An array of String used into the pattern
|
MonologFormatter | public MonologFormatter()(Code) | | |
MonologFormatter | public MonologFormatter(String strPattern)(Code) | | |
format | public String format(LogRecord record)(Code) | | Format the given log record and return the formatted string.
The resulting formatted String will normally include a
localized and formated version of the LogRecord's message field.
The Formatter.formatMessage convenience method can (optionally)
be used to localize and format the message field.
Parameters: record - the log record to be formatted. the formatted log record |
format | public void format(Date date, StringBuffer sbuf)(Code) | | Appends to sbuf the time in the format
"YYYY-MM-DD HH:mm:ss,SSS" for example, "2004-04-28 15:49:37,459"
Parameters: date - the date to format Parameters: sbuf - the string buffer to write to |
getContext | public static String[] getContext()(Code) | | Calculate the class name, the method name and the line number of the
logger user.
a string array containing 3 String[ "classname", "method name", "line number"]ex: ["com.foo.Bar", "myMethod", "512"] |
|
|