## Class LoggerPatternConverter

Description

LoggerPatternConverter is an abstract class that provides the formatting functionality that derived classes need.

Conversion specifiers in a conversion patterns are parsed to individual PatternConverters. Each of which is responsible for converting a logging event in a converter specific manner.

- version: $Revision: 1326626 $
- abstract:
- since: 0.3

Located in /log4php/pattern/LoggerPatternConverter.php (line 34)

Direct descendents

Class | Description
--- | ---
LoggerPatternConverterMDC | Returns the Mapped Diagnostic Context value corresponding to the given key.
LoggerPatternConverterNDC | Returns the full Nested Diagnostic Context.
LoggerPatternConverterClass | Returns the fully qualified class name of the class from which the logging request was issued.
LoggerPatternConverterLevel | Returns the event's level.
LoggerPatternConverterLocation | Returns the line number within the file from which the logging request was issued.
LoggerPatternConverterRelative | Returns the number of milliseconds elapsed since the start of the application until the creation of the logging event.
LoggerPatternConverterDate | Returns the date/time of the logging request.
LoggerPatternConverterProcess | Returns the PID of the current process.
LoggerPatternConverterSuperglobal | Returns a value from a superglobal array corresponding to the given key.
LoggerPatternConverterFile | Returns the name of the file from which the logging request was issued.
LoggerPatternConverterLogger | Returns the name of the logger which created the logging request.
LoggerPatternConverterMethod | Returns the name of the function or method from which the logging request was issued.
LoggerPatternConverterMessage | Returns the logged message.
LoggerPatternConverterLine | Returns the line number within the file from which the logging request was issued.
LoggerPatternConverterThrowable | Returns the throwable information linked to the logging event, if any.
LoggerPatternConverterLiteral | Returns the literal value passed in the constructor, without modifications.
LoggerPatternConverterSessionID | Returns the active session ID, or an empty string if out of session.
LoggerPatternConverterNewLine | Returns platform-specific newline character(s).

Variable Summary
LoggerFormattingInfo $formattingInfo
LoggerPatternConverter $next
array $option
Method Summary
LoggerPatternConverter __construct ([LoggerFormattingInfo $formattingInfo = null], [array $option = null])
void activateOptions ()
void convert (LoggerLoggingEvent $event)
void format (string &$sbuf, LoggerLoggingEvent $event)
Variables
LoggerFormattingInfo $formattingInfo (line 46)

Formatting information, parsed from pattern modifiers.

- access: protected

LoggerPatternConverter $next = null (line 40)

Next converter in the converter chain.

- access: public

array $option (line 52)

Converter-specific formatting options.

- access: protected

Methods
Constructor __construct (line 59)

Constructor

- access: public

LoggerPatternConverter __construct ([LoggerFormattingInfo $formattingInfo = null], [array $option = null])

- LoggerFormattingInfo $formattingInfo
- array $option

Redefined in descendants as:

- LoggerPatternConverterLiteral::__construct()

activateOptions (line 69)

Called in constructor. Converters which need to process the options can override this method.

- access: public

void activateOptions ()

Redefined in descendants as:

- LoggerPatternConverterMDC::activateOptions()
- LoggerPatternConverterClass::activateOptions()
- LoggerPatternConverterDate::activateOptions()
- LoggerPatternConverterSuperglobal::activateOptions()
- LoggerPatternConverterLogger::activateOptions()

convert (line 77)

Converts the logging event to the desired format. Derived pattern converters must implement this method.

- abstract:
- access: public

void convert (LoggerLoggingEvent $event)

- LoggerLoggingEvent $event

Redefined in descendants as:

- LoggerPatternConverterMDC::convert()
- LoggerPatternConverterNDC::convert()
- LoggerPatternConverterClass::convert()
- LoggerPatternConverterLevel::convert()
- LoggerPatternConverterLocation::convert()
- LoggerPatternConverterRelative::convert()
- LoggerPatternConverterDate::convert()
- LoggerPatternConverterProcess::convert()
- LoggerPatternConverterSuperglobal::convert()
- LoggerPatternConverterFile::convert()
- LoggerPatternConverterLogger::convert()
- LoggerPatternConverterMethod::convert()
- LoggerPatternConverterMessage::convert()
- LoggerPatternConverterLine::convert()
- LoggerPatternConverterThrowable::convert()
- LoggerPatternConverterLiteral::convert()
- LoggerPatternConverterSessionID::convert()
- LoggerPatternConverterNewLine::convert()

format (line 86)

Converts the event and formats it according to setting in the Formatting information object.

- access: public

void format (string &$sbuf, LoggerLoggingEvent $event)

- string &$sbuf: string buffer to write to
- LoggerLoggingEvent $event: Event to be formatted.

Documentation generated on Wed, 12 Nov 2025 18:40:35 +0900 by phpDocumentor 1.4.4