Monolog 2.x formatter for formatting logs on App Engine flexible environment.

If you are using Monolog 1.x, use {@see \Google\Cloud\Core\Logger\AppEngineFlexFormatter} instead.

CloneableInstantiable
ExtendsMonolog\Formatter\LineFormatter
Monolog\Formatter\NormalizerFormatter
ImplementsMonolog\Formatter\FormatterInterface
Constants
public Monolog\Formatter\NormalizerFormatter::SIMPLE_DATE = 'Y-m-d\TH:i:sP'
public Monolog\Formatter\LineFormatter::SIMPLE_FORMAT = '[%datetime%] %channel%.%level_name%: %message% %context% %extra% '
Methods
public __construct( $format = NULL, $dateFormat = NULL, $ignoreEmptyContextAndExtra = false)
 


    public Monolog\Formatter\LineFormatter::allowInlineLineBreaks(bool $allow = true)
    public format(array $record) : string
     
    Get the plain text message with LineFormatter's format method and add metadata including the trace id then return the json string.

    • return string The formatted record
    public Monolog\Formatter\LineFormatter::formatBatch(array $records) : string
    public Monolog\Formatter\NormalizerFormatter::getMaxNormalizeDepth() : int
     
    The maximum number of normalization levels to go through

    public Monolog\Formatter\NormalizerFormatter::getMaxNormalizeItemCount() : int
     
    The maximum number of items to normalize per level

    public Monolog\Formatter\LineFormatter::ignoreEmptyContextAndExtra(bool $ignore = true)
    public Monolog\Formatter\LineFormatter::includeStacktraces(bool $include = true)
    public Monolog\Formatter\NormalizerFormatter::setJsonPrettyPrint(bool $enable) : self
     
    Enables `json_encode` pretty print.

    public Monolog\Formatter\NormalizerFormatter::setMaxNormalizeDepth(int $maxNormalizeDepth) : self
    public Monolog\Formatter\NormalizerFormatter::setMaxNormalizeItemCount(int $maxNormalizeItemCount) : self
    public Monolog\Formatter\LineFormatter::stringify( $value) : string
    Properties
    protected Monolog\Formatter\LineFormatter::$allowInlineLineBreaks
    protected Monolog\Formatter\NormalizerFormatter::$dateFormat
    protected Monolog\Formatter\LineFormatter::$format
    protected Monolog\Formatter\LineFormatter::$ignoreEmptyContextAndExtra
    protected Monolog\Formatter\LineFormatter::$includeStacktraces
    protected Monolog\Formatter\NormalizerFormatter::$maxNormalizeDepth
    protected Monolog\Formatter\NormalizerFormatter::$maxNormalizeItemCount
    Methods
    protected Monolog\Formatter\NormalizerFormatter::addJsonEncodeOption( $option)
    protected Monolog\Formatter\LineFormatter::convertToString( $data) : string
    protected Monolog\Formatter\NormalizerFormatter::formatDate(DateTimeInterface $date)
    protected formatPayload(array $record, $message)
    protected Monolog\Formatter\NormalizerFormatter::normalize( $data, int $depth = 0)
     


    • return int|bool|string|null|array
    protected Monolog\Formatter\LineFormatter::normalizeException(Throwable $e, int $depth = 0) : string
     


    • suppress PhanParamSignatureMismatch
    protected Monolog\Formatter\NormalizerFormatter::removeJsonEncodeOption( $option)
    protected Monolog\Formatter\LineFormatter::replaceNewlines(string $str) : string
    protected Monolog\Formatter\NormalizerFormatter::toJson( $data, bool $ignoreErrors = false) : string
     
    Return the JSON representation of a value

    • throws RuntimeException if encoding fails and errors are not ignored
    • return string if encoding fails and ignoreErrors is true 'null' is returned
    Methods
    private Monolog\Formatter\LineFormatter::formatException(Throwable $e) : string
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only