Showing preview only (1,039K chars total). Download the full file or copy to clipboard to get everything.
Repository: Seldaek/monolog
Branch: main
Commit: 6db20ca02921
Files: 246
Total size: 969.4 KB
Directory structure:
gitextract_dblqzcyu/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_Report.md
│ │ ├── Feature.md
│ │ └── Question.md
│ ├── SECURITY.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── continuous-integration.yml
│ ├── lint.yml
│ └── phpstan.yml
├── .gitignore
├── .php-cs-fixer.php
├── CHANGELOG.md
├── LICENSE
├── README.md
├── UPGRADE.md
├── _config.yml
├── composer.json
├── doc/
│ ├── 01-usage.md
│ ├── 02-handlers-formatters-processors.md
│ ├── 03-utilities.md
│ ├── 04-extending.md
│ ├── message-structure.md
│ └── sockets.md
├── phpstan-baseline-8.2.neon
├── phpstan-baseline.neon
├── phpstan-ignore-by-php-version.neon.php
├── phpstan.neon.dist
├── phpunit.xml.dist
├── src/
│ └── Monolog/
│ ├── Attribute/
│ │ ├── AsMonologProcessor.php
│ │ └── WithMonologChannel.php
│ ├── DateTimeImmutable.php
│ ├── ErrorHandler.php
│ ├── Formatter/
│ │ ├── ChromePHPFormatter.php
│ │ ├── ElasticaFormatter.php
│ │ ├── ElasticsearchFormatter.php
│ │ ├── FlowdockFormatter.php
│ │ ├── FluentdFormatter.php
│ │ ├── FormatterInterface.php
│ │ ├── GelfMessageFormatter.php
│ │ ├── GoogleCloudLoggingFormatter.php
│ │ ├── HtmlFormatter.php
│ │ ├── JsonFormatter.php
│ │ ├── LineFormatter.php
│ │ ├── LogglyFormatter.php
│ │ ├── LogmaticFormatter.php
│ │ ├── LogstashFormatter.php
│ │ ├── MongoDBFormatter.php
│ │ ├── NormalizerFormatter.php
│ │ ├── ScalarFormatter.php
│ │ ├── SyslogFormatter.php
│ │ └── WildfireFormatter.php
│ ├── Handler/
│ │ ├── AbstractHandler.php
│ │ ├── AbstractProcessingHandler.php
│ │ ├── AbstractSyslogHandler.php
│ │ ├── AmqpHandler.php
│ │ ├── BrowserConsoleHandler.php
│ │ ├── BufferHandler.php
│ │ ├── ChromePHPHandler.php
│ │ ├── CouchDBHandler.php
│ │ ├── CubeHandler.php
│ │ ├── Curl/
│ │ │ └── Util.php
│ │ ├── DeduplicationHandler.php
│ │ ├── DoctrineCouchDBHandler.php
│ │ ├── DynamoDbHandler.php
│ │ ├── ElasticaHandler.php
│ │ ├── ElasticsearchHandler.php
│ │ ├── ErrorLogHandler.php
│ │ ├── FallbackGroupHandler.php
│ │ ├── FilterHandler.php
│ │ ├── FingersCrossed/
│ │ │ ├── ActivationStrategyInterface.php
│ │ │ ├── ChannelLevelActivationStrategy.php
│ │ │ └── ErrorLevelActivationStrategy.php
│ │ ├── FingersCrossedHandler.php
│ │ ├── FirePHPHandler.php
│ │ ├── FleepHookHandler.php
│ │ ├── FlowdockHandler.php
│ │ ├── FormattableHandlerInterface.php
│ │ ├── FormattableHandlerTrait.php
│ │ ├── GelfHandler.php
│ │ ├── GroupHandler.php
│ │ ├── Handler.php
│ │ ├── HandlerInterface.php
│ │ ├── HandlerWrapper.php
│ │ ├── IFTTTHandler.php
│ │ ├── InsightOpsHandler.php
│ │ ├── LogEntriesHandler.php
│ │ ├── LogglyHandler.php
│ │ ├── LogmaticHandler.php
│ │ ├── MailHandler.php
│ │ ├── MandrillHandler.php
│ │ ├── MissingExtensionException.php
│ │ ├── MongoDBHandler.php
│ │ ├── NativeMailerHandler.php
│ │ ├── NewRelicHandler.php
│ │ ├── NoopHandler.php
│ │ ├── NullHandler.php
│ │ ├── OverflowHandler.php
│ │ ├── PHPConsoleHandler.php
│ │ ├── ProcessHandler.php
│ │ ├── ProcessableHandlerInterface.php
│ │ ├── ProcessableHandlerTrait.php
│ │ ├── PsrHandler.php
│ │ ├── PushoverHandler.php
│ │ ├── RedisHandler.php
│ │ ├── RedisPubSubHandler.php
│ │ ├── RollbarHandler.php
│ │ ├── RotatingFileHandler.php
│ │ ├── SamplingHandler.php
│ │ ├── SendGridHandler.php
│ │ ├── Slack/
│ │ │ └── SlackRecord.php
│ │ ├── SlackHandler.php
│ │ ├── SlackWebhookHandler.php
│ │ ├── SocketHandler.php
│ │ ├── SqsHandler.php
│ │ ├── StreamHandler.php
│ │ ├── SymfonyMailerHandler.php
│ │ ├── SyslogHandler.php
│ │ ├── SyslogUdp/
│ │ │ └── UdpSocket.php
│ │ ├── SyslogUdpHandler.php
│ │ ├── TelegramBotHandler.php
│ │ ├── TestHandler.php
│ │ ├── WebRequestRecognizerTrait.php
│ │ ├── WhatFailureGroupHandler.php
│ │ └── ZendMonitorHandler.php
│ ├── JsonSerializableDateTimeImmutable.php
│ ├── Level.php
│ ├── LogRecord.php
│ ├── Logger.php
│ ├── Processor/
│ │ ├── ClosureContextProcessor.php
│ │ ├── GitProcessor.php
│ │ ├── HostnameProcessor.php
│ │ ├── IntrospectionProcessor.php
│ │ ├── LoadAverageProcessor.php
│ │ ├── MemoryPeakUsageProcessor.php
│ │ ├── MemoryProcessor.php
│ │ ├── MemoryUsageProcessor.php
│ │ ├── MercurialProcessor.php
│ │ ├── ProcessIdProcessor.php
│ │ ├── ProcessorInterface.php
│ │ ├── PsrLogMessageProcessor.php
│ │ ├── TagProcessor.php
│ │ ├── UidProcessor.php
│ │ └── WebProcessor.php
│ ├── Registry.php
│ ├── ResettableInterface.php
│ ├── SignalHandler.php
│ ├── Test/
│ │ ├── MonologTestCase.php
│ │ └── TestCase.php
│ └── Utils.php
└── tests/
├── Monolog/
│ ├── Attribute/
│ │ ├── AsMonologProcessorTest.php
│ │ └── WithMonologChannelTest.php
│ ├── ErrorHandlerTest.php
│ ├── Formatter/
│ │ ├── ChromePHPFormatterTest.php
│ │ ├── ElasticaFormatterTest.php
│ │ ├── ElasticsearchFormatterTest.php
│ │ ├── FlowdockFormatterTest.php
│ │ ├── FluentdFormatterTest.php
│ │ ├── GelfMessageFormatterTest.php
│ │ ├── GoogleCloudLoggingFormatterTest.php
│ │ ├── JsonFormatterTest.php
│ │ ├── LineFormatterTest.php
│ │ ├── LogglyFormatterTest.php
│ │ ├── LogmaticFormatterTest.php
│ │ ├── LogstashFormatterTest.php
│ │ ├── MongoDBFormatterTest.php
│ │ ├── NormalizerFormatterTest.php
│ │ ├── ScalarFormatterTest.php
│ │ ├── SyslogFormatterTest.php
│ │ └── WildfireFormatterTest.php
│ ├── Handler/
│ │ ├── AbstractHandlerTest.php
│ │ ├── AbstractProcessingHandlerTest.php
│ │ ├── AmqpHandlerTest.php
│ │ ├── BrowserConsoleHandlerTest.php
│ │ ├── BufferHandlerTest.php
│ │ ├── ChromePHPHandlerTest.php
│ │ ├── CouchDBHandlerTest.php
│ │ ├── DeduplicationHandlerTest.php
│ │ ├── DoctrineCouchDBHandlerTest.php
│ │ ├── DynamoDbHandlerTest.php
│ │ ├── ElasticaHandlerTest.php
│ │ ├── ElasticsearchHandlerTest.php
│ │ ├── ErrorLogHandlerTest.php
│ │ ├── ExceptionTestHandler.php
│ │ ├── FallbackGroupHandlerTest.php
│ │ ├── FilterHandlerTest.php
│ │ ├── FingersCrossedHandlerTest.php
│ │ ├── FirePHPHandlerTest.php
│ │ ├── Fixtures/
│ │ │ └── .gitkeep
│ │ ├── FleepHookHandlerTest.php
│ │ ├── FlowdockHandlerTest.php
│ │ ├── GelfHandlerTest.php
│ │ ├── GroupHandlerTest.php
│ │ ├── HandlerWrapperTest.php
│ │ ├── InsightOpsHandlerTest.php
│ │ ├── LogEntriesHandlerTest.php
│ │ ├── LogmaticHandlerTest.php
│ │ ├── MailHandlerTest.php
│ │ ├── MongoDBHandlerTest.php
│ │ ├── NativeMailerHandlerTest.php
│ │ ├── NewRelicHandlerTest.php
│ │ ├── NoopHandlerTest.php
│ │ ├── NullHandlerTest.php
│ │ ├── OverflowHandlerTest.php
│ │ ├── PHPConsoleHandlerTest.php
│ │ ├── ProcessHandlerTest.php
│ │ ├── PsrHandlerTest.php
│ │ ├── PushoverHandlerTest.php
│ │ ├── RedisHandlerTest.php
│ │ ├── RedisPubSubHandlerTest.php
│ │ ├── RollbarHandlerTest.php
│ │ ├── RotatingFileHandlerTest.php
│ │ ├── SamplingHandlerTest.php
│ │ ├── Slack/
│ │ │ └── SlackRecordTest.php
│ │ ├── SlackHandlerTest.php
│ │ ├── SlackWebhookHandlerTest.php
│ │ ├── SocketHandlerTest.php
│ │ ├── StreamHandlerTest.php
│ │ ├── SymfonyMailerHandlerTest.php
│ │ ├── SyslogHandlerTest.php
│ │ ├── SyslogUdpHandlerTest.php
│ │ ├── TelegramBotHandlerTest.php
│ │ ├── TestHandlerTest.php
│ │ ├── UdpSocketTest.php
│ │ ├── WhatFailureGroupHandlerTest.php
│ │ └── ZendMonitorHandlerTest.php
│ ├── LoggerTest.php
│ ├── Processor/
│ │ ├── ClosureContextProcessorTest.php
│ │ ├── GitProcessorTest.php
│ │ ├── HostnameProcessorTest.php
│ │ ├── IntrospectionProcessorTest.php
│ │ ├── LoadAverageProcessorTest.php
│ │ ├── MemoryPeakUsageProcessorTest.php
│ │ ├── MemoryUsageProcessorTest.php
│ │ ├── MercurialProcessorTest.php
│ │ ├── ProcessIdProcessorTest.php
│ │ ├── PsrLogMessageProcessorTest.php
│ │ ├── TagProcessorTest.php
│ │ ├── UidProcessorTest.php
│ │ └── WebProcessorTest.php
│ ├── PsrLogCompatTest.php
│ ├── RegistryTest.php
│ ├── SignalHandlerTest.php
│ └── UtilsTest.php
└── bootstrap.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{yml,yaml}]
indent_size = 2
================================================
FILE: .gitattributes
================================================
/doc export-ignore
/tests export-ignore
/.* export-ignore
/phpstan* export-ignore
/phpunit.xml.dist export-ignore
/_config.yml export-ignore
/UPGRADE.md export-ignore
/.editorconfig export-ignore
/favicon.ico export-ignore
/logo.jpg export-ignore
================================================
FILE: .github/FUNDING.yml
================================================
github: [Seldaek]
tidelift: "packagist/monolog/monolog"
================================================
FILE: .github/ISSUE_TEMPLATE/Bug_Report.md
================================================
---
name: Bug Report
about: Create a bug report
labels: Bug
---
Monolog version 1|2|3?
Write your bug report here.
================================================
FILE: .github/ISSUE_TEMPLATE/Feature.md
================================================
---
name: Feature
about: Suggest a new feature or enhancement
labels: Feature
---
Write your suggestion here.
================================================
FILE: .github/ISSUE_TEMPLATE/Question.md
================================================
---
name: Question
about: Ask a question regarding software usage
labels: Support
---
Monolog version 1|2|3?
Write your question here.
================================================
FILE: .github/SECURITY.md
================================================
# Reporting a vulnerability
If you have found any issues that might have security implications,
please send a report privately to j.boggiano@seld.be
Do not report security reports publicly.
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
================================================
FILE: .github/workflows/continuous-integration.yml
================================================
name: "Continuous Integration"
on:
- push
- pull_request
permissions:
contents: read
env:
COMPOSER_ROOT_VERSION: dev-main
jobs:
tests:
name: "CI (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }} deps)"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
dependencies: [highest]
composer-options: [""]
operating-system:
- "ubuntu-latest"
include:
- php-version: "8.1"
dependencies: lowest
operating-system: ubuntu-latest
- php-version: "8.5"
dependencies: highest
operating-system: ubuntu-latest
composer-options: "--ignore-platform-req=php+"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CouchDB
timeout-minutes: 3
continue-on-error: true
uses: cobot/couchdb-action@eaaa17cf8baf421e7fb07e2d869f5457bb6a4de5 # main
with:
couchdb version: '2.3.1'
- name: Run MongoDB
uses: supercharge/mongodb-github-action@315db7fe45ac2880b7758f1933e6e5d59afd5e94 # 1.12.1
with:
mongodb-version: 5.0
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: Add require for mongodb/mongodb to make tests runnable
run: 'composer require mongodb/mongodb --dev --no-update'
- name: "Change dependencies"
run: |
composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^7
- uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- name: "Run tests"
if: "matrix.php-version >= '8.2'"
run: "composer exec phpunit -- --exclude-group Elasticsearch --exclude-group Elastica"
- name: "Run tests"
if: "matrix.php-version == '8.1'"
run: "composer exec phpunit -- --exclude-group Elasticsearch,Elastica"
tests-es-7:
name: "CI with ES ${{ matrix.es-version }} on PHP ${{ matrix.php-version }}"
needs: "tests"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-latest"
php-version:
- "8.1"
dependencies:
- "highest"
- "lowest"
es-version:
- "7.0.0"
- "7.17.0"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# required for elasticsearch
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Run Elasticsearch
timeout-minutes: 3
uses: elastic/elastic-github-actions/elasticsearch@dc110609b1cb3024477ead739ca23ab547b8b9ff # master
with:
stack-version: "${{ matrix.es-version }}"
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: "Change dependencies"
run: "composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^${{ matrix.es-version }}"
- uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run tests"
run: "composer exec phpunit -- --group Elasticsearch,Elastica"
- name: "Run tests with psr/log 3"
if: "contains(matrix.dependencies, 'highest') && matrix.php-version >= '8.0'"
run: |
composer remove --no-update --dev graylog2/gelf-php ruflin/elastica elasticsearch/elasticsearch rollbar/rollbar
composer require --no-update --no-interaction --dev ruflin/elastica:^7 elasticsearch/elasticsearch:^7
composer require --no-update psr/log:^3
composer update
composer exec phpunit -- --group Elasticsearch,Elastica
tests-es-8:
name: "CI with ES ${{ matrix.es-version }} on PHP ${{ matrix.php-version }}"
needs: "tests"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-latest"
php-version:
- "8.1"
dependencies:
- "highest"
- "lowest"
es-version:
- "8.0.0"
- "8.2.0"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# required for elasticsearch
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Run Elasticsearch
timeout-minutes: 3
uses: elastic/elastic-github-actions/elasticsearch@dc110609b1cb3024477ead739ca23ab547b8b9ff # master
with:
stack-version: "${{ matrix.es-version }}"
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: "Change dependencies"
run: |
composer remove --no-update --dev graylog2/gelf-php ruflin/elastica elasticsearch/elasticsearch rollbar/rollbar
composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^8 ruflin/elastica:^8
- uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run tests"
run: "composer exec phpunit -- --group Elasticsearch,Elastica"
================================================
FILE: .github/workflows/lint.yml
================================================
name: "PHP Lint"
on:
- push
- pull_request
permissions:
contents: read
jobs:
tests:
name: "Lint"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.1"
- "nightly"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "${{ matrix.php-version }}"
coverage: none
- name: "Lint PHP files"
run: |
hasErrors=0
for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
do
{ error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
if [ "$error" != "" ]; then
while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
hasErrors=1
fi
done
if [ $hasErrors -eq 1 ]; then
exit 1
fi
================================================
FILE: .github/workflows/phpstan.yml
================================================
name: "PHPStan"
on:
- push
- pull_request
permissions:
contents: read
env:
COMPOSER_ROOT_VERSION: dev-main
jobs:
tests:
name: "PHPStan"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.1"
- latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
with:
php-version: "${{ matrix.php-version }}"
coverage: none
extensions: mongodb, redis, amqp
- name: Add require for mongodb/mongodb to make tests runnable
run: "composer require ${{ env.COMPOSER_FLAGS }} mongodb/mongodb --dev --no-update"
- uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1
with:
dependency-versions: highest
- name: Run PHPStan
run: composer phpstan
================================================
FILE: .gitignore
================================================
vendor
composer.phar
phpunit.xml
composer.lock
.DS_Store
.php-cs-fixer.cache
.hg
.phpunit.result.cache
.phpunit.cache
================================================
FILE: .php-cs-fixer.php
================================================
<?php
$header = <<<EOF
This file is part of the Monolog package.
(c) Jordi Boggiano <j.boggiano@seld.be>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
$finder = PhpCsFixer\Finder::create()
->files()
->name('*.php')
->exclude('Fixtures')
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;
$config = new PhpCsFixer\Config();
return $config->setRules(array(
'@PSR2' => true,
// some rules disabled as long as 1.x branch is maintained
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => null,
],
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
'cast_spaces' => ['space' => 'single'],
'header_comment' => ['header' => $header],
'include' => true,
'class_attributes_separation' => array('elements' => array('method' => 'one', 'trait_import' => 'none')),
'native_function_invocation' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
//'phpdoc_scalar' => true,
'phpdoc_trim' => true,
//'phpdoc_types' => true,
'psr_autoloading' => ['dir' => 'src'],
'declare_strict_types' => true,
'single_blank_line_before_namespace' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
))
->setUsingCache(true)
->setRiskyAllowed(true)
->setFinder($finder)
;
================================================
FILE: CHANGELOG.md
================================================
### 3.10.0 (2026-01-02)
* Added automatic directory cleanup in RotatingFileHandler (#2000)
* Added timezone-aware file rotation to RotatingFileHandler (#1982)
* Added support for mongodb/mongodb 2.0+ (#1998)
* Added NoDiscard attribute to TestHandler methods to ensure the result is used (#2013)
* Fixed JsonFormatter crashing if __toString throws while normalizing data (#1968)
* Fixed PHP 8.5 deprecation warnings (#1997, #2009)
* Fixed DeduplicatingHandler collecting duplicate logs if the file cannot be locked (2e97231)
* Fixed GelfMessageFormatter to use integers instead of bool for gelf 1.1 support (#1973)
* Fixed empty stack traces being output anyway (#1979)
* Fixed StreamHandler not reopening the file if the inode changed (#1963)
* Fixed TelegramBotHandler sending empty messages (#1992)
* Fixed file paths in stack traces containing backslashes on windows, always using / now to unify logs (#1980)
* Fixed RotatingFileHandler unlink errors not being suppressed correctly (#1999)
### 3.9.0 (2025-03-24)
* BC Warning: Fixed SendGridHandler to use the V3 API as V2 is now shut down, but this requires a new API key (#1952)
* Deprecated Monolog\Test\TestCase in favor of Monolog\Test\MonologTestCase (#1953)
* Added extension point for NativeMailerHandler::mail (#1948)
* Added setHandler method to BufferHandler to modify the nested handler at runtime (#1946)
* Fixed date format in ElasticsearchFormatter to use +00:00 vs +0000 tz identifiers (#1942)
* Fixed GelfMessageFormatter handling numeric context/extra keys (#1932)
### 3.8.1 (2024-12-05)
* Deprecated Monolog\DateTimeImmutable in favor of Monolog\JsonSerializableDateTimeImmutable (#1928)
* Fixed gelf keys not being valid when context/extra data keys have spaces in them (#1927)
* Fixed empty lines appearing in the stack traces when a custom formatter returned null (#1925)
### 3.8.0 (2024-11-12)
* Added `$fileOpenMode` param to `StreamHandler` to define a custom fopen mode to open the log file (#1913)
* Fixed PHP 8.4 deprecation notices (#1903)
* Added ability to extend/override `IntrospectionProcessor` (#1899)
* Added `$timeout` param to `ProcessHandler` to configure the stream_select() timeout to avoid blocking too long (default is 1.0 sec) (#1916)
* Fixed JsonFormatter batch handling to normalize records individually to make sure they look the same as if they were handled one by one (#1906)
* Fixed `StreamHandler` handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882)
* Fixed `StreamHandler` error handler causing issues if a stream handler triggers an error (#1866)
* Fixed `StreamHandler::reset` not closing the stream, so that it would fail to write in some cases with long running processes (#1862)
* Fixed `RotatingFileHandler` issue where rotation does not happen in some long running processes (#1905)
* Fixed `JsonFormatter` handling of incomplete classes (#1834)
* Fixed `RotatingFileHandler` bug where rotation could sometimes not happen correctly (#1905)
### 3.7.0 (2024-06-28)
* Added `NormalizerFormatter->setBasePath(...)` (and `JsonFormatter` by extension) that allows removing the project's path from the stack trace output (47e301d3e)
* Fixed JsonFormatter handling of incomplete classes (#1834)
* Fixed private error handlers causing problems with custom StreamHandler implementations (#1866)
### 3.6.0 (2024-04-12)
* Added `LineFormatter->setBasePath(...)` that allows removing the project's path from the stack trace output (#1873)
* Added `$includeExtra` option in `PsrHandler` to also use extra data to replace placeholder values in the message (#1852)
* Added ability to customize what is a duplicated message by extending the `DeduplicationHandler` (#1879)
* Added handling for using `GelfMessageFormatter` together with the `AmqpHandler` (#1869)
* Added ability to extend `GoogleCloudLoggingFormatter` (#1859)
* Fixed `__toString` failures in context data crashing the normalization process (#1868)
* Fixed PHP 8.4 deprecation warnings (#1874)
### 3.5.0 (2023-10-27)
* Added ability to indent stack traces in LineFormatter via e.g. `indentStacktraces(' ')` (#1835)
* Added ability to configure a max level name length in LineFormatter via e.g. `setMaxLevelNameLength(3)` (#1850)
* Added support for indexed arrays (i.e. `[]` and not `{}` arrays once json serialized) containing inline linebreaks in LineFormatter (#1818)
* Added `WithMonologChannel` attribute for integrators to use to configure autowiring (#1847)
* Fixed log record `extra` data leaking between handlers that have handler-specific processors set (#1819)
* Fixed LogglyHandler issue with record level filtering (#1841)
* Fixed display_errors parsing in ErrorHandler which did not support string values (#1804)
* Fixed bug where the previous error handler would not be restored in some cases where StreamHandler fails (#1815)
* Fixed normalization error when normalizing incomplete classes (#1833)
### 3.4.0 (2023-06-21)
* Added `LoadAverageProcessor` to track one of the 1, 5 or 15min load averages (#1803)
* Added support for priority to the `AsMonologProcessor` attribute (#1797)
* Added `TelegramBotHandler` `topic`/`message_thread_id` support (#1802)
* Fixed `FingersCrossedHandler` passthruLevel checking (#1801)
* Fixed support of yearly and monthly rotation log file to rotate only once a month/year (#1805)
* Fixed `TestHandler` method docs (#1794)
* Fixed handling of falsey `display_errors` string values (#1804)
### 3.3.1 (2023-02-06)
* Fixed Logger not being serializable anymore (#1792)
### 3.3.0 (2023-02-06)
* Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748)
* Added `ClosureContextProcessor` to allow delaying the creation of context data by setting a Closure in context which is called when the log record is used (#1745)
* Added an ElasticsearchHandler option to set the `op_type` to `create` instead of the default `index` (#1766)
* Added support for enum context values in PsrLogMessageProcessor (#1773)
* Added graylog2/gelf-php 2.x support (#1747)
* Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739)
* Fixed GitProcessor not filtering correctly based on Level (#1749)
* Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791)
* Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758)
* Fixed infinite loop detection within Fibers (#1753)
* Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781)
### 3.2.0 (2022-07-24)
* Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734)
* Marked `Logger` `@final` as it should not be extended, prefer composition or talk to us if you are missing something
* Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723)
* Added `SyslogFormatter` to output syslog-like files which can be consumed by tools like [lnav](https://lnav.org/) (#1689)
* Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733)
* Added `GoogleCloudLoggingFormatter` (#1719)
* Added support for Predis 2.x (#1732)
* Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724)
* Fixed serialization/unserialization of handlers to make sure private properties are included (#1727)
* Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720)
* Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726)
* Fixed PHP 8.2 deprecation warnings (#1722)
* Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678)
### 3.1.0 (2022-06-09)
* Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682)
* Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681)
* Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670)
* Fixed interop issue by removing the need for a return type in ProcessorInterface (#1680)
* Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)
* Fixed RotatingFileHandler issue when the date format contained slashes (#1671)
### 3.0.0 (2022-05-10)
Changes from RC1
- The `Monolog\LevelName` enum does not exist anymore, use `Monolog\Level->getName()` instead.
### 3.0.0-RC1 (2022-05-08)
This is mostly a cleanup release offering stronger type guarantees for integrators with the
array->object/enum changes, but there is no big new feature for end users.
See [UPGRADE notes](UPGRADE.md#300) for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces.
Noteworthy BC Breaks:
- The minimum supported PHP version is now `8.1.0`.
- Log records have been converted from an array to a [`Monolog\LogRecord` object](src/Monolog/LogRecord.php)
with public (and mostly readonly) properties. e.g. instead of doing
`$record['context']` use `$record->context`.
In formatters or handlers if you rather need an array to work with you can use `$record->toArray()`
to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases
in the `level` and `level_name` keys to be more backwards compatible and use simpler data types.
- `FormatterInterface`, `HandlerInterface`, `ProcessorInterface`, etc. changed to contain `LogRecord $record`
instead of `array $record` parameter types. If you want to support multiple Monolog versions this should
be possible by type-hinting nothing, or `array|LogRecord` if you support PHP 8.0+. You can then code
against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC.
The interfaces do not require a `LogRecord` return type even where it would be applicable, but if you only
support Monolog 3 in integration code I would recommend you use `LogRecord` return types wherever fitting
to ensure forward compatibility as it may be added in Monolog 4.
- Log levels are now enums [`Monolog\Level`](src/Monolog/Level.php) and [`Monolog\LevelName`](src/Monolog/LevelName.php)
- Removed deprecated SwiftMailerHandler, migrate to SymfonyMailerHandler instead.
- `ResettableInterface::reset()` now requires a void return type.
- All properties have had types added, which may require you to do so as well if you extended
a Monolog class and declared the same property.
New deprecations:
- `Logger::DEBUG`, `Logger::ERROR`, etc. are now deprecated in favor of the `Monolog\Level` enum.
e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case
to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer
value equal to what `Logger::WARNING` was giving you.
- `Logger::getLevelName()` is now deprecated.
### 2.10.0 (2024-11-12)
* Added `$fileOpenMode` to `StreamHandler` to define a custom fopen mode to open the log file (#1913)
* Fixed `StreamHandler` handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882)
* Fixed `StreamHandler` error handler causing issues if a stream handler triggers an error (#1866)
* Fixed `JsonFormatter` handling of incomplete classes (#1834)
* Fixed `RotatingFileHandler` bug where rotation could sometimes not happen correctly (#1905)
### 2.9.3 (2024-04-12)
* Fixed PHP 8.4 deprecation warnings (#1874)
### 2.9.2 (2023-10-27)
* Fixed display_errors parsing in ErrorHandler which did not support string values (#1804)
* Fixed bug where the previous error handler would not be restored in some cases where StreamHandler fails (#1815)
* Fixed normalization error when normalizing incomplete classes (#1833)
### 2.9.1 (2023-02-06)
* Fixed Logger not being serializable anymore (#1792)
### 2.9.0 (2023-02-05)
* Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748)
* Added support for enum context values in PsrLogMessageProcessor (#1773)
* Added graylog2/gelf-php 2.x support (#1747)
* Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739)
* Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791)
* Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758)
* Fixed infinite loop detection within Fibers (#1753)
* Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781)
### 2.8.0 (2022-07-24)
* Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734)
* Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723)
* Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733)
* Added `GoogleCloudLoggingFormatter` (#1719)
* Added support for Predis 2.x (#1732)
* Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724)
* Fixed serialization/unserialization of handlers to make sure private properties are included (#1727)
* Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720)
* Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726)
* Fixed PHP 8.2 deprecation warnings (#1722)
* Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678)
### 2.7.0 (2022-06-09)
* Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682)
* Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681)
* Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670)
* Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)
* Fixed RotatingFileHandler issue when the date format contained slashes (#1671)
### 2.6.0 (2022-05-10)
* Deprecated `SwiftMailerHandler`, use `SymfonyMailerHandler` instead
* Added `SymfonyMailerHandler` (#1663)
* Added ElasticSearch 8.x support to the ElasticsearchHandler (#1662)
* Added a way to filter/modify stack traces in LineFormatter (#1665)
* Fixed UdpSocket not being able to reopen/reconnect after close()
* Fixed infinite loops if a Handler is triggering logging while handling log records
### 2.5.0 (2022-04-08)
* Added `callType` to IntrospectionProcessor (#1612)
* Fixed AsMonologProcessor syntax to be compatible with PHP 7.2 (#1651)
### 2.4.0 (2022-03-14)
* Added [`Monolog\LogRecord`](src/Monolog/LogRecord.php) interface that can be used to type-hint records like `array|\Monolog\LogRecord $record` to be forward compatible with the upcoming Monolog 3 changes
* Added `includeStacktraces` constructor params to LineFormatter & JsonFormatter (#1603)
* Added `persistent`, `timeout`, `writingTimeout`, `connectionTimeout`, `chunkSize` constructor params to SocketHandler and derivatives (#1600)
* Added `AsMonologProcessor` PHP attribute which can help autowiring / autoconfiguration of processors if frameworks / integrations decide to make use of it. This is useless when used purely with Monolog (#1637)
* Added support for keeping native BSON types as is in MongoDBFormatter (#1620)
* Added support for a `user_agent` key in WebProcessor, disabled by default but you can use it by configuring the $extraFields you want (#1613)
* Added support for username/userIcon in SlackWebhookHandler (#1617)
* Added extension points to BrowserConsoleHandler (#1593)
* Added record message/context/extra info to exceptions thrown when a StreamHandler cannot open its stream to avoid completely losing the data logged (#1630)
* Fixed error handler signature to accept a null $context which happens with internal PHP errors (#1614)
* Fixed a few setter methods not returning `self` (#1609)
* Fixed handling of records going over the max Telegram message length (#1616)
### 2.3.5 (2021-10-01)
* Fixed regression in StreamHandler since 2.3.3 on systems with the memory_limit set to >=20GB (#1592)
### 2.3.4 (2021-09-15)
* Fixed support for psr/log 3.x (#1589)
### 2.3.3 (2021-09-14)
* Fixed memory usage when using StreamHandler and calling stream_get_contents on the resource you passed to it (#1578, #1577)
* Fixed support for psr/log 2.x (#1587)
* Fixed some type annotations
### 2.3.2 (2021-07-23)
* Fixed compatibility with PHP 7.2 - 7.4 when experiencing PCRE errors (#1568)
### 2.3.1 (2021-07-14)
* Fixed Utils::getClass handling of anonymous classes not being fully compatible with PHP 8 (#1563)
* Fixed some `@inheritDoc` annotations having the wrong case
### 2.3.0 (2021-07-05)
* Added a ton of PHPStan type annotations as well as type aliases on Monolog\Logger for Record, Level and LevelName that you can import (#1557)
* Added ability to customize date format when using JsonFormatter (#1561)
* Fixed FilterHandler not calling reset on its internal handler when reset() is called on it (#1531)
* Fixed SyslogUdpHandler not setting the timezone correctly on DateTimeImmutable instances (#1540)
* Fixed StreamHandler thread safety - chunk size set to 2GB now to avoid interlacing when doing concurrent writes (#1553)
### 2.2.0 (2020-12-14)
* Added JSON_PARTIAL_OUTPUT_ON_ERROR to default json encoding flags, to avoid dropping entire context data or even records due to an invalid subset of it somewhere
* Added setDateFormat to NormalizerFormatter (and Line/Json formatters by extension) to allow changing this after object creation
* Added RedisPubSubHandler to log records to a Redis channel using PUBLISH
* Added support for Elastica 7, and deprecated the $type argument of ElasticaFormatter which is not in use anymore as of Elastica 7
* Added support for millisecond write timeouts in SocketHandler, you can now pass floats to setWritingTimeout, e.g. 0.2 is 200ms
* Added support for unix sockets in SyslogUdpHandler (set $port to 0 to make the $host a unix socket)
* Added handleBatch support for TelegramBotHandler
* Added RFC5424e extended date format including milliseconds to SyslogUdpHandler
* Added support for configuring handlers with numeric level values in strings (coming from e.g. env vars)
* Fixed Wildfire/FirePHP/ChromePHP handling of unicode characters
* Fixed PHP 8 issues in SyslogUdpHandler
* Fixed internal type error when mbstring is missing
### 2.1.1 (2020-07-23)
* Fixed removing of json encoding options
* Fixed type hint of $level not accepting strings in SendGridHandler and OverflowHandler
* Fixed SwiftMailerHandler not accepting email templates with an empty subject
* Fixed array access on null in RavenHandler
* Fixed unique_id in WebProcessor not being disableable
### 2.1.0 (2020-05-22)
* Added `JSON_INVALID_UTF8_SUBSTITUTE` to default json flags, so that invalid UTF8 characters now get converted to [�](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) instead of being converted from ISO-8859-15 to UTF8 as it was before, which was hardly a comprehensive solution
* Added `$ignoreEmptyContextAndExtra` option to JsonFormatter to skip empty context/extra entirely from the output
* Added `$parseMode`, `$disableWebPagePreview` and `$disableNotification` options to TelegramBotHandler
* Added tentative support for PHP 8
* NormalizerFormatter::addJsonEncodeOption and removeJsonEncodeOption are now public to allow modifying default json flags
* Fixed GitProcessor type error when there is no git repo present
* Fixed normalization of SoapFault objects containing deeply nested objects as "detail"
* Fixed support for relative paths in RotatingFileHandler
### 2.0.2 (2019-12-20)
* Fixed ElasticsearchHandler swallowing exceptions details when failing to index log records
* Fixed normalization of SoapFault objects containing non-strings as "detail" in LineFormatter
* Fixed formatting of resources in JsonFormatter
* Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services)
* Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it
* Fixed Turkish locale messing up the conversion of level names to their constant values
### 2.0.1 (2019-11-13)
* Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
* Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler, OverflowHandler and SamplingHandler
* Fixed BrowserConsoleHandler formatting when using multiple styles
* Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings
* Fixed normalization of SoapFault objects containing non-strings as "detail"
* Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding
* Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB).
* Fixed type error in BrowserConsoleHandler when the context array of log records was not associative.
### 2.0.0 (2019-08-30)
* BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release
* BC Break: Logger methods log/debug/info/notice/warning/error/critical/alert/emergency now have explicit void return types
* Added FallbackGroupHandler which works like the WhatFailureGroupHandler but stops dispatching log records as soon as one handler accepted it
* Fixed support for UTF-8 when cutting strings to avoid cutting a multibyte-character in half
* Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases
* Fixed date timezone handling in SyslogUdpHandler
### 2.0.0-beta2 (2019-07-06)
* BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release
* BC Break: PHP 7.2 is now the minimum required PHP version.
* BC Break: Removed SlackbotHandler, RavenHandler and HipChatHandler, see [UPGRADE.md](UPGRADE.md) for details
* Added OverflowHandler which will only flush log records to its nested handler when reaching a certain amount of logs (i.e. only pass through when things go really bad)
* Added TelegramBotHandler to log records to a [Telegram](https://core.telegram.org/bots/api) bot account
* Added support for JsonSerializable when normalizing exceptions
* Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler
* Added SoapFault details to formatted exceptions
* Fixed DeduplicationHandler silently failing to start when file could not be opened
* Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records
* Fixed GelfFormatter losing some data when one attachment was too long
* Fixed issue in SignalHandler restarting syscalls functionality
* Improved performance of LogglyHandler when sending multiple logs in a single request
### 2.0.0-beta1 (2018-12-08)
* BC Break: This is a major release, see [UPGRADE.md](UPGRADE.md) for details if you are coming from a 1.x release
* BC Break: PHP 7.1 is now the minimum required PHP version.
* BC Break: Quite a few interface changes, only relevant if you implemented your own handlers/processors/formatters
* BC Break: Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`) methods as well as `emerg`, `crit`, `err` and `warn`
* BC Break: The record timezone is now set per Logger instance and not statically anymore
* BC Break: There is no more default handler configured on empty Logger instances
* BC Break: ElasticSearchHandler renamed to ElasticaHandler
* BC Break: Various handler-specific breaks, see [UPGRADE.md](UPGRADE.md) for details
* Added scalar type hints and return hints in all the places it was possible. Switched strict_types on for more reliability.
* Added DateTimeImmutable support, all record datetime are now immutable, and will toString/json serialize with the correct date format, including microseconds (unless disabled)
* Added timezone and microseconds to the default date format
* Added SendGridHandler to use the SendGrid API to send emails
* Added LogmaticHandler to use the Logmatic.io API to store log records
* Added SqsHandler to send log records to an AWS SQS queue
* Added ElasticsearchHandler to send records via the official ES library. Elastica users should now use ElasticaHandler instead of ElasticSearchHandler
* Added NoopHandler which is similar to the NullHandle but does not prevent the bubbling of log records to handlers further down the configuration, useful for temporarily disabling a handler in configuration files
* Added ProcessHandler to write log output to the STDIN of a given process
* Added HostnameProcessor that adds the machine's hostname to log records
* Added a `$dateFormat` option to the PsrLogMessageProcessor which lets you format DateTime instances nicely
* Added support for the PHP 7.x `mongodb` extension in the MongoDBHandler
* Fixed many minor issues in various handlers, and probably added a few regressions too
### 1.26.1 (2021-05-28)
* Fixed PHP 8.1 deprecation warning
### 1.26.0 (2020-12-14)
* Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x)
### 1.25.5 (2020-07-23)
* Fixed array access on null in RavenHandler
* Fixed unique_id in WebProcessor not being disableable
### 1.25.4 (2020-05-22)
* Fixed GitProcessor type error when there is no git repo present
* Fixed normalization of SoapFault objects containing deeply nested objects as "detail"
* Fixed support for relative paths in RotatingFileHandler
### 1.25.3 (2019-12-20)
* Fixed formatting of resources in JsonFormatter
* Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services)
* Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it
* Fixed Turkish locale messing up the conversion of level names to their constant values
### 1.25.2 (2019-11-13)
* Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
* Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler
* Fixed BrowserConsoleHandler formatting when using multiple styles
* Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings
* Fixed normalization of SoapFault objects containing non-strings as "detail"
* Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding
### 1.25.1 (2019-09-06)
* Fixed forward-compatible interfaces to be compatible with Monolog 1.x too.
### 1.25.0 (2019-09-06)
* Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead
* Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead
* Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead
* Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though.
* Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler
* Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records
* Fixed issue in SignalHandler restarting syscalls functionality
* Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases
* Fixed ZendMonitorHandler to work with the latest Zend Server versions
* Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB).
### 1.24.0 (2018-11-05)
* BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings.
* Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
* Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
* Added a way to log signals being received using Monolog\SignalHandler
* Added ability to customize error handling at the Logger level using Logger::setExceptionHandler
* Added InsightOpsHandler to migrate users of the LogEntriesHandler
* Added protection to NormalizerFormatter against circular and very deep structures, it now stops normalizing at a depth of 9
* Added capture of stack traces to ErrorHandler when logging PHP errors
* Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts
* Added forwarding of context info to FluentdFormatter
* Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example
* Added ability to extend/override BrowserConsoleHandler
* Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility
* Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility
* Dropped official support for HHVM in test builds
* Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain
* Fixed naming of fields in Slack handler, all field names are now capitalized in all cases
* Fixed HipChatHandler bug where slack dropped messages randomly
* Fixed normalization of objects in Slack handlers
* Fixed support for PHP7's Throwable in NewRelicHandler
* Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory
* Fixed table row styling issues in HtmlFormatter
* Fixed RavenHandler dropping the message when logging exception
* Fixed WhatFailureGroupHandler skipping processors when using handleBatch
and implement it where possible
* Fixed display of anonymous class names
### 1.23.0 (2017-06-19)
* Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument
* Fixed GelfHandler truncation to be per field and not per message
* Fixed compatibility issue with PHP <5.3.6
* Fixed support for headless Chrome in ChromePHPHandler
* Fixed support for latest Aws SDK in DynamoDbHandler
* Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler
### 1.22.1 (2017-03-13)
* Fixed lots of minor issues in the new Slack integrations
* Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces
### 1.22.0 (2016-11-26)
* Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily
* Added MercurialProcessor to add mercurial revision and branch names to log records
* Added support for AWS SDK v3 in DynamoDbHandler
* Fixed fatal errors occurring when normalizing generators that have been fully consumed
* Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix)
* Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore
* Fixed SyslogUdpHandler to avoid sending empty frames
* Fixed a few PHP 7.0 and 7.1 compatibility issues
### 1.21.0 (2016-07-29)
* Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues
* Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order
* Added ability to format the main line of text the SlackHandler sends by explicitly setting a formatter on the handler
* Added information about SoapFault instances in NormalizerFormatter
* Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level
### 1.20.0 (2016-07-02)
* Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy
* Added StreamHandler::getUrl to retrieve the stream's URL
* Added ability to override addRow/addTitle in HtmlFormatter
* Added the $context to context information when the ErrorHandler handles a regular php error
* Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d
* Fixed WhatFailureGroupHandler to work with PHP7 throwables
* Fixed a few minor bugs
### 1.19.0 (2016-04-12)
* Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed
* Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors
* Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler
* Fixed HipChatHandler handling of long messages
### 1.18.2 (2016-04-02)
* Fixed ElasticaFormatter to use more precise dates
* Fixed GelfMessageFormatter sending too long messages
### 1.18.1 (2016-03-13)
* Fixed SlackHandler bug where slack dropped messages randomly
* Fixed RedisHandler issue when using with the PHPRedis extension
* Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension
* Fixed BrowserConsoleHandler regression
### 1.18.0 (2016-03-01)
* Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond
* Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames
* Added `Logger->withName` to clone a logger (keeping all handlers) with a new name
* Added FluentdFormatter for the Fluentd unix socket protocol
* Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed
* Added support for replacing context sub-keys using `%context.*%` in LineFormatter
* Added support for `payload` context value in RollbarHandler
* Added setRelease to RavenHandler to describe the application version, sent with every log
* Added support for `fingerprint` context value in RavenHandler
* Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed
* Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()`
* Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places
### 1.17.2 (2015-10-14)
* Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers
* Fixed SlackHandler handling to use slack functionalities better
* Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id
* Fixed 5.3 compatibility regression
### 1.17.1 (2015-08-31)
* Fixed RollbarHandler triggering PHP notices
### 1.17.0 (2015-08-30)
* Added support for `checksum` and `release` context/extra values in RavenHandler
* Added better support for exceptions in RollbarHandler
* Added UidProcessor::getUid
* Added support for showing the resource type in NormalizedFormatter
* Fixed IntrospectionProcessor triggering PHP notices
### 1.16.0 (2015-08-09)
* Added IFTTTHandler to notify ifttt.com triggers
* Added Logger::setHandlers() to allow setting/replacing all handlers
* Added $capSize in RedisHandler to cap the log size
* Fixed StreamHandler creation of directory to only trigger when the first log write happens
* Fixed bug in the handling of curl failures
* Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler
* Fixed missing fatal errors records with handlers that need to be closed to flush log records
* Fixed TagProcessor::addTags support for associative arrays
### 1.15.0 (2015-07-12)
* Added addTags and setTags methods to change a TagProcessor
* Added automatic creation of directories if they are missing for a StreamHandler to open a log file
* Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure
* Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used
* Fixed HTML/JS escaping in BrowserConsoleHandler
* Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only)
### 1.14.0 (2015-06-19)
* Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library
* Added support for objects implementing __toString in the NormalizerFormatter
* Added support for HipChat's v2 API in HipChatHandler
* Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app
* Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true)
* Fixed curl errors being silently suppressed
### 1.13.1 (2015-03-09)
* Fixed regression in HipChat requiring a new token to be created
### 1.13.0 (2015-03-05)
* Added Registry::hasLogger to check for the presence of a logger instance
* Added context.user support to RavenHandler
* Added HipChat API v2 support in the HipChatHandler
* Added NativeMailerHandler::addParameter to pass params to the mail() process
* Added context data to SlackHandler when $includeContextAndExtra is true
* Added ability to customize the Swift_Message per-email in SwiftMailerHandler
* Fixed SwiftMailerHandler to lazily create message instances if a callback is provided
* Fixed serialization of INF and NaN values in Normalizer and LineFormatter
### 1.12.0 (2014-12-29)
* Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers.
* Added PsrHandler to forward records to another PSR-3 logger
* Added SamplingHandler to wrap around a handler and include only every Nth record
* Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now)
* Added exception codes in the output of most formatters
* Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line)
* Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data
* Added $host to HipChatHandler for users of private instances
* Added $transactionName to NewRelicHandler and support for a transaction_name context value
* Fixed MandrillHandler to avoid outputting API call responses
* Fixed some non-standard behaviors in SyslogUdpHandler
### 1.11.0 (2014-09-30)
* Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names
* Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails
* Added MandrillHandler to send emails via the Mandrillapp.com API
* Added SlackHandler to log records to a Slack.com account
* Added FleepHookHandler to log records to a Fleep.io account
* Added LogglyHandler::addTag to allow adding tags to an existing handler
* Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end
* Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing
* Added support for PhpAmqpLib in the AmqpHandler
* Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs
* Added support for adding extra fields from $_SERVER in the WebProcessor
* Fixed support for non-string values in PrsLogMessageProcessor
* Fixed SwiftMailer messages being sent with the wrong date in long running scripts
* Fixed minor PHP 5.6 compatibility issues
* Fixed BufferHandler::close being called twice
### 1.10.0 (2014-06-04)
* Added Logger::getHandlers() and Logger::getProcessors() methods
* Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached
* Added support for extra data in NewRelicHandler
* Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines
### 1.9.1 (2014-04-24)
* Fixed regression in RotatingFileHandler file permissions
* Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records
* Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative
### 1.9.0 (2014-04-20)
* Added LogEntriesHandler to send logs to a LogEntries account
* Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler
* Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes
* Added support for table formatting in FirePHPHandler via the table context key
* Added a TagProcessor to add tags to records, and support for tags in RavenHandler
* Added $appendNewline flag to the JsonFormatter to enable using it when logging to files
* Added sound support to the PushoverHandler
* Fixed multi-threading support in StreamHandler
* Fixed empty headers issue when ChromePHPHandler received no records
* Fixed default format of the ErrorLogHandler
### 1.8.0 (2014-03-23)
* Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them
* Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output
* Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler
* Added FlowdockHandler to send logs to a Flowdock account
* Added RollbarHandler to send logs to a Rollbar account
* Added HtmlFormatter to send prettier log emails with colors for each log level
* Added GitProcessor to add the current branch/commit to extra record data
* Added a Monolog\Registry class to allow easier global access to pre-configured loggers
* Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement
* Added support for HHVM
* Added support for Loggly batch uploads
* Added support for tweaking the content type and encoding in NativeMailerHandler
* Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor
* Fixed batch request support in GelfHandler
### 1.7.0 (2013-11-14)
* Added ElasticSearchHandler to send logs to an Elastic Search server
* Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB
* Added SyslogUdpHandler to send logs to a remote syslogd server
* Added LogglyHandler to send logs to a Loggly account
* Added $level to IntrospectionProcessor so it only adds backtraces when needed
* Added $version to LogstashFormatter to allow using the new v1 Logstash format
* Added $appName to NewRelicHandler
* Added configuration of Pushover notification retries/expiry
* Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default
* Added chainability to most setters for all handlers
* Fixed RavenHandler batch processing so it takes the message from the record with highest priority
* Fixed HipChatHandler batch processing so it sends all messages at once
* Fixed issues with eAccelerator
* Fixed and improved many small things
### 1.6.0 (2013-07-29)
* Added HipChatHandler to send logs to a HipChat chat room
* Added ErrorLogHandler to send logs to PHP's error_log function
* Added NewRelicHandler to send logs to NewRelic's service
* Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler
* Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel
* Added stack traces output when normalizing exceptions (json output & co)
* Added Monolog\Logger::API constant (currently 1)
* Added support for ChromePHP's v4.0 extension
* Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel
* Added support for sending messages to multiple users at once with the PushoverHandler
* Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler)
* Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now
* Fixed issue in RotatingFileHandler when an open_basedir restriction is active
* Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0
* Fixed SyslogHandler issue when many were used concurrently with different facilities
### 1.5.0 (2013-04-23)
* Added ProcessIdProcessor to inject the PID in log records
* Added UidProcessor to inject a unique identifier to all log records of one request/run
* Added support for previous exceptions in the LineFormatter exception serialization
* Added Monolog\Logger::getLevels() to get all available levels
* Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle
### 1.4.1 (2013-04-01)
* Fixed exception formatting in the LineFormatter to be more minimalistic
* Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0
* Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days
* Fixed WebProcessor array access so it checks for data presence
* Fixed Buffer, Group and FingersCrossed handlers to make use of their processors
### 1.4.0 (2013-02-13)
* Added RedisHandler to log to Redis via the Predis library or the phpredis extension
* Added ZendMonitorHandler to log to the Zend Server monitor
* Added the possibility to pass arrays of handlers and processors directly in the Logger constructor
* Added `$useSSL` option to the PushoverHandler which is enabled by default
* Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously
* Fixed header injection capability in the NativeMailHandler
### 1.3.1 (2013-01-11)
* Fixed LogstashFormatter to be usable with stream handlers
* Fixed GelfMessageFormatter levels on Windows
### 1.3.0 (2013-01-08)
* Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface`
* Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance
* Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash)
* Added PushoverHandler to send mobile notifications
* Added CouchDBHandler and DoctrineCouchDBHandler
* Added RavenHandler to send data to Sentry servers
* Added support for the new MongoClient class in MongoDBHandler
* Added microsecond precision to log records' timestamps
* Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing
the oldest entries
* Fixed normalization of objects with cyclic references
### 1.2.1 (2012-08-29)
* Added new $logopts arg to SyslogHandler to provide custom openlog options
* Fixed fatal error in SyslogHandler
### 1.2.0 (2012-08-18)
* Added AmqpHandler (for use with AMQP servers)
* Added CubeHandler
* Added NativeMailerHandler::addHeader() to send custom headers in mails
* Added the possibility to specify more than one recipient in NativeMailerHandler
* Added the possibility to specify float timeouts in SocketHandler
* Added NOTICE and EMERGENCY levels to conform with RFC 5424
* Fixed the log records to use the php default timezone instead of UTC
* Fixed BufferHandler not being flushed properly on PHP fatal errors
* Fixed normalization of exotic resource types
* Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog
### 1.1.0 (2012-04-23)
* Added Monolog\Logger::isHandling() to check if a handler will
handle the given log level
* Added ChromePHPHandler
* Added MongoDBHandler
* Added GelfHandler (for use with Graylog2 servers)
* Added SocketHandler (for use with syslog-ng for example)
* Added NormalizerFormatter
* Added the possibility to change the activation strategy of the FingersCrossedHandler
* Added possibility to show microseconds in logs
* Added `server` and `referer` to WebProcessor output
### 1.0.2 (2011-10-24)
* Fixed bug in IE with large response headers and FirePHPHandler
### 1.0.1 (2011-08-25)
* Added MemoryPeakUsageProcessor and MemoryUsageProcessor
* Added Monolog\Logger::getName() to get a logger's channel name
### 1.0.0 (2011-07-06)
* Added IntrospectionProcessor to get info from where the logger was called
* Fixed WebProcessor in CLI
### 1.0.0-RC1 (2011-07-01)
* Initial release
================================================
FILE: LICENSE
================================================
Copyright (c) 2011-2020 Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: README.md
================================================
<p align="center"><img src="logo.jpg" alt="Monolog" width="400"></p>
# Monolog - Logging for PHP [](https://github.com/Seldaek/monolog/actions)
[](https://packagist.org/packages/monolog/monolog)
[](https://packagist.org/packages/monolog/monolog)
>**Note** This is the **documentation for Monolog 3.x**, if you are using older releases
>see the documentation for [Monolog 2.x](https://github.com/Seldaek/monolog/blob/2.x/README.md) or [Monolog 1.x](https://github.com/Seldaek/monolog/blob/1.x/README.md)
Monolog sends your logs to files, sockets, inboxes, databases and various
web services. See the complete list of handlers below. Special handlers
allow you to build advanced logging strategies.
This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
interface that you can type-hint against in your own libraries to keep
a maximum of interoperability. You can also use it in your applications to
make sure you can always use another compatible logger at a later time.
As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
Internally Monolog still uses its own level scheme since it predates PSR-3.
<div align="center">
<hr>
<sup><b>Sponsored by:</b></sup>
<br>
<a href="https://betterstack.com">
<div>
<img src="https://github.com/Seldaek/monolog/assets/183678/7de58ce0-2fa2-45c0-b3e8-e60cebb3c4cf" width="200" alt="Better Stack">
</div>
<div>
Better Stack lets you centralize, search, and visualize your logs.
</div>
</a>
<br>
<hr>
</div>
## Installation
Install the latest version with
```bash
composer require monolog/monolog
```
## Basic Usage
```php
<?php
use Monolog\Level;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('path/to/your.log', Level::Warning));
// add records to the log
$log->warning('Foo');
$log->error('Bar');
```
## Documentation
- [Usage Instructions](doc/01-usage.md)
- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md)
- [Utility Classes](doc/03-utilities.md)
- [Extending Monolog](doc/04-extending.md)
- [Log Record Structure](doc/message-structure.md)
## Support Monolog Financially
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
## Third Party Packages
Third party handlers, formatters and processors are
[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
can also add your own there if you publish one.
## About
### Requirements
- Monolog `^3.0` works with PHP 8.1 or above.
- Monolog `^2.5` works with PHP 7.2 or above.
- Monolog `^1.25` works with PHP 5.3 up to 8.1, but is not very maintained anymore and will not receive PHP support fixes anymore.
### Support
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 or 3 where possible to benefit from all the latest features and fixes.
### Submitting bugs and feature requests
Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
### Framework Integrations
- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
can be used very easily with Monolog since it implements the interface.
- [Symfony](http://symfony.com) comes out of the box with Monolog.
- [Laravel](http://laravel.com/) comes out of the box with Monolog.
- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
- [PPI](https://github.com/ppi/framework) comes out of the box with Monolog.
- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
- [Nette Framework](http://nette.org/en/) is usable with Monolog via the [contributte/monolog](https://github.com/contributte/monolog) or [orisai/nette-monolog](https://github.com/orisai/nette-monolog) extensions.
- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
- [FuelPHP](http://fuelphp.com/) comes out of the box with Monolog.
- [Equip Framework](https://github.com/equip/framework) comes out of the box with Monolog.
- [Yii 2](http://www.yiiframework.com/) is usable with Monolog via the [yii2-monolog](https://github.com/merorafael/yii2-monolog) or [yii2-psr-log-target](https://github.com/samdark/yii2-psr-log-target) plugins.
- [Hawkbit Micro Framework](https://github.com/HawkBitPhp/hawkbit) comes out of the box with Monolog.
- [SilverStripe 4](https://www.silverstripe.org/) comes out of the box with Monolog.
- [Drupal](https://www.drupal.org/) is usable with Monolog via the [monolog](https://www.drupal.org/project/monolog) module.
- [Aimeos ecommerce framework](https://aimeos.org/) is usable with Monolog via the [ai-monolog](https://github.com/aimeos/ai-monolog) extension.
- [Magento](https://magento.com/) comes out of the box with Monolog.
- [Spiral Framework](https://spiral.dev) comes out of the box with Monolog bridge.
- [WebFramework](https://web-framework.com/) comes out of the box with Monolog.
### Author
Jordi Boggiano - <j.boggiano@seld.be> - <http://twitter.com/seldaek><br />
See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) who participated in this project.
### License
Monolog is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
### Acknowledgements
This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
library, although most concepts have been adjusted to fit to the PHP world.
================================================
FILE: UPGRADE.md
================================================
### 4.0.0
Overall / notable changes:
- Monolog\DateTimeImmutable has been removed in favor of Monolog\JsonSerializableDateTimeImmutable.
### 3.0.0
Overall / notable changes:
- The minimum supported PHP version is now `8.1.0`.
- `Monolog\Logger::API` can be used to distinguish between a Monolog `3`, `2` or `1`
install when writing integration code.
- Log records have been converted from an array to a [`Monolog\LogRecord` object](src/Monolog/LogRecord.php)
with public (and mostly readonly) properties. e.g. instead of doing
`$record['context']` use `$record->context`.
In formatters or handlers if you rather need an array to work with you can use `$record->toArray()`
to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases
in the `level` and `level_name` keys to be more backwards compatible and use simpler data types.
- `FormatterInterface`, `HandlerInterface`, `ProcessorInterface`, etc. changed to contain `LogRecord $record`
instead of `array $record` parameter types. If you want to support multiple Monolog versions this should
be possible by type-hinting nothing, or `array|LogRecord` if you support PHP 8.0+. You can then code
against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC.
The interfaces do not require a `LogRecord` return type even where it would be applicable, but if you only
support Monolog 3 in integration code I would recommend you use `LogRecord` return types wherever fitting
to ensure forward compatibility as it may be added in Monolog 4.
- Log levels are now stored as an enum [`Monolog\Level`](src/Monolog/Level.php)
- All properties have had types added, which may require you to do so as well if you extended
a Monolog class and declared the same property.
#### Logger
- `Logger::DEBUG`, `Logger::ERROR`, etc. are now deprecated in favor of the `Level` enum.
e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case
to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer
value equal to what `Logger::WARNING` was giving you.
- `Logger::$levels` has been removed.
- `Logger::getLevels` has been removed in favor of `Monolog\Level::VALUES` or `Monolog\Level::cases()`.
- `setExceptionHandler` now requires a `Closure` instance and not just any `callable`.
#### HtmlFormatter
- If you redefined colors in the `$logLevels` property you must now override the
`getLevelColor` method instead.
#### NormalizerFormatter
- A new `normalizeRecord` method is available as an extension point which is called
only when converting the LogRecord to an array. You may need this if you overrode
`format` previously as `parent::format` now needs to receive a LogRecord still
so you cannot modify it before.
#### AbstractSyslogHandler
- If you redefined syslog levels in the `$logLevels` property you must now override the
`toSyslogPriority` method instead.
#### DynamoDbHandler
- Dropped support for AWS SDK v2
#### FilterHandler
- The factory callable to lazy load the nested handler must now be a `Closure` instance
and not just a `callable`.
#### FingersCrossedHandler
- The factory callable to lazy load the nested handler must now be a `Closure` instance
and not just a `callable`.
#### GelfHandler
- Dropped support for Gelf <1.1 and added support for graylog2/gelf-php v2.x. File, level
and facility are now passed in as additional fields (#1664)[https://github.com/Seldaek/monolog/pull/1664].
#### RollbarHandler
- If you redefined rollbar levels in the `$logLevels` property you must now override the
`toRollbarLevel` method instead.
#### SamplingHandler
- The factory callable to lazy load the nested handler must now be a `Closure` instance
and not just a `callable`.
#### SwiftMailerHandler
- Removed deprecated SwiftMailer handler, migrate to SymfonyMailerHandler instead.
#### ZendMonitorHandler
- If you redefined zend monitor levels in the `$levelMap` property you must now override the
`toZendMonitorLevel` method instead.
#### ResettableInterface
- `reset()` now requires a void return type.
### 2.0.0
- `Monolog\Logger::API` can be used to distinguish between a Monolog `1` and `2`
install of Monolog when writing integration code.
- Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`)
methods as well as `emerg`, `crit`, `err` and `warn`.
- DateTime are now formatted with a timezone and microseconds (unless disabled).
Various formatters and log output might be affected, which may mess with log parsing
in some cases.
- The `datetime` in every record array is now a DateTimeImmutable, not that you
should have been modifying these anyway.
- The timezone is now set per Logger instance and not statically, either
via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone
should be converted.
- `HandlerInterface` has been split off and two new interfaces now exist for
more granular controls: `ProcessableHandlerInterface` and
`FormattableHandlerInterface`. Handlers not extending `AbstractHandler`
should make sure to implement the relevant interfaces.
- `HandlerInterface` now requires the `close` method to be implemented. This
only impacts you if you implement the interface yourself, but you can extend
the new `Monolog\Handler\Handler` base class too.
- There is no more default handler configured on empty Logger instances, if
you were relying on that you will not get any output anymore, make sure to
configure the handler you need.
#### LogglyFormatter
- The records' `datetime` is not sent anymore. Only `timestamp` is sent to Loggly.
#### AmqpHandler
- Log levels are not shortened to 4 characters anymore. e.g. a warning record
will be sent using the `warning.channel` routing key instead of `warn.channel`
as in 1.x.
- The exchange name does not default to 'log' anymore, and it is completely ignored
now for the AMQP extension users. Only PHPAmqpLib uses it if provided.
#### RotatingFileHandler
- The file name format must now contain `{date}` and the date format must be set
to one of the predefined FILE_PER_* constants to avoid issues with file rotation.
See `setFilenameFormat`.
#### LogstashFormatter
- Removed Logstash V0 support
- Context/extra prefix has been removed in favor of letting users configure the exact key being sent
- Context/extra data are now sent as an object instead of single keys
#### HipChatHandler
- Removed deprecated HipChat handler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead
#### SlackbotHandler
- Removed deprecated SlackbotHandler handler, use SlackWebhookHandler or SlackHandler instead
#### RavenHandler
- Removed deprecated RavenHandler handler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead
#### ElasticSearchHandler
- As support for the official Elasticsearch library was added, the former ElasticSearchHandler has been
renamed to ElasticaHandler and the new one added as ElasticsearchHandler.
================================================
FILE: _config.yml
================================================
theme: jekyll-theme-slate
================================================
FILE: composer.json
================================================
{
"name": "monolog/monolog",
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"keywords": ["log", "logging", "psr-3"],
"homepage": "https://github.com/Seldaek/monolog",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "https://seld.be"
}
],
"require": {
"php": ">=8.1",
"psr/log": "^2.0 || ^3.0"
},
"require-dev": {
"ext-json": "*",
"aws/aws-sdk-php": "^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"graylog2/gelf-php": "^1.4.2 || ^2.0",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8 || ^2.0",
"php-amqplib/php-amqplib": "~2.4 || ^3",
"php-console/php-console": "^3.1.8",
"phpstan/phpstan": "^2",
"phpstan/phpstan-deprecation-rules": "^2",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "^10.5.17 || ^11.0.7",
"predis/predis": "^1.1 || ^2",
"rollbar/rollbar": "^4.0",
"ruflin/elastica": "^7 || ^8",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
"suggest": {
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ext-mbstring": "Allow to work properly with unicode symbols",
"ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)",
"ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler",
"ext-openssl": "Required to send log messages using SSL"
},
"autoload": {
"psr-4": {"Monolog\\": "src/Monolog"}
},
"autoload-dev": {
"psr-4": {"Monolog\\": "tests/Monolog"}
},
"provide": {
"psr/log-implementation": "3.0.0"
},
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"scripts": {
"test": "@php vendor/bin/phpunit",
"phpstan": "@php vendor/bin/phpstan analyse"
},
"config": {
"lock": false,
"sort-packages": true,
"platform-check": false,
"allow-plugins": {
"php-http/discovery": false
}
}
}
================================================
FILE: doc/01-usage.md
================================================
# Using Monolog
- [Installation](#installation)
- [Core Concepts](#core-concepts)
- [Log Levels](#log-levels)
- [Configuring a logger](#configuring-a-logger)
- [Adding extra data in the records](#adding-extra-data-in-the-records)
- [Leveraging channels](#leveraging-channels)
- [Customizing the log format](#customizing-the-log-format)
- [Long running processes and avoiding memory leaks](#long-running-processes-and-avoiding-memory-leaks)
## Installation
Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog))
and as such installable via [Composer](http://getcomposer.org/).
```bash
composer require monolog/monolog
```
## Core Concepts
Every `Logger` instance has a channel (name) and a stack of handlers. Whenever
you add a [record](message-structure.md) to the logger, it traverses the handler stack. Each handler
decides whether it fully handled the record, and if so, the propagation of the
record ends there.
This allows for flexible logging setups, for example having a `StreamHandler` at
the bottom of the stack that will log anything to disk, and on top of that add
a `MailHandler` that will send emails only when an error message is logged.
Handlers also have a `$bubble` property which defines whether they block the
record or not if they handled it. In this example, setting the `MailHandler`'s
`$bubble` argument to false means that records handled by the `MailHandler` will
not propagate to the `StreamHandler` anymore.
You can create many `Logger`s, each defining a channel (e.g.: db, request,
router, ..) and each of them combining various handlers, which can be shared
or not. The channel is reflected in the logs and allows you to easily see or
filter records.
Each Handler also has a Formatter, a default one with settings that make sense
will be created if you don't set one. The formatters normalize and format
incoming records so that they can be used by the handlers to output useful
information.
Custom severity levels are not available. Only the eight
[RFC 5424](https://datatracker.ietf.org/doc/html/rfc5424) levels (debug, info, notice,
warning, error, critical, alert, emergency) are present for basic filtering
purposes, but for sorting and other use cases that would require
flexibility, you should add Processors to the Logger that can add extra
information (tags, user ip, ..) to the records before they are handled.
## Log Levels
Monolog supports the logging levels described by [RFC 5424](https://datatracker.ietf.org/doc/html/rfc5424).
- **DEBUG** (100): Detailed debug information.
- **INFO** (200): Interesting events. Examples: User logs in, SQL logs.
- **NOTICE** (250): Normal but significant events.
- **WARNING** (300): Exceptional occurrences that are not errors. Examples:
Use of deprecated APIs, poor use of an API, undesirable things that are not
necessarily wrong.
- **ERROR** (400): Runtime errors that do not require immediate action but
should typically be logged and monitored.
- **CRITICAL** (500): Critical conditions. Example: Application component
unavailable, unexpected exception.
- **ALERT** (550): Action must be taken immediately. Example: Entire website
down, database unavailable, etc. This should trigger the SMS alerts and wake
you up.
- **EMERGENCY** (600): Emergency: system is unusable.
## Configuring a logger
Here is a basic setup to log to a file and to firephp on the DEBUG level:
```php
<?php
use Monolog\Level;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\FirePHPHandler;
// Create the logger
$logger = new Logger('my_logger');
// Now add some handlers
$logger->pushHandler(new StreamHandler(__DIR__.'/my_app.log', Level::Debug));
$logger->pushHandler(new FirePHPHandler());
// You can now use your logger
$logger->info('My logger is now ready');
```
Let's explain it. The first step is to create the logger instance which will
be used in your code. The argument is a channel name, which is useful when
you use several loggers (see below for more details about it).
The logger itself does not know how to handle a record. It delegates it to
some handlers. The code above registers two handlers in the stack to allow
handling records in two different ways.
Note that the FirePHPHandler is called first as it is added on top of the
stack. This allows you to temporarily add a logger with bubbling disabled if
you want to override other configured loggers.
## Adding extra data in the records
Monolog provides two different ways to add extra information along the simple
textual message.
### Using the logging context
The first way is the context, allowing to pass an array of data along the
record:
```php
<?php
$logger->info('Adding a new user', ['username' => 'Seldaek']);
```
Simple handlers (like the StreamHandler for instance) will simply format
the array to a string but richer handlers can take advantage of the context
(FirePHP is able to display arrays in a pretty way for instance).
### Using processors
The second way is to add extra data for all records by using a processor.
Processors can be any callable. They will get the record as parameter and
must return it after having eventually changed the `extra` part of it. Let's
write a processor adding some dummy data in the record:
```php
<?php
$logger->pushProcessor(function ($record) {
$record->extra['dummy'] = 'Hello world!';
return $record;
});
```
Monolog provides some built-in processors that can be used in your project.
Look at the [dedicated chapter](https://github.com/Seldaek/monolog/blob/main/doc/02-handlers-formatters-processors.md#processors) for the list.
> Tip: processors can also be registered on a specific handler instead of
the logger to apply only for this handler.
## Leveraging channels
Channels are a great way to identify to which part of the application a record
is related. This is useful in big applications (and is leveraged by
MonologBundle in Symfony).
Picture two loggers sharing a handler that writes to a single log file.
Channels would allow you to identify the logger that issued every record.
You can easily grep through the log files filtering this or that channel.
```php
<?php
use Monolog\Level;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\FirePHPHandler;
// Create some handlers
$stream = new StreamHandler(__DIR__.'/my_app.log', Level::Debug);
$firephp = new FirePHPHandler();
// Create the main logger of the app
$logger = new Logger('my_logger');
$logger->pushHandler($stream);
$logger->pushHandler($firephp);
// Create a logger for the security-related stuff with a different channel
$securityLogger = new Logger('security');
$securityLogger->pushHandler($stream);
$securityLogger->pushHandler($firephp);
// Or clone the first one to only change the channel
$securityLogger = $logger->withName('security');
```
## Customizing the log format
In Monolog it's easy to customize the format of the logs written into files,
sockets, mails, databases and other handlers; by the use of "Formatters".
As mentioned before, a *Formatter* is attached to a *Handler*, and as a general convention, most of the handlers use the
```php
$record->formatted
```
property in the log record to store its formatted value.
You can choose between predefined formatter classes or write your own (e.g. a multiline text file for human-readable output).
> Note:
>
> A very useful formatter to look at, is the `LineFormatter`.
>
> This formatter, as its name might indicate, is able to return a lineal string representation of the log record provided.
>
> It is also capable to interpolate values from the log record, into the output format template used by the formatter to generate
> the final result, and in order to do it, you need to provide the log record values you are interested in, in the output template
> string using the form %value%, e.g: "'%context.foo% => %extra.foo%'" , in this example the values `$record->context["foo"]`
> and `$record->extra["foo"]` will be rendered as part of the final result.
In the following example, we demonstrate how to:
1. Create a `LineFormatter` instance and set a custom output format template.
2. Create a new *Handler*.
3. Attach the *Formatter* to the *Handler*.
4. Create a new *Logger* object.
5. Attach the *Handler* to the *Logger* object.
```php
<?php
// the default date format is "Y-m-d\TH:i:sP"
$dateFormat = "Y n j, g:i a";
// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
// we now change the default output format according to our needs.
$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
// finally, create a formatter
$formatter = new LineFormatter($output, $dateFormat);
// Create a handler
$stream = new StreamHandler(__DIR__.'/my_app.log', Level::Debug);
$stream->setFormatter($formatter);
// bind it to a logger object
$securityLogger = new Logger('security');
$securityLogger->pushHandler($stream);
```
You may also reuse the same formatter between multiple handlers and share those
handlers between multiple loggers.
## Long running processes and avoiding memory leaks
When logging lots of data or especially when running background workers which
are long-lived processes and do lots of logging over long periods of time, the
memory usage of buffered handlers like FingersCrossedHandler or BufferHandler
can rise quickly.
Monolog provides the `ResettableInterface` for this use case, allowing you to
end a log cycle and get things back to their initial state.
Calling `$logger->reset();` means flushing/cleaning all buffers, resetting internal
state, and getting it back to a state in which it can receive log records again.
This is the conceptual equivalent of ending a web request, and can be done
between every background job you process, or whenever appropriate. It reduces memory
usage and also helps keep logs focused on the task at hand, avoiding log leaks
between different jobs.
[Handlers, Formatters and Processors](02-handlers-formatters-processors.md) →
================================================
FILE: doc/02-handlers-formatters-processors.md
================================================
# Handlers, Formatters and Processors
- [Handlers](#handlers)
- [Log to files and syslog](#log-to-files-and-syslog)
- [Send alerts and emails](#send-alerts-and-emails)
- [Log specific servers and networked logging](#log-specific-servers-and-networked-logging)
- [Logging in development](#logging-in-development)
- [Log to databases](#log-to-databases)
- [Wrappers / Special Handlers](#wrappers--special-handlers)
- [Formatters](#formatters)
- [Processors](#processors)
- [Third Party Packages](#third-party-packages)
## Handlers
### Log to files and syslog
- [_StreamHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/StreamHandler.php): Logs records into any PHP stream, use this for log files.
- [_RotatingFileHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/RotatingFileHandler.php): Logs records to a file and creates one log file per day.
It will also delete files older than `$maxFiles`. You should use
[logrotate](https://linux.die.net/man/8/logrotate) for high profile
setups though, this is just meant as a quick and dirty solution.
- [_SyslogHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SyslogHandler.php): Logs records to the syslog.
- [_ErrorLogHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ErrorLogHandler.php): Logs records to PHP's
[`error_log()`](https://www.php.net/manual/en/function.error-log.php) function.
- [_ProcessHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ProcessHandler.php): Logs records to the [STDIN](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_.28stdin.29) of any process, specified by a command.
### Send alerts and emails
- [_NativeMailerHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/NativeMailerHandler.php): Sends emails using PHP's
[`mail()`](http://php.net/manual/en/function.mail.php) function.
- [_SymfonyMailerHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SymfonyMailerHandler.php): Sends emails using a [`symfony/mailer`](https://symfony.com/doc/current/mailer.html) instance.
- [_PushoverHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/PushoverHandler.php): Sends mobile notifications via the [Pushover](https://www.pushover.net/) API.
- [_SlackWebhookHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SlackWebhookHandler.php): Logs records to a [Slack](https://www.slack.com/) account using Slack Webhooks.
- [_SlackHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SlackHandler.php): Logs records to a [Slack](https://www.slack.com/) account using the Slack API (complex setup).
- [_SendGridHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SendGridHandler.php): Sends emails via the SendGrid API.
- [_MandrillHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/MandrillHandler.php): Sends emails via the [`Mandrill API`](https://mandrillapp.com/api/docs/) using a [`Swift_Message`](http://swiftmailer.org/) instance.
- [_FleepHookHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FleepHookHandler.php): Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
- [_IFTTTHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/IFTTTHandler.php): Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
- [_TelegramBotHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/TelegramBotHandler.php): Logs records to a [Telegram](https://core.telegram.org/bots/api) bot account.
- [_HipChatHandler_](https://github.com/Seldaek/monolog/blob/1.x/src/Monolog/Handler/HipChatHandler.php): Logs records to a [HipChat](http://hipchat.com) chat room using its API. **Deprecated** and removed in Monolog 2.0, use Slack handlers instead, see [Atlassian's announcement](https://www.atlassian.com/partnerships/slack)
- [_SwiftMailerHandler_](https://github.com/Seldaek/monolog/blob/2.x/src/Monolog/Handler/SwiftMailerHandler.php): Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance. **Deprecated** and removed in Monolog 3.0. Use SymfonyMailerHandler instead.
### Log specific servers and networked logging
- [_SocketHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SocketHandler.php): Logs records to [sockets](http://php.net/fsockopen), use this
for UNIX and TCP sockets. See an [example](sockets.md).
- [_AmqpHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/AmqpHandler.php): Logs records to an [AMQP](http://www.amqp.org/) compatible
server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+) or
[php-amqplib](https://github.com/php-amqplib/php-amqplib) library.
- [_GelfHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/GelfHandler.php): Logs records to a [Graylog2](http://www.graylog2.org) server.
Requires package [graylog2/gelf-php](https://github.com/bzikarsky/gelf-php).
- [_ZendMonitorHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ZendMonitorHandler.php): Logs records to the Zend Monitor present in Zend Server.
- [_NewRelicHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/NewRelicHandler.php): Logs records to a [NewRelic](http://newrelic.com/) application.
- [_LogglyHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/LogglyHandler.php): Logs records to a [Loggly](http://www.loggly.com/) account.
- [_RollbarHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/RollbarHandler.php): Logs records to a [Rollbar](https://rollbar.com/) account.
- [_SyslogUdpHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SyslogUdpHandler.php): Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
- [_LogEntriesHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/LogEntriesHandler.php): Logs records to a [LogEntries](http://logentries.com/) account.
- [_InsightOpsHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/InsightOpsHandler.php): Logs records to an [InsightOps](https://www.rapid7.com/products/insightops/) account.
- [_LogmaticHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/LogmaticHandler.php): Logs records to a [Logmatic](http://logmatic.io/) account.
- [_SqsHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SqsHandler.php): Logs records to an [AWS SQS](http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-sqs.html) queue.
- [_RavenHandler_](https://github.com/Seldaek/monolog/blob/1.x/src/Monolog/Handler/RavenHandler.php): Logs records to a [Sentry](http://getsentry.com/) server using
[raven](https://packagist.org/packages/raven/raven). **Deprecated** and removed in Monolog 2.0, use sentry/sentry 2.x and the [Sentry\Monolog\Handler](https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php) class instead.
### Logging in development
- [_FirePHPHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FirePHPHandler.php): Handler for [FirePHP](http://www.firephp.org/), providing
inline `console` messages within [FireBug](http://getfirebug.com/).
- [_ChromePHPHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ChromePHPHandler.php): Handler for [ChromePHP](http://www.chromephp.com/), providing
inline `console` messages within Chrome.
- [_BrowserConsoleHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/BrowserConsoleHandler.php): Handler to send logs to browser's Javascript `console` with
no browser extension required. Most browsers supporting `console` API are supported.
### Log to databases
- [_RedisHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/RedisHandler.php): Logs records to a [redis](http://redis.io) server's key via RPUSH.
- [_RedisPubSubHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/RedisPubSubHandler.php): Logs records to a [redis](http://redis.io) server's channel via PUBLISH.
- [_MongoDBHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/MongoDBHandler.php): Handler to write records in MongoDB via a
[Mongo](http://pecl.php.net/package/mongo) extension connection.
- [_CouchDBHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/CouchDBHandler.php): Logs records to a CouchDB server.
- [_DoctrineCouchDBHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/DoctrineCouchDBHandler.php): Logs records to a CouchDB server via the Doctrine CouchDB ODM.
- [_ElasticaHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ElasticaHandler.php): Logs records to an Elasticsearch server using [ruflin/elastica](https://elastica.io/).
- [_ElasticsearchHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/ElasticsearchHandler.php): Logs records to an Elasticsearch server.
- [_DynamoDbHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/DynamoDbHandler.php): Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
### Wrappers / Special Handlers
- [_FingersCrossedHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FingersCrossedHandler.php): A very interesting wrapper. It takes a handler as
a parameter and will accumulate log records of all levels until a record
exceeds the defined severity level. At which point it delivers all records,
including those of lower severity, to the handler it wraps. This means that
until an error actually happens you will not see anything in your logs, but
when it happens you will have the full information, including debug and info
records. This provides you with all the information you need, but only when
you need it.
- [_DeduplicationHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/DeduplicationHandler.php): Useful if you are sending notifications or emails
when critical errors occur. It takes a handler as a parameter and will
accumulate log records of all levels until the end of the request (or
`flush()` is called). At that point it delivers all records to the handler
it wraps, but only if the records are unique over a given time period
(60seconds by default). If the records are duplicates they are simply
discarded. The main use of this is in case of critical failure like if your
database is unreachable for example all your requests will fail and that
can result in a lot of notifications being sent. Adding this handler reduces
the amount of notifications to a manageable level.
- [_WhatFailureGroupHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/WhatFailureGroupHandler.php): This handler extends the _GroupHandler_ ignoring
exceptions raised by each child handler. This allows you to ignore issues
where a remote tcp connection may have died but you do not want your entire
application to crash and may wish to continue to log to other handlers.
- [_FallbackGroupHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FallbackGroupHandler.php): This handler extends the _GroupHandler_ ignoring
exceptions raised by each child handler, until one has handled without throwing.
This allows you to ignore issues where a remote tcp connection may have died
but you do not want your entire application to crash and may wish to continue
to attempt logging to other handlers, until one does not throw an exception.
- [_BufferHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/BufferHandler.php): This handler will buffer all the log records it receives
until `close()` is called at which point it will call `handleBatch()` on the
handler it wraps with all the log messages at once. This is very useful to
send an email with all records at once for example instead of having one mail
for every log record.
- [_GroupHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/GroupHandler.php): This handler groups other handlers. Every record received is
sent to all the handlers it is configured with.
- [_FilterHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FilterHandler.php): This handler only lets records of the given levels through
to the wrapped handler.
- [_SamplingHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/SamplingHandler.php): Wraps around another handler and lets you sample records
if you only want to store some of them.
- [_NoopHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/NoopHandler.php): This handler handles anything by doing nothing. It does not stop
processing the rest of the stack. This can be used for testing, or to disable a handler when overriding a configuration.
- [_NullHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/NullHandler.php): Any record it can handle will be thrown away. This can be used
to put on top of an existing handler stack to disable it temporarily.
- [_PsrHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/PsrHandler.php): Can be used to forward log records to an existing PSR-3 logger
- [_TestHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/TestHandler.php): Used for testing, it records everything that is sent to it and
has accessors to read out the information.
- [_HandlerWrapper_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/HandlerWrapper.php): A simple handler wrapper you can inherit from to create
your own wrappers easily.
- [_OverflowHandler_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/OverflowHandler.php): This handler will buffer all the log messages it
receives, up until a configured threshold of number of messages of a certain level is reached, after it will pass all
log messages to the wrapped handler. Useful for applying in batch processing when you're only interested in significant
failures instead of minor, single erroneous events.
## Formatters
- [_LineFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/LineFormatter.php): Formats a log record into a one-line string.
- [_HtmlFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/HtmlFormatter.php): Used to format log records into a human readable html table, mainly suitable for emails.
- [_NormalizerFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/NormalizerFormatter.php): Normalizes objects/resources down to strings so a record can easily be serialized/encoded.
- [_ScalarFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/ScalarFormatter.php): Used to format log records into an associative array of scalar values.
- [_JsonFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/JsonFormatter.php): Encodes a log record into json.
- [_WildfireFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/WildfireFormatter.php): Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
- [_ChromePHPFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/ChromePHPFormatter.php): Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
- [_GelfMessageFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/GelfMessageFormatter.php): Used to format log records into Gelf message instances, only useful for the GelfHandler.
- [_LogstashFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/LogstashFormatter.php): Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest).
- [_ElasticaFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/ElasticaFormatter.php): Used to format log records into an Elastica\Document object, only useful for the ElasticaHandler.
- [_ElasticsearchFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/ElasticsearchFormatter.php): Used to add index and type keys to log records, only useful for the ElasticsearchHandler.
- [_LogglyFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/LogglyFormatter.php): Used to format log records into Loggly messages, only useful for the LogglyHandler.
- [_MongoDBFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/MongoDBFormatter.php): Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
- [_LogmaticFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/LogmaticFormatter.php): Used to format log records to [Logmatic](http://logmatic.io/) messages, only useful for the LogmaticHandler.
- [_FluentdFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/FluentdFormatter.php): Used to format log records to [Fluentd](https://www.fluentd.org/) logs, only useful with the SocketHandler.
- [_GoogleCloudLoggingFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php): Used to format log records for Google Cloud Logging. It works like a JsonFormatter with some minor tweaks.
- [_SyslogFormatter_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/SyslogFormatter.php): Used to format log records in RFC 5424 / syslog format. This can be used to output a syslog-style file that can then be consumed by tools like [lnav](https://lnav.org/).
## Processors
- [_PsrLogMessageProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/PsrLogMessageProcessor.php): Processes a log record's message according to PSR-3 rules, replacing `{foo}` with the value from `$context['foo']`.
- [_LoadAverageProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/LoadAverageProcessor.php): Adds the current system load average to a log record.
- [_ClosureContextProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/ClosureContextProcessor.php): Allows delaying the creation of context data by setting a Closure in context which is called when the log record is used
- [_IntrospectionProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/IntrospectionProcessor.php): Adds the line/file/class/method from which the log call originated.
- [_WebProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/WebProcessor.php): Adds the current request URI, request method and client IP to a log record.
- [_MemoryUsageProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/MemoryUsageProcessor.php): Adds the current memory usage to a log record.
- [_MemoryPeakUsageProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/MemoryPeakUsageProcessor.php): Adds the peak memory usage to a log record.
- [_ProcessIdProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/ProcessIdProcessor.php): Adds the process id to a log record.
- [_UidProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/UidProcessor.php): Adds a unique identifier to a log record.
- [_GitProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/GitProcessor.php): Adds the current git branch and commit to a log record.
- [_MercurialProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/MercurialProcessor.php): Adds the current hg branch and commit to a log record.
- [_TagProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/TagProcessor.php): Adds an array of predefined tags to a log record.
- [_HostnameProcessor_](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Processor/HostnameProcessor.php): Adds the current hostname to a log record.
## Third Party Packages
Third party handlers, formatters and processors are
[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
can also add your own there if you publish one.
← [Usage](01-usage.md) | [Utility classes](03-utilities.md) →
================================================
FILE: doc/03-utilities.md
================================================
# Utilities
- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you
can then statically access from anywhere. It is not really a best practice but can
help in some older codebases or for ease of use.
- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
a Logger instance as an exception handler, error handler or fatal error handler.
- _SignalHandler_: The `Monolog\SignalHandler` class allows you to easily register
a Logger instance as a POSIX signal handler.
- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
level is reached.
- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
log level is reached, depending on which channel received the log record.
← [Handlers, Formatters and Processors](02-handlers-formatters-processors.md) | [Extending Monolog](04-extending.md) →
================================================
FILE: doc/04-extending.md
================================================
# Extending Monolog
Monolog is fully extensible, allowing you to adapt your logger to your needs.
## Understanding log records
See [the page about log records](message-structure.md) to learn what makes up
a log record before going further. This is essential to understand as all
Handlers/Formatters/Processors need to deal with log records in one way or
another.
## Writing your own handler
Monolog provides many built-in handlers. But if the one you need does not
exist, you can write it and use it in your logger. The only requirement is
to implement `Monolog\Handler\HandlerInterface`.
Let's write a PDOHandler to log records to a database. We will extend the
abstract class provided by Monolog to keep things DRY.
```php
<?php
use Monolog\Level;
use Monolog\Logger;
use Monolog\LogRecord;
use Monolog\Handler\AbstractProcessingHandler;
class PDOHandler extends AbstractProcessingHandler
{
private bool $initialized = false;
private PDO $pdo;
private PDOStatement $statement;
public function __construct(PDO $pdo, int|string|Level $level = Level::Debug, bool $bubble = true)
{
$this->pdo = $pdo;
parent::__construct($level, $bubble);
}
protected function write(LogRecord $record): void
{
if (!$this->initialized) {
$this->initialize();
}
$this->statement->execute(array(
'channel' => $record->channel,
'level' => $record->level,
'message' => $record->formatted,
'time' => $record->datetime->format('U'),
));
}
private function initialize()
{
$this->pdo->exec(
'CREATE TABLE IF NOT EXISTS monolog '
.'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)'
);
$this->statement = $this->pdo->prepare(
'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)'
);
$this->initialized = true;
}
}
```
You can now use this handler in your logger:
```php
<?php
$logger->pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')));
// You can now use your logger
$logger->info('My logger is now ready');
```
The `Monolog\Handler\AbstractProcessingHandler` class provides most of the
logic needed for the handler, including the use of processors and the formatting
of the record (which is why we use ``$record->formatted`` instead of ``$record->message``).
← [Utility classes](03-utilities.md)
================================================
FILE: doc/message-structure.md
================================================
# Log message structure
Within monolog log messages are passed around as [Monolog\LogRecord](../src/Monolog/LogRecord.php) objects,
for example to processors or handlers.
The table below describes the properties available.
property | type | description
-----------|---------------------------|-------------------------------------------------------------------------------
message | string | The log message. When the `PsrLogMessageProcessor` is used this string may contain placeholders that will be replaced by variables from the context, e.g., "User {username} logged in" with `['username' => 'John']` as context will be written as "User John logged in".
level | Monolog\Level case | Severity of the log message. See log levels described in [01-usage.md](01-usage.md#log-levels).
context | array | Arbitrary data passed with the construction of the message. For example the username of the current user or their IP address.
channel | string | The channel this message was logged to. This is the name that was passed when the logger was created with `new Logger('channel')`.
datetime | Monolog\JsonSerializableDateTimeImmutable | Date and time when the message was logged. Class extends `\DateTimeImmutable`.
extra | array | A placeholder array where processors can put additional data. Always available, but empty if there are no processors registered.
At first glance `context` and `extra` look very similar, and they are in the sense that they both carry arbitrary data that is related to the log message somehow.
The main difference is that `context` can be supplied in user land (it is the 3rd parameter to `Psr\Log\LoggerInterface` methods) whereas `extra` is internal only
and can be filled by processors. The reason processors write to `extra` and not to `context` is to prevent overriding any user-provided data in `context`.
All properties except `extra` are read-only.
> Note: For BC reasons with Monolog 1 and 2 which used arrays, `LogRecord` implements `ArrayAccess` so you can access the above properties
> using `$record['message']` for example, with the notable exception of `level->getName()` which must be referred to as `level_name` for BC.
================================================
FILE: doc/sockets.md
================================================
Sockets Handler
===============
This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen)
or [pfsockopen](http://php.net/pfsockopen).
Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening
the connections between requests.
You can use a `unix://` prefix to access unix sockets and `udp://` to open UDP sockets instead of the default TCP.
Basic Example
-------------
```php
<?php
use Monolog\Logger;
use Monolog\Handler\SocketHandler;
// Create the logger
$logger = new Logger('my_logger');
// Create the handler
$handler = new SocketHandler('unix:///var/log/httpd_app_log.socket');
$handler->setPersistent(true);
// Now add the handler
$logger->pushHandler($handler, Level::Debug);
// You can now use your logger
$logger->info('My logger is now ready');
```
In this example, using syslog-ng, you should see the log on the log server:
cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] []
================================================
FILE: phpstan-baseline-8.2.neon
================================================
parameters:
ignoreErrors:
-
message: "#^Call to deprecated function utf8_encode\\(\\)\\.$#"
count: 1
path: src/Monolog/Utils.php
================================================
FILE: phpstan-baseline.neon
================================================
parameters:
ignoreErrors:
-
rawMessage: 'Property Monolog\ErrorHandler::$reservedMemory is never read, only written.'
identifier: property.onlyWritten
count: 1
path: src/Monolog/ErrorHandler.php
-
rawMessage: 'Return type (array<array<mixed>|bool|float|int|object|string|null>|bool|float|int|object|string|null) of method Monolog\Formatter\JsonFormatter::normalize() should be covariant with return type (array<array<mixed>|bool|float|int|string|null>|bool|float|int|string|null) of method Monolog\Formatter\NormalizerFormatter::normalize()'
identifier: method.childReturnType
count: 1
path: src/Monolog/Formatter/JsonFormatter.php
-
rawMessage: 'Return type (array<array<mixed>|bool|float|int|stdClass|string|null>) of method Monolog\Formatter\JsonFormatter::normalizeRecord() should be covariant with return type (array<array<mixed>|bool|float|int|string|null>) of method Monolog\Formatter\NormalizerFormatter::normalizeRecord()'
identifier: method.childReturnType
count: 1
path: src/Monolog/Formatter/JsonFormatter.php
-
rawMessage: 'Return type (string) of method Monolog\Formatter\LineFormatter::normalizeException() should be compatible with return type (array<array<array<string>|int|string>|int|string>) of method Monolog\Formatter\NormalizerFormatter::normalizeException()'
identifier: method.childReturnType
count: 1
path: src/Monolog/Formatter/LineFormatter.php
-
rawMessage: 'Method Monolog\Formatter\NormalizerFormatter::normalizeException() should return array<array<array<string>|int|string>|int|string> but returns array<string, array<array<array<string>|int|string>|int|string>|int|string>.'
identifier: return.type
count: 1
path: src/Monolog/Formatter/NormalizerFormatter.php
-
rawMessage: 'Return type (array<array<mixed>|bool|float|int|string|null>|bool|float|int|object|string|null) of method Monolog\Formatter\WildfireFormatter::normalize() should be covariant with return type (array<array<mixed>|bool|float|int|string|null>|bool|float|int|string|null) of method Monolog\Formatter\NormalizerFormatter::normalize()'
identifier: method.childReturnType
count: 1
path: src/Monolog/Formatter/WildfireFormatter.php
-
rawMessage: Access to constant VERSION on an unknown class Elasticsearch\Client.
identifier: class.notFound
count: 1
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: 'Call to method bulk() on an unknown class Elasticsearch\Client.'
identifier: class.notFound
count: 1
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: 'Method Monolog\Handler\ElasticsearchHandler::createExceptionFromError() should return Throwable but returns Elasticsearch\Common\Exceptions\RuntimeException.'
identifier: return.type
count: 1
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: 'Method Monolog\Handler\ElasticsearchHandler::createExceptionFromResponses() should return Throwable but returns Elasticsearch\Common\Exceptions\RuntimeException.'
identifier: return.type
count: 1
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: 'Parameter $client of method Monolog\Handler\ElasticsearchHandler::__construct() has invalid type Elasticsearch\Client.'
identifier: class.notFound
count: 2
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: Property Monolog\Handler\ElasticsearchHandler::$client has unknown class Elasticsearch\Client as its type.
identifier: class.notFound
count: 1
path: src/Monolog/Handler/ElasticsearchHandler.php
-
rawMessage: Short ternary operator is not allowed. Use null coalesce operator if applicable or consider using long ternary.
identifier: ternary.shortNotAllowed
count: 1
path: src/Monolog/Handler/FingersCrossedHandler.php
-
rawMessage: 'Call to method setBody() on an unknown class Swift_Message.'
identifier: class.notFound
count: 1
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: 'Call to method setDate() on an unknown class Swift_Message.'
identifier: class.notFound
count: 1
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: Class Swift_Message not found.
identifier: class.notFound
count: 2
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: Cloning object of an unknown class Swift_Message.
identifier: class.notFound
count: 1
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: 'Parameter $message of method Monolog\Handler\MandrillHandler::__construct() has invalid type Swift_Message.'
identifier: class.notFound
count: 3
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: Property Monolog\Handler\MandrillHandler::$message has unknown class Swift_Message as its type.
identifier: class.notFound
count: 1
path: src/Monolog/Handler/MandrillHandler.php
-
rawMessage: 'Variable property access on $this(Monolog\LogRecord).'
identifier: property.dynamicName
count: 4
path: src/Monolog/LogRecord.php
-
rawMessage: 'Cannot assign offset Fiber to WeakMap<Fiber<mixed, mixed, mixed, mixed>, int>.'
identifier: offsetAssign.dimType
count: 1
path: src/Monolog/Logger.php
-
rawMessage: 'Parameter #1 $level (''alert''|''critical''|''debug''|''emergency''|''error''|''info''|''notice''|''warning''|Monolog\Level) of method Monolog\Logger::log() should be contravariant with parameter $level (mixed) of method Psr\Log\LoggerInterface::log()'
identifier: method.childParameterType
count: 1
path: src/Monolog/Logger.php
-
rawMessage: 'Variable property access on $this(Monolog\Logger).'
identifier: property.dynamicName
count: 1
path: src/Monolog/Logger.php
-
rawMessage: 'Parameter #1 $length of function random_bytes expects int<1, max>, int given.'
identifier: argument.type
count: 1
path: src/Monolog/Processor/UidProcessor.php
================================================
FILE: phpstan-ignore-by-php-version.neon.php
================================================
<?php declare(strict_types = 1);
$includes = [];
if (PHP_VERSION_ID >= 80200) {
$includes[] = __DIR__ . '/phpstan-baseline-8.2.neon';
}
$config['includes'] = $includes;
return $config;
================================================
FILE: phpstan.neon.dist
================================================
parameters:
level: 8
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: true
paths:
- src/
# - tests/
excludePaths:
- 'src/Monolog/Handler/PHPConsoleHandler.php'
ignoreErrors:
- '#zend_monitor_|ZEND_MONITOR_#'
- '#MongoDB\\(Client|Collection)#'
includes:
- phpstan-baseline.neon
- phpstan-ignore-by-php-version.neon.php
- phar://phpstan.phar/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/bootstrap.php"
colors="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerNotices="true"
beStrictAboutTestsThatDoNotTestAnything="false">
<testsuites>
<testsuite name="Monolog Test Suite">
<directory>tests/Monolog/</directory>
</testsuite>
</testsuites>
<coverage/>
<php>
<ini name="date.timezone" value="UTC"/>
</php>
<source>
<include>
<directory suffix=".php">src/Monolog/</directory>
</include>
</source>
</phpunit>
================================================
FILE: src/Monolog/Attribute/AsMonologProcessor.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Attribute;
/**
* A reusable attribute to help configure a class or a method as a processor.
*
* Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer.
*
* Using it with the Monolog library only has no effect at all: processors should still be turned into a callable if
* needed and manually pushed to the loggers and to the processable handlers.
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class AsMonologProcessor
{
/**
* @param string|null $channel The logging channel the processor should be pushed to.
* @param string|null $handler The handler the processor should be pushed to.
* @param string|null $method The method that processes the records (if the attribute is used at the class level).
* @param int|null $priority The priority of the processor so the order can be determined.
*/
public function __construct(
public readonly ?string $channel = null,
public readonly ?string $handler = null,
public readonly ?string $method = null,
public readonly ?int $priority = null
) {
}
}
================================================
FILE: src/Monolog/Attribute/WithMonologChannel.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Attribute;
/**
* A reusable attribute to help configure a class as expecting a given logger channel.
*
* Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer.
*
* Using it with the Monolog library only has no effect at all: wiring the logger instance into
* other classes is not managed by Monolog.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
final class WithMonologChannel
{
public function __construct(
public readonly string $channel
) {
}
}
================================================
FILE: src/Monolog/DateTimeImmutable.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog;
class_alias(JsonSerializableDateTimeImmutable::class, 'Monolog\DateTimeImmutable');
// @phpstan-ignore-next-line
if (false) {
/**
* @deprecated Use \Monolog\JsonSerializableDateTimeImmutable instead.
*/
class DateTimeImmutable extends JsonSerializableDateTimeImmutable
{
}
}
================================================
FILE: src/Monolog/ErrorHandler.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog;
use Closure;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
/**
* Monolog error handler
*
* A facility to enable logging of runtime errors, exceptions and fatal errors.
*
* Quick setup: <code>ErrorHandler::register($logger);</code>
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class ErrorHandler
{
private Closure|null $previousExceptionHandler = null;
/** @var array<class-string, LogLevel::*> an array of class name to LogLevel::* constant mapping */
private array $uncaughtExceptionLevelMap = [];
/** @var Closure|true|null */
private Closure|bool|null $previousErrorHandler = null;
/** @var array<int, LogLevel::*> an array of E_* constant to LogLevel::* constant mapping */
private array $errorLevelMap = [];
private bool $handleOnlyReportedErrors = true;
private bool $hasFatalErrorHandler = false;
private string $fatalLevel = LogLevel::ALERT;
private string|null $reservedMemory = null;
/** @var ?array{type: int, message: string, file: string, line: int, trace: mixed} */
private array|null $lastFatalData = null;
private const FATAL_ERRORS = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
public function __construct(
private LoggerInterface $logger
) {
}
/**
* Registers a new ErrorHandler for a given Logger
*
* By default it will handle errors, exceptions and fatal errors
*
* @param array<int, LogLevel::*>|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
* @param array<class-string, LogLevel::*>|false $exceptionLevelMap an array of class name to LogLevel::* constant mapping, or false to disable exception handling
* @param LogLevel::*|null|false $fatalLevel a LogLevel::* constant, null to use the default LogLevel::ALERT or false to disable fatal error handling
* @return static
*/
public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self
{
/** @phpstan-ignore-next-line */
$handler = new static($logger);
if ($errorLevelMap !== false) {
$handler->registerErrorHandler($errorLevelMap);
}
if ($exceptionLevelMap !== false) {
$handler->registerExceptionHandler($exceptionLevelMap);
}
if ($fatalLevel !== false) {
$handler->registerFatalHandler($fatalLevel);
}
return $handler;
}
/**
* @param array<class-string, LogLevel::*> $levelMap an array of class name to LogLevel::* constant mapping
* @return $this
*/
public function registerExceptionHandler(array $levelMap = [], bool $callPrevious = true): self
{
$prev = set_exception_handler(function (\Throwable $e): void {
$this->handleException($e);
});
$this->uncaughtExceptionLevelMap = $levelMap;
foreach ($this->defaultExceptionLevelMap() as $class => $level) {
if (!isset($this->uncaughtExceptionLevelMap[$class])) {
$this->uncaughtExceptionLevelMap[$class] = $level;
}
}
if ($callPrevious && null !== $prev) {
$this->previousExceptionHandler = $prev(...);
}
return $this;
}
/**
* @param array<int, LogLevel::*> $levelMap an array of E_* constant to LogLevel::* constant mapping
* @return $this
*/
public function registerErrorHandler(array $levelMap = [], bool $callPrevious = true, int $errorTypes = -1, bool $handleOnlyReportedErrors = true): self
{
$prev = set_error_handler($this->handleError(...), $errorTypes);
$this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
if ($callPrevious) {
$this->previousErrorHandler = $prev !== null ? $prev(...) : true;
} else {
$this->previousErrorHandler = null;
}
$this->handleOnlyReportedErrors = $handleOnlyReportedErrors;
return $this;
}
/**
* @param LogLevel::*|null $level a LogLevel::* constant, null to use the default LogLevel::ALERT
* @param int $reservedMemorySize Amount of KBs to reserve in memory so that it can be freed when handling fatal errors giving Monolog some room in memory to get its job done
* @return $this
*/
public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self
{
register_shutdown_function($this->handleFatalError(...));
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
$this->fatalLevel = null === $level ? LogLevel::ALERT : $level;
$this->hasFatalErrorHandler = true;
return $this;
}
/**
* @return array<class-string, LogLevel::*>
*/
protected function defaultExceptionLevelMap(): array
{
return [
'ParseError' => LogLevel::CRITICAL,
'Throwable' => LogLevel::ERROR,
];
}
/**
* @return array<int, LogLevel::*>
*/
protected function defaultErrorLevelMap(): array
{
return [
E_ERROR => LogLevel::CRITICAL,
E_WARNING => LogLevel::WARNING,
E_PARSE => LogLevel::ALERT,
E_NOTICE => LogLevel::NOTICE,
E_CORE_ERROR => LogLevel::CRITICAL,
E_CORE_WARNING => LogLevel::WARNING,
E_COMPILE_ERROR => LogLevel::ALERT,
E_COMPILE_WARNING => LogLevel::WARNING,
E_USER_ERROR => LogLevel::ERROR,
E_USER_WARNING => LogLevel::WARNING,
E_USER_NOTICE => LogLevel::NOTICE,
2048 => LogLevel::NOTICE, // E_STRICT
E_RECOVERABLE_ERROR => LogLevel::ERROR,
E_DEPRECATED => LogLevel::NOTICE,
E_USER_DEPRECATED => LogLevel::NOTICE,
];
}
private function handleException(\Throwable $e): never
{
$level = LogLevel::ERROR;
foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) {
if ($e instanceof $class) {
$level = $candidate;
break;
}
}
$this->logger->log(
$level,
sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()),
['exception' => $e]
);
if (null !== $this->previousExceptionHandler) {
($this->previousExceptionHandler)($e);
}
if (!headers_sent() && \in_array(strtolower((string) \ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) {
http_response_code(500);
}
exit(255);
}
private function handleError(int $code, string $message, string $file = '', int $line = 0): bool
{
if ($this->handleOnlyReportedErrors && 0 === (error_reporting() & $code)) {
return false;
}
// fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
if (!$this->hasFatalErrorHandler || !\in_array($code, self::FATAL_ERRORS, true)) {
$level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL;
$this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]);
} else {
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
array_shift($trace); // Exclude handleError from trace
$this->lastFatalData = ['type' => $code, 'message' => $message, 'file' => $file, 'line' => $line, 'trace' => $trace];
}
if ($this->previousErrorHandler === true) {
return false;
}
if ($this->previousErrorHandler instanceof Closure) {
return (bool) ($this->previousErrorHandler)($code, $message, $file, $line);
}
return true;
}
/**
* @private
*/
public function handleFatalError(): void
{
$this->reservedMemory = '';
if (\is_array($this->lastFatalData)) {
$lastError = $this->lastFatalData;
} else {
$lastError = error_get_last();
}
if (\is_array($lastError) && \in_array($lastError['type'], self::FATAL_ERRORS, true)) {
$trace = $lastError['trace'] ?? null;
$this->logger->log(
$this->fatalLevel,
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace]
);
if ($this->logger instanceof Logger) {
foreach ($this->logger->getHandlers() as $handler) {
$handler->close();
}
}
}
}
private static function codeToString(int $code): string
{
return match ($code) {
E_ERROR => 'E_ERROR',
E_WARNING => 'E_WARNING',
E_PARSE => 'E_PARSE',
E_NOTICE => 'E_NOTICE',
E_CORE_ERROR => 'E_CORE_ERROR',
E_CORE_WARNING => 'E_CORE_WARNING',
E_COMPILE_ERROR => 'E_COMPILE_ERROR',
E_COMPILE_WARNING => 'E_COMPILE_WARNING',
E_USER_ERROR => 'E_USER_ERROR',
E_USER_WARNING => 'E_USER_WARNING',
E_USER_NOTICE => 'E_USER_NOTICE',
2048 => 'E_STRICT',
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
E_DEPRECATED => 'E_DEPRECATED',
E_USER_DEPRECATED => 'E_USER_DEPRECATED',
default => 'Unknown PHP error',
};
}
}
================================================
FILE: src/Monolog/Formatter/ChromePHPFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\LogRecord;
/**
* Formats a log message according to the ChromePHP array format
*
* @author Christophe Coevoet <stof@notk.org>
*/
class ChromePHPFormatter implements FormatterInterface
{
/**
* Translates Monolog log levels to Wildfire levels.
*
* @return 'log'|'info'|'warn'|'error'
*/
private function toWildfireLevel(Level $level): string
{
return match ($level) {
Level::Debug => 'log',
Level::Info => 'info',
Level::Notice => 'info',
Level::Warning => 'warn',
Level::Error => 'error',
Level::Critical => 'error',
Level::Alert => 'error',
Level::Emergency => 'error',
};
}
/**
* @inheritDoc
*/
public function format(LogRecord $record)
{
// Retrieve the line and file if set and remove them from the formatted extra
$backtrace = 'unknown';
if (isset($record->extra['file'], $record->extra['line'])) {
$backtrace = $record->extra['file'].' : '.$record->extra['line'];
unset($record->extra['file'], $record->extra['line']);
}
$message = ['message' => $record->message];
if (\count($record->context) > 0) {
$message['context'] = $record->context;
}
if (\count($record->extra) > 0) {
$message['extra'] = $record->extra;
}
if (\count($message) === 1) {
$message = reset($message);
}
return [
$record->channel,
$message,
$backtrace,
$this->toWildfireLevel($record->level),
];
}
/**
* @inheritDoc
*/
public function formatBatch(array $records)
{
$formatted = [];
foreach ($records as $record) {
$formatted[] = $this->format($record);
}
return $formatted;
}
}
================================================
FILE: src/Monolog/Formatter/ElasticaFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Elastica\Document;
use Monolog\LogRecord;
/**
* Format a log message into an Elastica Document
*
* @author Jelle Vink <jelle.vink@gmail.com>
*/
class ElasticaFormatter extends NormalizerFormatter
{
/**
* @var string Elastic search index name
*/
protected string $index;
/**
* @var string|null Elastic search document type
*/
protected string|null $type;
/**
* @param string $index Elastic Search index name
* @param ?string $type Elastic Search document type, deprecated as of Elastica 7
*/
public function __construct(string $index, ?string $type)
{
// elasticsearch requires a ISO 8601 format date with optional millisecond precision.
parent::__construct('Y-m-d\TH:i:s.uP');
$this->index = $index;
$this->type = $type;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record)
{
$record = parent::format($record);
return $this->getDocument($record);
}
public function getIndex(): string
{
return $this->index;
}
/**
* @deprecated since Elastica 7 type has no effect
*/
public function getType(): string
{
/** @phpstan-ignore-next-line */
return $this->type;
}
/**
* Convert a log message into an Elastica Document
*
* @param mixed[] $record
*/
protected function getDocument(array $record): Document
{
$document = new Document();
$document->setData($record);
$document->setIndex($this->index);
return $document;
}
}
================================================
FILE: src/Monolog/Formatter/ElasticsearchFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use DateTimeInterface;
use Monolog\LogRecord;
/**
* Format a log message into an Elasticsearch record
*
* @author Avtandil Kikabidze <akalongman@gmail.com>
*/
class ElasticsearchFormatter extends NormalizerFormatter
{
/**
* @var string Elasticsearch index name
*/
protected string $index;
/**
* @var string Elasticsearch record type
*/
protected string $type;
/**
* @param string $index Elasticsearch index name
* @param string $type Elasticsearch record type
*/
public function __construct(string $index, string $type)
{
// Elasticsearch requires an ISO 8601 format date with optional millisecond precision.
parent::__construct(DateTimeInterface::ATOM);
$this->index = $index;
$this->type = $type;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record)
{
$record = parent::format($record);
return $this->getDocument($record);
}
/**
* Getter index
*/
public function getIndex(): string
{
return $this->index;
}
/**
* Getter type
*/
public function getType(): string
{
return $this->type;
}
/**
* Convert a log message into an Elasticsearch record
*
* @param mixed[] $record Log message
* @return mixed[]
*/
protected function getDocument(array $record): array
{
$record['_index'] = $this->index;
$record['_type'] = $this->type;
return $record;
}
}
================================================
FILE: src/Monolog/Formatter/FlowdockFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* formats the record to be used in the FlowdockHandler
*
* @author Dominik Liebler <liebler.dominik@gmail.com>
* @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4
*/
class FlowdockFormatter implements FormatterInterface
{
private string $source;
private string $sourceEmail;
public function __construct(string $source, string $sourceEmail)
{
$this->source = $source;
$this->sourceEmail = $sourceEmail;
}
/**
* @inheritDoc
*
* @return mixed[]
*/
public function format(LogRecord $record): array
{
$tags = [
'#logs',
'#' . $record->level->toPsrLogLevel(),
'#' . $record->channel,
];
foreach ($record->extra as $value) {
$tags[] = '#' . $value;
}
$subject = sprintf(
'in %s: %s - %s',
$this->source,
$record->level->getName(),
$this->getShortMessage($record->message)
);
return [
'source' => $this->source,
'from_address' => $this->sourceEmail,
'subject' => $subject,
'content' => $record->message,
'tags' => $tags,
'project' => $this->source,
];
}
/**
* @inheritDoc
*
* @return mixed[][]
*/
public function formatBatch(array $records): array
{
$formatted = [];
foreach ($records as $record) {
$formatted[] = $this->format($record);
}
return $formatted;
}
public function getShortMessage(string $message): string
{
static $hasMbString;
if (null === $hasMbString) {
$hasMbString = \function_exists('mb_strlen');
}
$maxLength = 45;
if ($hasMbString) {
if (mb_strlen($message, 'UTF-8') > $maxLength) {
$message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
}
} else {
if (\strlen($message) > $maxLength) {
$message = substr($message, 0, $maxLength - 4) . ' ...';
}
}
return $message;
}
}
================================================
FILE: src/Monolog/Formatter/FluentdFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Class FluentdFormatter
*
* Serializes a log message to Fluentd unix socket protocol
*
* Fluentd config:
*
* <source>
* type unix
* path /var/run/td-agent/td-agent.sock
* </source>
*
* Monolog setup:
*
* $logger = new Monolog\Logger('fluent.tag');
* $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
* $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
* $logger->pushHandler($fluentHandler);
*
* @author Andrius Putna <fordnox@gmail.com>
*/
class FluentdFormatter implements FormatterInterface
{
/**
* @var bool $levelTag should message level be a part of the fluentd tag
*/
protected bool $levelTag = false;
public function __construct(bool $levelTag = false)
{
$this->levelTag = $levelTag;
}
public function isUsingLevelsInTag(): bool
{
return $this->levelTag;
}
public function format(LogRecord $record): string
{
$tag = $record->channel;
if ($this->levelTag) {
$tag .= '.' . $record->level->toPsrLogLevel();
}
$message = [
'message' => $record->message,
'context' => $record->context,
'extra' => $record->extra,
];
if (!$this->levelTag) {
$message['level'] = $record->level->value;
$message['level_name'] = $record->level->getName();
}
return Utils::jsonEncode([$tag, $record->datetime->getTimestamp(), $message]);
}
public function formatBatch(array $records): string
{
$message = '';
foreach ($records as $record) {
$message .= $this->format($record);
}
return $message;
}
}
================================================
FILE: src/Monolog/Formatter/FormatterInterface.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Interface for formatters
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
interface FormatterInterface
{
/**
* Formats a log record.
*
* @param LogRecord $record A record to format
* @return mixed The formatted record
*/
public function format(LogRecord $record);
/**
* Formats a set of log records.
*
* @param array<LogRecord> $records A set of records to format
* @return mixed The formatted set of records
*/
public function formatBatch(array $records);
}
================================================
FILE: src/Monolog/Formatter/GelfMessageFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Level;
use Gelf\Message;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Serializes a log message to GELF
* @see http://docs.graylog.org/en/latest/pages/gelf.html
*
* @author Matt Lehner <mlehner@gmail.com>
*/
class GelfMessageFormatter extends NormalizerFormatter
{
protected const DEFAULT_MAX_LENGTH = 32766;
/**
* @var string the name of the system for the Gelf log message
*/
protected string $systemName;
/**
* @var string a prefix for 'extra' fields from the Monolog record (optional)
*/
protected string $extraPrefix;
/**
* @var string a prefix for 'context' fields from the Monolog record (optional)
*/
protected string $contextPrefix;
/**
* @var int max length per field
*/
protected int $maxLength;
/**
* Translates Monolog log levels to Graylog2 log priorities.
*/
private function getGraylog2Priority(Level $level): int
{
return match ($level) {
Level::Debug => 7,
Level::Info => 6,
Level::Notice => 5,
Level::Warning => 4,
Level::Error => 3,
Level::Critical => 2,
Level::Alert => 1,
Level::Emergency => 0,
};
}
/**
* @throws \RuntimeException
*/
public function __construct(?string $systemName = null, ?string $extraPrefix = null, string $contextPrefix = 'ctxt_', ?int $maxLength = null)
{
if (!class_exists(Message::class)) {
throw new \RuntimeException('Composer package graylog2/gelf-php is required to use Monolog\'s GelfMessageFormatter');
}
parent::__construct('U.u');
$this->systemName = (null === $systemName || $systemName === '') ? (string) gethostname() : $systemName;
$this->extraPrefix = null === $extraPrefix ? '' : $extraPrefix;
$this->contextPrefix = $contextPrefix;
$this->maxLength = null === $maxLength ? self::DEFAULT_MAX_LENGTH : $maxLength;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record): Message
{
$context = $extra = [];
if (isset($record->context)) {
/** @var array<array<mixed>|bool|float|int|string|null> $context */
$context = parent::normalize($record->context);
}
if (isset($record->extra)) {
/** @var array<array<mixed>|bool|float|int|string|null> $extra */
$extra = parent::normalize($record->extra);
}
$message = new Message();
$message
->setTimestamp($record->datetime)
->setShortMessage($record->message)
->setHost($this->systemName)
->setLevel($this->getGraylog2Priority($record->level));
// message length + system name length + 200 for padding / metadata
$len = 200 + \strlen($record->message) + \strlen($this->systemName);
if ($len > $this->maxLength) {
$message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength));
}
if (isset($record->channel)) {
$message->setAdditional('facility', $record->channel);
}
foreach ($extra as $key => $val) {
$key = (string) preg_replace('#[^\w.-]#', '-', (string) $key);
$val = \is_bool($val) ? ($val ? 1 : 0) : $val;
$val = \is_scalar($val) || null === $val ? $val : $this->toJson($val);
$len = \strlen($this->extraPrefix . $key . $val);
if ($len > $this->maxLength) {
$message->setAdditional($this->extraPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength));
continue;
}
$message->setAdditional($this->extraPrefix . $key, $val);
}
foreach ($context as $key => $val) {
$key = (string) preg_replace('#[^\w.-]#', '-', (string) $key);
$val = \is_bool($val) ? ($val ? 1 : 0) : $val;
$val = \is_scalar($val) || null === $val ? $val : $this->toJson($val);
$len = \strlen($this->contextPrefix . $key . $val);
if ($len > $this->maxLength) {
$message->setAdditional($this->contextPrefix . $key, Utils::substr((string) $val, 0, $this->maxLength));
continue;
}
$message->setAdditional($this->contextPrefix . $key, $val);
}
if (!$message->hasAdditional('file') && isset($context['exception']['file'])) {
if (1 === preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) {
$message->setAdditional('file', $matches[1]);
$message->setAdditional('line', $matches[2]);
}
}
return $message;
}
}
================================================
FILE: src/Monolog/Formatter/GoogleCloudLoggingFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use DateTimeInterface;
use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Cloud logging.
*
* @see https://cloud.google.com/logging/docs/structured-logging
* @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
*
* @author Luís Cobucci <lcobucci@gmail.com>
*/
class GoogleCloudLoggingFormatter extends JsonFormatter
{
protected function normalizeRecord(LogRecord $record): array
{
$normalized = parent::normalizeRecord($record);
// Re-key level for GCP logging
$normalized['severity'] = $normalized['level_name'];
$normalized['time'] = $record->datetime->format(DateTimeInterface::RFC3339_EXTENDED);
// Remove keys that are not used by GCP
unset($normalized['level'], $normalized['level_name'], $normalized['datetime']);
return $normalized;
}
}
================================================
FILE: src/Monolog/Formatter/HtmlFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Level;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats incoming records into an HTML table
*
* This is especially useful for html email logging
*
* @author Tiago Brito <tlfbrito@gmail.com>
*/
class HtmlFormatter extends NormalizerFormatter
{
/**
* Translates Monolog log levels to html color priorities.
*/
protected function getLevelColor(Level $level): string
{
return match ($level) {
Level::Debug => '#CCCCCC',
Level::Info => '#28A745',
Level::Notice => '#17A2B8',
Level::Warning => '#FFC107',
Level::Error => '#FD7E14',
Level::Critical => '#DC3545',
Level::Alert => '#821722',
Level::Emergency => '#000000',
};
}
/**
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
*/
public function __construct(?string $dateFormat = null)
{
parent::__construct($dateFormat);
}
/**
* Creates an HTML table row
*
* @param string $th Row header content
* @param string $td Row standard cell content
* @param bool $escapeTd false if td content must not be html escaped
*/
protected function addRow(string $th, string $td = ' ', bool $escapeTd = true): string
{
$th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8');
if ($escapeTd) {
$td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>';
}
return "<tr style=\"padding: 4px;text-align: left;\">\n<th style=\"vertical-align: top;background: #ccc;color: #000\" width=\"100\">$th:</th>\n<td style=\"padding: 4px;text-align: left;vertical-align: top;background: #eee;color: #000\">".$td."</td>\n</tr>";
}
/**
* Create a HTML h1 tag
*
* @param string $title Text to be in the h1
*/
protected function addTitle(string $title, Level $level): string
{
$title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
return '<h1 style="background: '.$this->getLevelColor($level).';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
}
/**
* Formats a log record.
*
* @return string The formatted record
*/
public function format(LogRecord $record): string
{
$output = $this->addTitle($record->level->getName(), $record->level);
$output .= '<table cellspacing="1" width="100%" class="monolog-output">';
$output .= $this->addRow('Message', $record->message);
$output .= $this->addRow('Time', $this->formatDate($record->datetime));
$output .= $this->addRow('Channel', $record->channel);
if (\count($record->context) > 0) {
$embeddedTable = '<table cellspacing="1" width="100%">';
foreach ($record->context as $key => $value) {
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
}
$embeddedTable .= '</table>';
$output .= $this->addRow('Context', $embeddedTable, false);
}
if (\count($record->extra) > 0) {
$embeddedTable = '<table cellspacing="1" width="100%">';
foreach ($record->extra as $key => $value) {
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
}
$embeddedTable .= '</table>';
$output .= $this->addRow('Extra', $embeddedTable, false);
}
return $output.'</table>';
}
/**
* Formats a set of log records.
*
* @return string The formatted set of records
*/
public function formatBatch(array $records): string
{
$message = '';
foreach ($records as $record) {
$message .= $this->format($record);
}
return $message;
}
/**
* @param mixed $data
*/
protected function convertToString($data): string
{
if (null === $data || \is_scalar($data)) {
return (string) $data;
}
$data = $this->normalize($data);
return Utils::jsonEncode($data, JSON_PRETTY_PRINT | Utils::DEFAULT_JSON_FLAGS, true);
}
}
================================================
FILE: src/Monolog/Formatter/JsonFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Stringable;
use Throwable;
use Monolog\LogRecord;
/**
* Encodes whatever record data is passed to it as json
*
* This can be useful to log to databases or remote APIs
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class JsonFormatter extends NormalizerFormatter
{
public const BATCH_MODE_JSON = 1;
public const BATCH_MODE_NEWLINES = 2;
/** @var self::BATCH_MODE_* */
protected int $batchMode;
protected bool $appendNewline;
protected bool $ignoreEmptyContextAndExtra;
protected bool $includeStacktraces = false;
/**
* @param self::BATCH_MODE_* $batchMode
*/
public function __construct(int $batchMode = self::BATCH_MODE_JSON, bool $appendNewline = true, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false)
{
$this->batchMode = $batchMode;
$this->appendNewline = $appendNewline;
$this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
$this->includeStacktraces = $includeStacktraces;
parent::__construct();
}
/**
* The batch mode option configures the formatting style for
* multiple records. By default, multiple records will be
* formatted as a JSON-encoded array. However, for
* compatibility with some API endpoints, alternative styles
* are available.
*/
public function getBatchMode(): int
{
return $this->batchMode;
}
/**
* True if newlines are appended to every formatted record
*/
public function isAppendingNewlines(): bool
{
return $this->appendNewline;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record): string
{
$normalized = $this->normalizeRecord($record);
return $this->toJson($normalized, true) . ($this->appendNewline ? "\n" : '');
}
/**
* @inheritDoc
*/
public function formatBatch(array $records): string
{
return match ($this->batchMode) {
static::BATCH_MODE_NEWLINES => $this->formatBatchNewlines($records),
default => $this->formatBatchJson($records),
};
}
/**
* @return $this
*/
public function includeStacktraces(bool $include = true): self
{
$this->includeStacktraces = $include;
return $this;
}
/**
* @return array<array<mixed>|bool|float|int|\stdClass|string|null>
*/
protected function normalizeRecord(LogRecord $record): array
{
$normalized = parent::normalizeRecord($record);
if (isset($normalized['context']) && $normalized['context'] === []) {
if ($this->ignoreEmptyContextAndExtra) {
unset($normalized['context']);
} else {
$normalized['context'] = new \stdClass;
}
}
if (isset($normalized['extra']) && $normalized['extra'] === []) {
if ($this->ignoreEmptyContextAndExtra) {
unset($normalized['extra']);
} else {
$normalized['extra'] = new \stdClass;
}
}
return $normalized;
}
/**
* Return a JSON-encoded array of records.
*
* @phpstan-param LogRecord[] $records
*/
protected function formatBatchJson(array $records): string
{
$formatted = array_map(fn (LogRecord $record) => $this->normalizeRecord($record), $records);
return $this->toJson($formatted, true);
}
/**
* Use new lines to separate records instead of a
* JSON-encoded array.
*
* @phpstan-param LogRecord[] $records
*/
protected function formatBatchNewlines(array $records): string
{
$oldNewline = $this->appendNewline;
$this->appendNewline = false;
$formatted = array_map(fn (LogRecord $record) => $this->format($record), $records);
$this->appendNewline = $oldNewline;
return implode("\n", $formatted);
}
/**
* Normalizes given $data.
*
* @return null|scalar|array<mixed[]|scalar|null|object>|object
*/
protected function normalize(mixed $data, int $depth = 0): mixed
{
if ($depth > $this->maxNormalizeDepth) {
return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization';
}
if (\is_array($data)) {
$normalized = [];
$count = 1;
foreach ($data as $key => $value) {
if ($count++ > $this->maxNormalizeItemCount) {
$normalized['...'] = 'Over '.$this->maxNormalizeItemCount.' items ('.\count($data).' total), aborting normalization';
break;
}
$normalized[$key] = $this->normalize($value, $depth + 1);
}
return $normalized;
}
if (\is_object($data)) {
if ($data instanceof \DateTimeInterface) {
return $this->formatDate($data);
}
if ($data instanceof Throwable) {
return $this->normalizeException($data, $depth);
}
// if the object has specific json serializability we want to make sure we skip the __toString treatment below
if ($data instanceof \JsonSerializable) {
return $data;
}
if ($data instanceof Stringable) {
try {
return $data->__toString();
} catch (Throwable) {
return $data::class;
}
}
if (\get_class($data) === '__PHP_Incomplete_Class') {
return new \ArrayObject($data);
}
return $data;
}
if (\is_resource($data)) {
return parent::normalize($data);
}
return $data;
}
/**
* Normalizes given exception with or without its own stack trace based on
* `includeStacktraces` property.
*
* @return array<array-key, string|int|array<string|int|array<string>>>
*/
protected function normalizeException(Throwable $e, int $depth = 0): array
{
$data = parent::normalizeException($e, $depth);
if (!$this->includeStacktraces) {
unset($data['trace']);
}
return $data;
}
}
================================================
FILE: src/Monolog/Formatter/LineFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Closure;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats incoming records into a one-line string
*
* This is especially useful for logging to files
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @author Christophe Coevoet <stof@notk.org>
*/
class LineFormatter extends NormalizerFormatter
{
public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
protected string $format;
protected bool $allowInlineLineBreaks;
protected bool $ignoreEmptyContextAndExtra;
protected bool $includeStacktraces;
protected ?int $maxLevelNameLength = null;
protected string $indentStacktraces = '';
protected Closure|null $stacktracesParser = null;
protected string $basePath = '';
/**
* @param string|null $format The format of the message
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
*/
public function __construct(?string $format = null, ?string $dateFormat = null, bool $allowInlineLineBreaks = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false)
{
$this->format = $format === null ? static::SIMPLE_FORMAT : $format;
$this->allowInlineLineBreaks = $allowInlineLineBreaks;
$this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
$this->includeStacktraces($includeStacktraces);
parent::__construct($dateFormat);
}
/**
* Setting a base path will hide the base path from exception and stack trace file names to shorten them
* @return $this
*/
public function setBasePath(string $path = ''): self
{
if ($path !== '') {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}
$this->basePath = $path;
return $this;
}
/**
* @return $this
*/
public function includeStacktraces(bool $include = true, ?Closure $parser = null): self
{
$this->includeStacktraces = $include;
if ($this->includeStacktraces) {
$this->allowInlineLineBreaks = true;
$this->stacktracesParser = $parser;
}
return $this;
}
/**
* Indent stack traces to separate them a bit from the main log record messages
*
* @param string $indent The string used to indent, for example " "
* @return $this
*/
public function indentStacktraces(string $indent): self
{
$this->indentStacktraces = $indent;
return $this;
}
/**
* @return $this
*/
public function allowInlineLineBreaks(bool $allow = true): self
{
$this->allowInlineLineBreaks = $allow;
return $this;
}
/**
* @return $this
*/
public function ignoreEmptyContextAndExtra(bool $ignore = true): self
{
$this->ignoreEmptyContextAndExtra = $ignore;
return $this;
}
/**
* Allows cutting the level name to get fixed-length levels like INF for INFO, ERR for ERROR if you set this to 3 for example
*
* @param int|null $maxLevelNameLength Maximum characters for the level name. Set null for infinite length (default)
* @return $this
*/
public function setMaxLevelNameLength(?int $maxLevelNameLength = null): self
{
$this->maxLevelNameLength = $maxLevelNameLength;
return $this;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record): string
{
$vars = parent::format($record);
if ($this->maxLevelNameLength !== null) {
$vars['level_name'] = substr($vars['level_name'], 0, $this->maxLevelNameLength);
}
$output = $this->format;
foreach ($vars['extra'] as $var => $val) {
if (false !== strpos($output, '%extra.'.$var.'%')) {
$output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
unset($vars['extra'][$var]);
}
}
foreach ($vars['context'] as $var => $val) {
if (false !== strpos($output, '%context.'.$var.'%')) {
$output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);
unset($vars['context'][$var]);
}
}
if ($this->ignoreEmptyContextAndExtra) {
if (\count($vars['context']) === 0) {
unset($vars['context']);
$output = str_replace('%context%', '', $output);
}
if (\count($vars['extra']) === 0) {
unset($vars['extra']);
$output = str_replace('%extra%', '', $output);
}
}
foreach ($vars as $var => $val) {
if (false !== strpos($output, '%'.$var.'%')) {
$output = str_replace('%'.$var.'%', $this->stringify($val), $output);
}
}
// remove leftover %extra.xxx% and %context.xxx% if any
if (false !== strpos($output, '%')) {
$output = preg_replace('/%(?:extra|context)\..+?%/', '', $output);
if (null === $output) {
$pcreErrorCode = preg_last_error();
throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . preg_last_error_msg());
}
}
return $output;
}
public function formatBatch(array $records): string
{
$message = '';
foreach ($records as $record) {
$message .= $this->format($record);
}
return $message;
}
/**
* @param mixed $value
*/
public function stringify($value): string
{
return $this->replaceNewlines($this->convertToString($value));
}
protected function normalizeException(\Throwable $e, int $depth = 0): string
{
$str = $this->formatException($e);
$previous = $e->getPrevious();
while ($previous instanceof \Throwable) {
$depth++;
if ($depth > $this->maxNormalizeDepth) {
$str .= "\n[previous exception] Over " . $this->maxNormalizeDepth . ' levels deep, aborting normalization';
break;
}
$str .= "\n[previous exception] " . $this->formatException($previous);
$previous = $previous->getPrevious();
}
return $str;
}
/**
* @param mixed $data
*/
protected function convertToString($data): string
{
if (null === $data || \is_bool($data)) {
return var_export($data, true);
}
if (\is_scalar($data)) {
return (string) $data;
}
return $this->toJson($data, true);
}
protected function replaceNewlines(string $str): string
{
if ($this->allowInlineLineBreaks) {
if (0 === strpos($str, '{') || 0 === strpos($str, '[')) {
$str = preg_replace('/(?<!\\\\)\\\\[rn]/', "\n", $str);
if (null === $str) {
$pcreErrorCode = preg_last_error();
throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . preg_last_error_msg());
}
}
return $str;
}
return str_replace(["\r\n", "\r", "\n"], ' ', $str);
}
private function formatException(\Throwable $e): string
{
$str = '[object] (' . Utils::getClass($e) . '(code: ' . $e->getCode();
if ($e instanceof \SoapFault) {
if (isset($e->faultcode)) {
$str .= ' faultcode: ' . $e->faultcode;
}
if (isset($e->faultactor)) {
$str .= ' faultactor: ' . $e->faultactor;
}
if (isset($e->detail)) {
if (\is_string($e->detail)) {
$str .= ' detail: ' . $e->detail;
} elseif (\is_object($e->detail) || \is_array($e->detail)) {
$str .= ' detail: ' . $this->toJson($e->detail, true);
}
}
}
$file = $e->getFile();
if ($this->basePath !== '') {
$file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file);
}
$str .= '): ' . $e->getMessage() . ' at ' . strtr((string) $file, DIRECTORY_SEPARATOR, '/') . ':' . $e->getLine() . ')';
if ($this->includeStacktraces) {
$str .= $this->stacktracesParser($e);
}
return $str;
}
private function stacktracesParser(\Throwable $e): string
{
$trace = $e->getTraceAsString();
if ($this->basePath !== '') {
$trace = preg_replace('{^(#\d+ )' . preg_quote($this->basePath) . '}m', '$1', $trace) ?? $trace;
}
if ($this->stacktracesParser !== null) {
$trace = $this->stacktracesParserCustom($trace);
}
if ($this->indentStacktraces !== '') {
$trace = str_replace("\n", "\n{$this->indentStacktraces}", $trace);
}
if (trim($trace) === '') {
return '';
}
return "\n{$this->indentStacktraces}[stacktrace]\n{$this->indentStacktraces}" . strtr($trace, DIRECTORY_SEPARATOR, '/') . "\n";
}
private function stacktracesParserCustom(string $trace): string
{
return implode("\n", array_filter(array_map($this->stacktracesParser, explode("\n", $trace)), fn ($line) => is_string($line) && trim($line) !== ''));
}
}
================================================
FILE: src/Monolog/Formatter/LogglyFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Loggly.
*
* @author Adam Pancutt <adam@pancutt.com>
*/
class LogglyFormatter extends JsonFormatter
{
/**
* Overrides the default batch mode to new lines for compatibility with the
* Loggly bulk API.
*/
public function __construct(int $batchMode = self::BATCH_MODE_NEWLINES, bool $appendNewline = false)
{
parent::__construct($batchMode, $appendNewline);
}
/**
* Appends the 'timestamp' parameter for indexing by Loggly.
*
* @see https://www.loggly.com/docs/automated-parsing/#json
* @see \Monolog\Formatter\JsonFormatter::format()
*/
protected function normalizeRecord(LogRecord $record): array
{
$recordData = parent::normalizeRecord($record);
$recordData["timestamp"] = $record->datetime->format("Y-m-d\TH:i:s.uO");
unset($recordData["datetime"]);
return $recordData;
}
}
================================================
FILE: src/Monolog/Formatter/LogmaticFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Encodes message information into JSON in a format compatible with Logmatic.
*
* @author Julien Breux <julien.breux@gmail.com>
*/
class LogmaticFormatter extends JsonFormatter
{
protected const MARKERS = ["sourcecode", "php"];
protected string $hostname = '';
protected string $appName = '';
/**
* @return $this
*/
public function setHostname(string $hostname): self
{
$this->hostname = $hostname;
return $this;
}
/**
* @return $this
*/
public function setAppName(string $appName): self
{
$this->appName = $appName;
return $this;
}
/**
* Appends the 'hostname' and 'appname' parameter for indexing by Logmatic.
*
* @see http://doc.logmatic.io/docs/basics-to-send-data
* @see \Monolog\Formatter\JsonFormatter::format()
*/
public function normalizeRecord(LogRecord $record): array
{
$record = parent::normalizeRecord($record);
if ($this->hostname !== '') {
$record["hostname"] = $this->hostname;
}
if ($this->appName !== '') {
$record["appname"] = $this->appName;
}
$record["@marker"] = static::MARKERS;
return $record;
}
}
================================================
FILE: src/Monolog/Formatter/LogstashFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\LogRecord;
/**
* Serializes a log message to Logstash Event Format
*
* @see https://www.elastic.co/products/logstash
* @see https://github.com/elastic/logstash/blob/master/logstash-core/src/main/java/org/logstash/Event.java
*
* @author Tim Mower <timothy.mower@gmail.com>
*/
class LogstashFormatter extends NormalizerFormatter
{
/**
* @var string the name of the system for the Logstash log message, used to fill the @source field
*/
protected string $systemName;
/**
* @var string an application name for the Logstash log message, used to fill the @type field
*/
protected string $applicationName;
/**
* @var string the key for 'extra' fields from the Monolog record
*/
protected string $extraKey;
/**
* @var string the key for 'context' fields from the Monolog record
*/
protected string $contextKey;
/**
* @param string $applicationName The application that sends the data, used as the "type" field of logstash
* @param string|null $systemName The system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
* @param string $extraKey The key for extra keys inside logstash "fields", defaults to extra
* @param string $contextKey The key for context keys inside logstash "fields", defaults to context
*/
public function __construct(string $applicationName, ?string $systemName = null, string $extraKey = 'extra', string $contextKey = 'context')
{
// logstash requires a ISO 8601 format date with optional millisecond precision.
parent::__construct('Y-m-d\TH:i:s.uP');
$this->systemName = $systemName === null ? (string) gethostname() : $systemName;
$this->applicationName = $applicationName;
$this->extraKey = $extraKey;
$this->contextKey = $contextKey;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record): string
{
$recordData = parent::format($record);
$message = [
'@timestamp' => $recordData['datetime'],
'@version' => 1,
'host' => $this->systemName,
];
if (isset($recordData['message'])) {
$message['message'] = $recordData['message'];
}
if (isset($recordData['channel'])) {
$message['type'] = $recordData['channel'];
$message['channel'] = $recordData['channel'];
}
if (isset($recordData['level_name'])) {
$message['level'] = $recordData['level_name'];
}
if (isset($recordData['level'])) {
$message['monolog_level'] = $recordData['level'];
}
if ('' !== $this->applicationName) {
$message['type'] = $this->applicationName;
}
if (\count($recordData['extra']) > 0) {
$message[$this->extraKey] = $recordData['extra'];
}
if (\count($recordData['context']) > 0) {
$message[$this->contextKey] = $recordData['context'];
}
return $this->toJson($message) . "\n";
}
}
================================================
FILE: src/Monolog/Formatter/MongoDBFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use MongoDB\BSON\Type;
use MongoDB\BSON\UTCDateTime;
use Monolog\Utils;
use Monolog\LogRecord;
/**
* Formats a record for use with the MongoDBHandler.
*
* @author Florian Plattner <me@florianplattner.de>
*/
class MongoDBFormatter implements FormatterInterface
{
private bool $exceptionTraceAsString;
private int $maxNestingLevel;
/**
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record->context is 2
* @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
*/
public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true)
{
$this->maxNestingLevel = max($maxNestingLevel, 0);
$this->exceptionTraceAsString = $exceptionTraceAsString;
}
/**
* @inheritDoc
*
* @return mixed[]
*/
public function format(LogRecord $record): array
{
/** @var mixed[] $res */
$res = $this->formatArray($record->toArray());
return $res;
}
/**
* @inheritDoc
*
* @return array<mixed[]>
*/
public function formatBatch(array $records): array
{
$formatted = [];
foreach ($records as $key => $record) {
$formatted[$key] = $this->format($record);
}
return $formatted;
}
/**
* @param mixed[] $array
* @return mixed[]|string Array except when max nesting level is reached then a string "[...]"
*/
protected function formatArray(array $array, int $nestingLevel = 0)
{
if ($this->maxNestingLevel > 0 && $nestingLevel > $this->maxNestingLevel) {
return '[...]';
}
foreach ($array as $name => $value) {
if ($value instanceof \DateTimeInterface) {
$array[$name] = $this->formatDate($value, $nestingLevel + 1);
} elseif ($value instanceof \Throwable) {
$array[$name] = $this->formatException($value, $nestingLevel + 1);
} elseif (\is_array($value)) {
$array[$name] = $this->formatArray($value, $nestingLevel + 1);
} elseif (\is_object($value) && !$value instanceof Type) {
$array[$name] = $this->formatObject($value, $nestingLevel + 1);
}
}
return $array;
}
/**
* @param mixed $value
* @return mixed[]|string
*/
protected function formatObject($value, int $nestingLevel)
{
$objectVars = get_object_vars($value);
$objectVars['class'] = Utils::getClass($value);
return $this->formatArray($objectVars, $nestingLevel);
}
/**
* @return mixed[]|string
*/
protected function formatException(\Throwable $exception, int $nestingLevel)
{
$formattedException = [
'class' => Utils::getClass($exception),
'message' => $exception->getMessage(),
'code' => (int) $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
];
if ($this->exceptionTraceAsString === true) {
$formattedException['trace'] = $exception->getTraceAsString();
} else {
$formattedException['trace'] = $exception->getTrace();
}
return $this->formatArray($formattedException, $nestingLevel);
}
protected function formatDate(\DateTimeInterface $value, int $nestingLevel): UTCDateTime
{
return new UTCDateTime((int) floor(((float) $value->format('U.u')) * 1000));
}
}
================================================
FILE: src/Monolog/Formatter/NormalizerFormatter.php
================================================
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\JsonSerializableDateTimeImmutable;
use Monolog\Utils;
use Throwable;
use Monolog\LogRecord;
/**
* Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class NormalizerFormatter implements FormatterInterface
{
public const SIMPLE_DATE = "Y-m-d\TH:i:sP";
protected string $dateFormat;
protected int $maxNormalizeDepth = 9;
protected int $maxNormalizeItemCount = 1000;
protected ?int $maxTraceLength = null;
private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS;
protected string $basePath = '';
/**
* @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
*/
public function __construct(?string $dateFormat = null)
{
$this->dateFormat = null === $dateFormat ? static::SIMPLE_DATE : $dateFormat;
}
/**
* @inheritDoc
*/
public function format(LogRecord $record)
{
return $this->normalizeRecord($record);
}
/**
* Normalize an arbitrary value to a scalar|array|null
*
* @return null|scalar|array<mixed[]|scalar|null>
*/
public function normalizeValue(mixed $data): mixed
{
return $this->normalize($data);
}
/**
* @inheritDoc
*/
public function formatBatch(array $records)
{
foreach ($records as $key => $record) {
$records[$key] = $this->format($record);
}
return $records;
}
public function getDateFormat(): string
{
return $this->dateFormat;
}
/**
* @return $this
*/
public function setDateFormat(string $dateFormat): self
{
$this->dateFormat = $dateFormat;
return $this;
}
/**
* The maximum number of normalization levels to go through
*/
public function getMaxNormalizeDepth(): int
{
return $this->maxNormalizeDepth;
}
/**
* @return $this
*/
public function setMaxNormalizeDepth(int $maxNormalizeDepth): self
{
$this->maxNormalizeDepth = $maxNormalizeDepth;
return $this;
}
/**
* The maximum number of items to normalize per level
*/
public function getMaxNormalizeItemCount(): int
{
return $this->maxNormalizeItemCount;
}
/**
* @return $this
*/
public function setMaxNormalizeItemCount(int $maxNormalizeItemCount): self
{
$this->maxNormalizeItemCount = $maxNormalizeItemCount;
return $this;
}
/**
* The maximum number of stack trace frames to include
*/
public function getMaxTraceLength(): ?int
{
return $this->maxTraceLength;
}
/**
* @return $this
*/
public function setMaxTraceLength(?int $maxTraceLength): self
{
$this->maxTraceLength = $maxTraceLength;
return $this;
}
/**
* Enables `json_encode` pretty print.
*
* @return $this
*/
public function setJsonPrettyPrint(bool $enable): self
{
if ($enable) {
$this->jsonEncodeOptions |= JSON_PRETTY_PRINT;
} else {
$this->jsonEncodeOptions &= ~JSON_PRETTY_PRINT;
}
return $this;
}
/**
* Setting a base path will hide the base path from exception and stack trace file names to shorten them
* @return $this
*/
public function setBasePath(string $path = ''): self
{
if ($path !== '') {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
}
$this->basePath = $path;
return $this;
}
/**
* Provided as extension point
*
* Because normalize is called with sub-values of context data etc, normalizeRecord can be
* extended when data needs to be appended on the record array but not to other normalized data.
*
* @return array<mixed[]|scalar|null>
*/
protected function normalizeRecord(LogRecord $record): array
{
/** @var array<mixed[]|scalar|null> $normalized */
$normalized = $this->normalize($record->toArray());
return $normalized;
}
/**
* @return null|scalar|array<mixed[]|scalar|null>
*/
protected function normalize(mixed $data, int $depth = 0): mixed
{
if ($depth > $this->maxNormalizeDepth) {
return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization';
}
if (null === $data || \is_scalar($data)) {
if (\is_float($data)) {
if (is_infinite($data)) {
return ($data > 0 ? '' : '-') . 'INF';
}
if (is_nan($data)) {
return 'NaN';
}
}
return $data;
}
if (\is_array($data)) {
$normalized = [];
$count = 1;
foreach ($data as $key => $value) {
if ($count++ > $this->maxNormalizeItemCount) {
$normalized['...'] = 'Over
gitextract_dblqzcyu/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── Bug_Report.md
│ │ ├── Feature.md
│ │ └── Question.md
│ ├── SECURITY.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── continuous-integration.yml
│ ├── lint.yml
│ └── phpstan.yml
├── .gitignore
├── .php-cs-fixer.php
├── CHANGELOG.md
├── LICENSE
├── README.md
├── UPGRADE.md
├── _config.yml
├── composer.json
├── doc/
│ ├── 01-usage.md
│ ├── 02-handlers-formatters-processors.md
│ ├── 03-utilities.md
│ ├── 04-extending.md
│ ├── message-structure.md
│ └── sockets.md
├── phpstan-baseline-8.2.neon
├── phpstan-baseline.neon
├── phpstan-ignore-by-php-version.neon.php
├── phpstan.neon.dist
├── phpunit.xml.dist
├── src/
│ └── Monolog/
│ ├── Attribute/
│ │ ├── AsMonologProcessor.php
│ │ └── WithMonologChannel.php
│ ├── DateTimeImmutable.php
│ ├── ErrorHandler.php
│ ├── Formatter/
│ │ ├── ChromePHPFormatter.php
│ │ ├── ElasticaFormatter.php
│ │ ├── ElasticsearchFormatter.php
│ │ ├── FlowdockFormatter.php
│ │ ├── FluentdFormatter.php
│ │ ├── FormatterInterface.php
│ │ ├── GelfMessageFormatter.php
│ │ ├── GoogleCloudLoggingFormatter.php
│ │ ├── HtmlFormatter.php
│ │ ├── JsonFormatter.php
│ │ ├── LineFormatter.php
│ │ ├── LogglyFormatter.php
│ │ ├── LogmaticFormatter.php
│ │ ├── LogstashFormatter.php
│ │ ├── MongoDBFormatter.php
│ │ ├── NormalizerFormatter.php
│ │ ├── ScalarFormatter.php
│ │ ├── SyslogFormatter.php
│ │ └── WildfireFormatter.php
│ ├── Handler/
│ │ ├── AbstractHandler.php
│ │ ├── AbstractProcessingHandler.php
│ │ ├── AbstractSyslogHandler.php
│ │ ├── AmqpHandler.php
│ │ ├── BrowserConsoleHandler.php
│ │ ├── BufferHandler.php
│ │ ├── ChromePHPHandler.php
│ │ ├── CouchDBHandler.php
│ │ ├── CubeHandler.php
│ │ ├── Curl/
│ │ │ └── Util.php
│ │ ├── DeduplicationHandler.php
│ │ ├── DoctrineCouchDBHandler.php
│ │ ├── DynamoDbHandler.php
│ │ ├── ElasticaHandler.php
│ │ ├── ElasticsearchHandler.php
│ │ ├── ErrorLogHandler.php
│ │ ├── FallbackGroupHandler.php
│ │ ├── FilterHandler.php
│ │ ├── FingersCrossed/
│ │ │ ├── ActivationStrategyInterface.php
│ │ │ ├── ChannelLevelActivationStrategy.php
│ │ │ └── ErrorLevelActivationStrategy.php
│ │ ├── FingersCrossedHandler.php
│ │ ├── FirePHPHandler.php
│ │ ├── FleepHookHandler.php
│ │ ├── FlowdockHandler.php
│ │ ├── FormattableHandlerInterface.php
│ │ ├── FormattableHandlerTrait.php
│ │ ├── GelfHandler.php
│ │ ├── GroupHandler.php
│ │ ├── Handler.php
│ │ ├── HandlerInterface.php
│ │ ├── HandlerWrapper.php
│ │ ├── IFTTTHandler.php
│ │ ├── InsightOpsHandler.php
│ │ ├── LogEntriesHandler.php
│ │ ├── LogglyHandler.php
│ │ ├── LogmaticHandler.php
│ │ ├── MailHandler.php
│ │ ├── MandrillHandler.php
│ │ ├── MissingExtensionException.php
│ │ ├── MongoDBHandler.php
│ │ ├── NativeMailerHandler.php
│ │ ├── NewRelicHandler.php
│ │ ├── NoopHandler.php
│ │ ├── NullHandler.php
│ │ ├── OverflowHandler.php
│ │ ├── PHPConsoleHandler.php
│ │ ├── ProcessHandler.php
│ │ ├── ProcessableHandlerInterface.php
│ │ ├── ProcessableHandlerTrait.php
│ │ ├── PsrHandler.php
│ │ ├── PushoverHandler.php
│ │ ├── RedisHandler.php
│ │ ├── RedisPubSubHandler.php
│ │ ├── RollbarHandler.php
│ │ ├── RotatingFileHandler.php
│ │ ├── SamplingHandler.php
│ │ ├── SendGridHandler.php
│ │ ├── Slack/
│ │ │ └── SlackRecord.php
│ │ ├── SlackHandler.php
│ │ ├── SlackWebhookHandler.php
│ │ ├── SocketHandler.php
│ │ ├── SqsHandler.php
│ │ ├── StreamHandler.php
│ │ ├── SymfonyMailerHandler.php
│ │ ├── SyslogHandler.php
│ │ ├── SyslogUdp/
│ │ │ └── UdpSocket.php
│ │ ├── SyslogUdpHandler.php
│ │ ├── TelegramBotHandler.php
│ │ ├── TestHandler.php
│ │ ├── WebRequestRecognizerTrait.php
│ │ ├── WhatFailureGroupHandler.php
│ │ └── ZendMonitorHandler.php
│ ├── JsonSerializableDateTimeImmutable.php
│ ├── Level.php
│ ├── LogRecord.php
│ ├── Logger.php
│ ├── Processor/
│ │ ├── ClosureContextProcessor.php
│ │ ├── GitProcessor.php
│ │ ├── HostnameProcessor.php
│ │ ├── IntrospectionProcessor.php
│ │ ├── LoadAverageProcessor.php
│ │ ├── MemoryPeakUsageProcessor.php
│ │ ├── MemoryProcessor.php
│ │ ├── MemoryUsageProcessor.php
│ │ ├── MercurialProcessor.php
│ │ ├── ProcessIdProcessor.php
│ │ ├── ProcessorInterface.php
│ │ ├── PsrLogMessageProcessor.php
│ │ ├── TagProcessor.php
│ │ ├── UidProcessor.php
│ │ └── WebProcessor.php
│ ├── Registry.php
│ ├── ResettableInterface.php
│ ├── SignalHandler.php
│ ├── Test/
│ │ ├── MonologTestCase.php
│ │ └── TestCase.php
│ └── Utils.php
└── tests/
├── Monolog/
│ ├── Attribute/
│ │ ├── AsMonologProcessorTest.php
│ │ └── WithMonologChannelTest.php
│ ├── ErrorHandlerTest.php
│ ├── Formatter/
│ │ ├── ChromePHPFormatterTest.php
│ │ ├── ElasticaFormatterTest.php
│ │ ├── ElasticsearchFormatterTest.php
│ │ ├── FlowdockFormatterTest.php
│ │ ├── FluentdFormatterTest.php
│ │ ├── GelfMessageFormatterTest.php
│ │ ├── GoogleCloudLoggingFormatterTest.php
│ │ ├── JsonFormatterTest.php
│ │ ├── LineFormatterTest.php
│ │ ├── LogglyFormatterTest.php
│ │ ├── LogmaticFormatterTest.php
│ │ ├── LogstashFormatterTest.php
│ │ ├── MongoDBFormatterTest.php
│ │ ├── NormalizerFormatterTest.php
│ │ ├── ScalarFormatterTest.php
│ │ ├── SyslogFormatterTest.php
│ │ └── WildfireFormatterTest.php
│ ├── Handler/
│ │ ├── AbstractHandlerTest.php
│ │ ├── AbstractProcessingHandlerTest.php
│ │ ├── AmqpHandlerTest.php
│ │ ├── BrowserConsoleHandlerTest.php
│ │ ├── BufferHandlerTest.php
│ │ ├── ChromePHPHandlerTest.php
│ │ ├── CouchDBHandlerTest.php
│ │ ├── DeduplicationHandlerTest.php
│ │ ├── DoctrineCouchDBHandlerTest.php
│ │ ├── DynamoDbHandlerTest.php
│ │ ├── ElasticaHandlerTest.php
│ │ ├── ElasticsearchHandlerTest.php
│ │ ├── ErrorLogHandlerTest.php
│ │ ├── ExceptionTestHandler.php
│ │ ├── FallbackGroupHandlerTest.php
│ │ ├── FilterHandlerTest.php
│ │ ├── FingersCrossedHandlerTest.php
│ │ ├── FirePHPHandlerTest.php
│ │ ├── Fixtures/
│ │ │ └── .gitkeep
│ │ ├── FleepHookHandlerTest.php
│ │ ├── FlowdockHandlerTest.php
│ │ ├── GelfHandlerTest.php
│ │ ├── GroupHandlerTest.php
│ │ ├── HandlerWrapperTest.php
│ │ ├── InsightOpsHandlerTest.php
│ │ ├── LogEntriesHandlerTest.php
│ │ ├── LogmaticHandlerTest.php
│ │ ├── MailHandlerTest.php
│ │ ├── MongoDBHandlerTest.php
│ │ ├── NativeMailerHandlerTest.php
│ │ ├── NewRelicHandlerTest.php
│ │ ├── NoopHandlerTest.php
│ │ ├── NullHandlerTest.php
│ │ ├── OverflowHandlerTest.php
│ │ ├── PHPConsoleHandlerTest.php
│ │ ├── ProcessHandlerTest.php
│ │ ├── PsrHandlerTest.php
│ │ ├── PushoverHandlerTest.php
│ │ ├── RedisHandlerTest.php
│ │ ├── RedisPubSubHandlerTest.php
│ │ ├── RollbarHandlerTest.php
│ │ ├── RotatingFileHandlerTest.php
│ │ ├── SamplingHandlerTest.php
│ │ ├── Slack/
│ │ │ └── SlackRecordTest.php
│ │ ├── SlackHandlerTest.php
│ │ ├── SlackWebhookHandlerTest.php
│ │ ├── SocketHandlerTest.php
│ │ ├── StreamHandlerTest.php
│ │ ├── SymfonyMailerHandlerTest.php
│ │ ├── SyslogHandlerTest.php
│ │ ├── SyslogUdpHandlerTest.php
│ │ ├── TelegramBotHandlerTest.php
│ │ ├── TestHandlerTest.php
│ │ ├── UdpSocketTest.php
│ │ ├── WhatFailureGroupHandlerTest.php
│ │ └── ZendMonitorHandlerTest.php
│ ├── LoggerTest.php
│ ├── Processor/
│ │ ├── ClosureContextProcessorTest.php
│ │ ├── GitProcessorTest.php
│ │ ├── HostnameProcessorTest.php
│ │ ├── IntrospectionProcessorTest.php
│ │ ├── LoadAverageProcessorTest.php
│ │ ├── MemoryPeakUsageProcessorTest.php
│ │ ├── MemoryUsageProcessorTest.php
│ │ ├── MercurialProcessorTest.php
│ │ ├── ProcessIdProcessorTest.php
│ │ ├── PsrLogMessageProcessorTest.php
│ │ ├── TagProcessorTest.php
│ │ ├── UidProcessorTest.php
│ │ └── WebProcessorTest.php
│ ├── PsrLogCompatTest.php
│ ├── RegistryTest.php
│ ├── SignalHandlerTest.php
│ └── UtilsTest.php
└── bootstrap.php
SYMBOL INDEX (1607 symbols across 214 files)
FILE: src/Monolog/Attribute/AsMonologProcessor.php
class AsMonologProcessor (line 22) | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Att...
method __construct (line 31) | public function __construct(
FILE: src/Monolog/Attribute/WithMonologChannel.php
class WithMonologChannel (line 22) | #[\Attribute(\Attribute::TARGET_CLASS)]
method __construct (line 25) | public function __construct(
FILE: src/Monolog/DateTimeImmutable.php
class DateTimeImmutable (line 21) | class DateTimeImmutable extends JsonSerializableDateTimeImmutable
FILE: src/Monolog/ErrorHandler.php
class ErrorHandler (line 27) | class ErrorHandler
method __construct (line 53) | public function __construct(
method register (line 68) | public static function register(LoggerInterface $logger, $errorLevelMa...
method registerExceptionHandler (line 89) | public function registerExceptionHandler(array $levelMap = [], bool $c...
method registerErrorHandler (line 111) | public function registerErrorHandler(array $levelMap = [], bool $callP...
method registerFatalHandler (line 131) | public function registerFatalHandler($level = null, int $reservedMemor...
method defaultExceptionLevelMap (line 145) | protected function defaultExceptionLevelMap(): array
method defaultErrorLevelMap (line 156) | protected function defaultErrorLevelMap(): array
method handleException (line 177) | private function handleException(\Throwable $e): never
method handleError (line 204) | private function handleError(int $code, string $message, string $file ...
method handleFatalError (line 233) | public function handleFatalError(): void
method codeToString (line 258) | private static function codeToString(int $code): string
FILE: src/Monolog/Formatter/ChromePHPFormatter.php
class ChromePHPFormatter (line 22) | class ChromePHPFormatter implements FormatterInterface
method toWildfireLevel (line 29) | private function toWildfireLevel(Level $level): string
method format (line 46) | public function format(LogRecord $record)
method formatBatch (line 77) | public function formatBatch(array $records)
FILE: src/Monolog/Formatter/ElasticaFormatter.php
class ElasticaFormatter (line 22) | class ElasticaFormatter extends NormalizerFormatter
method __construct (line 38) | public function __construct(string $index, ?string $type)
method format (line 50) | public function format(LogRecord $record)
method getIndex (line 57) | public function getIndex(): string
method getType (line 65) | public function getType(): string
method getDocument (line 76) | protected function getDocument(array $record): Document
FILE: src/Monolog/Formatter/ElasticsearchFormatter.php
class ElasticsearchFormatter (line 22) | class ElasticsearchFormatter extends NormalizerFormatter
method __construct (line 38) | public function __construct(string $index, string $type)
method format (line 50) | public function format(LogRecord $record)
method getIndex (line 60) | public function getIndex(): string
method getType (line 68) | public function getType(): string
method getDocument (line 79) | protected function getDocument(array $record): array
FILE: src/Monolog/Formatter/FlowdockFormatter.php
class FlowdockFormatter (line 22) | class FlowdockFormatter implements FormatterInterface
method __construct (line 28) | public function __construct(string $source, string $sourceEmail)
method format (line 39) | public function format(LogRecord $record): array
method formatBatch (line 73) | public function formatBatch(array $records): array
method getShortMessage (line 84) | public function getShortMessage(string $message): string
FILE: src/Monolog/Formatter/FluentdFormatter.php
class FluentdFormatter (line 38) | class FluentdFormatter implements FormatterInterface
method __construct (line 45) | public function __construct(bool $levelTag = false)
method isUsingLevelsInTag (line 50) | public function isUsingLevelsInTag(): bool
method format (line 55) | public function format(LogRecord $record): string
method formatBatch (line 76) | public function formatBatch(array $records): string
FILE: src/Monolog/Formatter/FormatterInterface.php
type FormatterInterface (line 21) | interface FormatterInterface
method format (line 29) | public function format(LogRecord $record);
method formatBatch (line 37) | public function formatBatch(array $records);
FILE: src/Monolog/Formatter/GelfMessageFormatter.php
class GelfMessageFormatter (line 25) | class GelfMessageFormatter extends NormalizerFormatter
method getGraylog2Priority (line 52) | private function getGraylog2Priority(Level $level): int
method __construct (line 69) | public function __construct(?string $systemName = null, ?string $extra...
method format (line 87) | public function format(LogRecord $record): Message
FILE: src/Monolog/Formatter/GoogleCloudLoggingFormatter.php
class GoogleCloudLoggingFormatter (line 25) | class GoogleCloudLoggingFormatter extends JsonFormatter
method normalizeRecord (line 27) | protected function normalizeRecord(LogRecord $record): array
FILE: src/Monolog/Formatter/HtmlFormatter.php
class HtmlFormatter (line 25) | class HtmlFormatter extends NormalizerFormatter
method getLevelColor (line 30) | protected function getLevelColor(Level $level): string
method __construct (line 47) | public function __construct(?string $dateFormat = null)
method addRow (line 59) | protected function addRow(string $th, string $td = ' ', bool $escapeTd...
method addTitle (line 74) | protected function addTitle(string $title, Level $level): string
method format (line 86) | public function format(LogRecord $record): string
method formatBatch (line 119) | public function formatBatch(array $records): string
method convertToString (line 132) | protected function convertToString($data): string
FILE: src/Monolog/Formatter/JsonFormatter.php
class JsonFormatter (line 25) | class JsonFormatter extends NormalizerFormatter
method __construct (line 42) | public function __construct(int $batchMode = self::BATCH_MODE_JSON, bo...
method getBatchMode (line 59) | public function getBatchMode(): int
method isAppendingNewlines (line 67) | public function isAppendingNewlines(): bool
method format (line 75) | public function format(LogRecord $record): string
method formatBatch (line 85) | public function formatBatch(array $records): string
method includeStacktraces (line 96) | public function includeStacktraces(bool $include = true): self
method normalizeRecord (line 106) | protected function normalizeRecord(LogRecord $record): array
method formatBatchJson (line 133) | protected function formatBatchJson(array $records): string
method formatBatchNewlines (line 146) | protected function formatBatchNewlines(array $records): string
method normalize (line 161) | protected function normalize(mixed $data, int $depth = 0): mixed
method normalizeException (line 225) | protected function normalizeException(Throwable $e, int $depth = 0): a...
FILE: src/Monolog/Formatter/LineFormatter.php
class LineFormatter (line 26) | class LineFormatter extends NormalizerFormatter
method __construct (line 44) | public function __construct(?string $format = null, ?string $dateForma...
method setBasePath (line 57) | public function setBasePath(string $path = ''): self
method includeStacktraces (line 71) | public function includeStacktraces(bool $include = true, ?Closure $par...
method indentStacktraces (line 88) | public function indentStacktraces(string $indent): self
method allowInlineLineBreaks (line 98) | public function allowInlineLineBreaks(bool $allow = true): self
method ignoreEmptyContextAndExtra (line 108) | public function ignoreEmptyContextAndExtra(bool $ignore = true): self
method setMaxLevelNameLength (line 121) | public function setMaxLevelNameLength(?int $maxLevelNameLength = null)...
method format (line 131) | public function format(LogRecord $record): string
method formatBatch (line 185) | public function formatBatch(array $records): string
method stringify (line 198) | public function stringify($value): string
method normalizeException (line 203) | protected function normalizeException(\Throwable $e, int $depth = 0): ...
method convertToString (line 224) | protected function convertToString($data): string
method replaceNewlines (line 237) | protected function replaceNewlines(string $str): string
method formatException (line 255) | private function formatException(\Throwable $e): string
method stacktracesParser (line 290) | private function stacktracesParser(\Throwable $e): string
method stacktracesParserCustom (line 313) | private function stacktracesParserCustom(string $trace): string
FILE: src/Monolog/Formatter/LogglyFormatter.php
class LogglyFormatter (line 21) | class LogglyFormatter extends JsonFormatter
method __construct (line 27) | public function __construct(int $batchMode = self::BATCH_MODE_NEWLINES...
method normalizeRecord (line 38) | protected function normalizeRecord(LogRecord $record): array
FILE: src/Monolog/Formatter/LogmaticFormatter.php
class LogmaticFormatter (line 21) | class LogmaticFormatter extends JsonFormatter
method setHostname (line 32) | public function setHostname(string $hostname): self
method setAppName (line 42) | public function setAppName(string $appName): self
method normalizeRecord (line 55) | public function normalizeRecord(LogRecord $record): array
FILE: src/Monolog/Formatter/LogstashFormatter.php
class LogstashFormatter (line 24) | class LogstashFormatter extends NormalizerFormatter
method __construct (line 52) | public function __construct(string $applicationName, ?string $systemNa...
method format (line 66) | public function format(LogRecord $record): string
FILE: src/Monolog/Formatter/MongoDBFormatter.php
class MongoDBFormatter (line 24) | class MongoDBFormatter implements FormatterInterface
method __construct (line 33) | public function __construct(int $maxNestingLevel = 3, bool $exceptionT...
method format (line 44) | public function format(LogRecord $record): array
method formatBatch (line 57) | public function formatBatch(array $records): array
method formatArray (line 71) | protected function formatArray(array $array, int $nestingLevel = 0)
method formatObject (line 96) | protected function formatObject($value, int $nestingLevel)
method formatException (line 107) | protected function formatException(\Throwable $exception, int $nesting...
method formatDate (line 125) | protected function formatDate(\DateTimeInterface $value, int $nestingL...
FILE: src/Monolog/Formatter/NormalizerFormatter.php
class NormalizerFormatter (line 24) | class NormalizerFormatter implements FormatterInterface
method __construct (line 40) | public function __construct(?string $dateFormat = null)
method format (line 48) | public function format(LogRecord $record)
method normalizeValue (line 58) | public function normalizeValue(mixed $data): mixed
method formatBatch (line 66) | public function formatBatch(array $records)
method getDateFormat (line 75) | public function getDateFormat(): string
method setDateFormat (line 83) | public function setDateFormat(string $dateFormat): self
method getMaxNormalizeDepth (line 93) | public function getMaxNormalizeDepth(): int
method setMaxNormalizeDepth (line 101) | public function setMaxNormalizeDepth(int $maxNormalizeDepth): self
method getMaxNormalizeItemCount (line 111) | public function getMaxNormalizeItemCount(): int
method setMaxNormalizeItemCount (line 119) | public function setMaxNormalizeItemCount(int $maxNormalizeItemCount): ...
method getMaxTraceLength (line 129) | public function getMaxTraceLength(): ?int
method setMaxTraceLength (line 137) | public function setMaxTraceLength(?int $maxTraceLength): self
method setJsonPrettyPrint (line 149) | public function setJsonPrettyPrint(bool $enable): self
method setBasePath (line 164) | public function setBasePath(string $path = ''): self
method normalizeRecord (line 183) | protected function normalizeRecord(LogRecord $record): array
method normalize (line 194) | protected function normalize(mixed $data, int $depth = 0): mixed
method normalizeException (line 272) | protected function normalizeException(Throwable $e, int $depth = 0)
method toJson (line 337) | protected function toJson($data, bool $ignoreErrors = false): string
method formatDate (line 342) | protected function formatDate(\DateTimeInterface $date): string
method addJsonEncodeOption (line 356) | public function addJsonEncodeOption(int $option): self
method removeJsonEncodeOption (line 366) | public function removeJsonEncodeOption(int $option): self
FILE: src/Monolog/Formatter/ScalarFormatter.php
class ScalarFormatter (line 22) | class ScalarFormatter extends NormalizerFormatter
method format (line 29) | public function format(LogRecord $record): array
method toScalar (line 39) | protected function toScalar(mixed $value): string|int|float|bool|null
FILE: src/Monolog/Formatter/SyslogFormatter.php
class SyslogFormatter (line 23) | class SyslogFormatter extends LineFormatter
method __construct (line 32) | public function __construct(private string $applicationName = self::NI...
method format (line 39) | public function format(LogRecord $record): string
method formatExtra (line 49) | private function formatExtra(LogRecord $record): array
method calculatePriority (line 61) | private static function calculatePriority(Level $level): int
FILE: src/Monolog/Formatter/WildfireFormatter.php
class WildfireFormatter (line 24) | class WildfireFormatter extends NormalizerFormatter
method __construct (line 29) | public function __construct(?string $dateFormat = null)
method toWildfireLevel (line 42) | private function toWildfireLevel(Level $level): string
method format (line 59) | public function format(LogRecord $record): string
method formatBatch (line 119) | public function formatBatch(array $records)
method normalize (line 129) | protected function normalize(mixed $data, int $depth = 0): mixed
FILE: src/Monolog/Handler/AbstractHandler.php
class AbstractHandler (line 25) | abstract class AbstractHandler extends Handler implements ResettableInte...
method __construct (line 36) | public function __construct(int|string|Level $level = Level::Debug, bo...
method isHandling (line 45) | public function isHandling(LogRecord $record): bool
method setLevel (line 58) | public function setLevel(int|string|Level $level): self
method getLevel (line 68) | public function getLevel(): Level
method setBubble (line 80) | public function setBubble(bool $bubble): self
method getBubble (line 93) | public function getBubble(): bool
method reset (line 101) | public function reset(): void
FILE: src/Monolog/Handler/AbstractProcessingHandler.php
class AbstractProcessingHandler (line 24) | abstract class AbstractProcessingHandler extends AbstractHandler impleme...
method handle (line 32) | public function handle(LogRecord $record): bool
method write (line 52) | abstract protected function write(LogRecord $record): void;
method reset (line 54) | public function reset(): void
FILE: src/Monolog/Handler/AbstractSyslogHandler.php
class AbstractSyslogHandler (line 21) | abstract class AbstractSyslogHandler extends AbstractProcessingHandler
method toSyslogPriority (line 46) | protected function toSyslogPriority(Level $level): int
method __construct (line 54) | public function __construct(string|int $facility = \LOG_USER, int|stri...
method getDefaultFormatter (line 91) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/AmqpHandler.php
class AmqpHandler (line 23) | class AmqpHandler extends AbstractProcessingHandler
method __construct (line 36) | public function __construct(AMQPExchange|AMQPChannel $exchange, ?strin...
method getExtraAttributes (line 51) | public function getExtraAttributes(): array
method setExtraAttributes (line 65) | public function setExtraAttributes(array $extraAttributes): self
method write (line 75) | protected function write(LogRecord $record): void
method handleBatch (line 110) | public function handleBatch(array $records): void
method getRoutingKey (line 143) | protected function getRoutingKey(LogRecord $record): string
method createAmqpMessage (line 150) | private function createAmqpMessage(string $data): AMQPMessage
method getDefaultFormatter (line 166) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/BrowserConsoleHandler.php
class BrowserConsoleHandler (line 28) | class BrowserConsoleHandler extends AbstractProcessingHandler
method getDefaultFormatter (line 48) | protected function getDefaultFormatter(): FormatterInterface
method write (line 56) | protected function write(LogRecord $record): void
method send (line 72) | public static function send(): void
method close (line 89) | public function close(): void
method reset (line 94) | public function reset(): void
method resetStatic (line 104) | public static function resetStatic(): void
method registerShutdownFunction (line 112) | protected function registerShutdownFunction(): void
method writeOutput (line 122) | protected static function writeOutput(string $str): void
method getResponseFormat (line 137) | protected static function getResponseFormat(): string
method getResponseFormatFromContentType (line 153) | protected static function getResponseFormatFromContentType(string $con...
method generateScript (line 168) | private static function generateScript(): string
method getConsoleMethodForLevel (line 191) | private static function getConsoleMethodForLevel(Level $level): string
method handleStyles (line 204) | private static function handleStyles(string $formatted): array
method handleCustomStyles (line 224) | private static function handleCustomStyles(string $style, string $stri...
method dump (line 256) | private static function dump(string $title, array $dict): array
method quote (line 275) | private static function quote(string $arg): string
method call (line 283) | private static function call(...$args): string
method call_array (line 296) | private static function call_array(string $method, array $args): string
FILE: src/Monolog/Handler/BufferHandler.php
class BufferHandler (line 27) | class BufferHandler extends AbstractHandler implements ProcessableHandle...
method __construct (line 49) | public function __construct(HandlerInterface $handler, int $bufferLimi...
method handle (line 60) | public function handle(LogRecord $record): bool
method flush (line 91) | public function flush(): void
method __destruct (line 101) | public function __destruct()
method close (line 111) | public function close(): void
method clear (line 121) | public function clear(): void
method reset (line 127) | public function reset(): void
method setFormatter (line 143) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 157) | public function getFormatter(): FormatterInterface
method setHandler (line 166) | public function setHandler(HandlerInterface $handler): void
FILE: src/Monolog/Handler/ChromePHPHandler.php
class ChromePHPHandler (line 28) | class ChromePHPHandler extends AbstractProcessingHandler
method __construct (line 65) | public function __construct(int|string|Level $level = Level::Debug, bo...
method handleBatch (line 73) | public function handleBatch(array $records): void
method getDefaultFormatter (line 100) | protected function getDefaultFormatter(): FormatterInterface
method write (line 111) | protected function write(LogRecord $record): void
method send (line 127) | protected function send(): void
method sendHeader (line 168) | protected function sendHeader(string $header, string $content): void
method headersAccepted (line 178) | protected function headersAccepted(): bool
FILE: src/Monolog/Handler/CouchDBHandler.php
class CouchDBHandler (line 38) | class CouchDBHandler extends AbstractProcessingHandler
method __construct (line 51) | public function __construct(array $options = [], int|string|Level $lev...
method write (line 67) | protected function write(LogRecord $record): void
method getDefaultFormatter (line 93) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/CubeHandler.php
class CubeHandler (line 25) | class CubeHandler extends AbstractProcessingHandler
method __construct (line 42) | public function __construct(string $url, int|string|Level $level = Lev...
method connectUdp (line 70) | protected function connectUdp(): void
method connectHttp (line 93) | protected function connectHttp(): void
method write (line 112) | protected function write(LogRecord $record): void
method writeUdp (line 136) | private function writeUdp(string $data): void
method writeHttp (line 149) | private function writeHttp(string $data): void
FILE: src/Monolog/Handler/Curl/Util.php
class Util (line 21) | final class Util
method execute (line 40) | public static function execute(CurlHandle $ch, int $retries = 5): bool...
FILE: src/Monolog/Handler/DeduplicationHandler.php
class DeduplicationHandler (line 39) | class DeduplicationHandler extends BufferHandler
method __construct (line 57) | public function __construct(HandlerInterface $handler, ?string $dedupl...
method flush (line 66) | public function flush(): void
method isDuplicate (line 110) | protected function isDuplicate(array $store, LogRecord $record): bool
method buildDeduplicationStoreEntry (line 141) | protected function buildDeduplicationStoreEntry(LogRecord $record): st...
method collectLogs (line 146) | private function collectLogs(): void
FILE: src/Monolog/Handler/DoctrineCouchDBHandler.php
class DoctrineCouchDBHandler (line 25) | class DoctrineCouchDBHandler extends AbstractProcessingHandler
method __construct (line 29) | public function __construct(CouchDBClient $client, int|string|Level $l...
method write (line 38) | protected function write(LogRecord $record): void
method getDefaultFormatter (line 43) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/DynamoDbHandler.php
class DynamoDbHandler (line 28) | class DynamoDbHandler extends AbstractProcessingHandler
method __construct (line 38) | public function __construct(DynamoDbClient $client, string $table, int...
method write (line 51) | protected function write(LogRecord $record): void
method filterEmptyFields (line 66) | protected function filterEmptyFields(array $record): array
method getDefaultFormatter (line 76) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/ElasticaHandler.php
class ElasticaHandler (line 49) | class ElasticaHandler extends AbstractProcessingHandler
method __construct (line 65) | public function __construct(Client $client, array $options = [], int|s...
method write (line 82) | protected function write(LogRecord $record): void
method setFormatter (line 90) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getOptions (line 104) | public function getOptions(): array
method getDefaultFormatter (line 112) | protected function getDefaultFormatter(): FormatterInterface
method handleBatch (line 120) | public function handleBatch(array $records): void
method bulkSend (line 133) | protected function bulkSend(array $documents): void
FILE: src/Monolog/Handler/ElasticsearchHandler.php
class ElasticsearchHandler (line 60) | class ElasticsearchHandler extends AbstractProcessingHandler
method __construct (line 81) | public function __construct(Client|Client8 $client, array $options = [...
method write (line 107) | protected function write(LogRecord $record): void
method setFormatter (line 115) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getOptions (line 131) | public function getOptions(): array
method getDefaultFormatter (line 139) | protected function getDefaultFormatter(): FormatterInterface
method handleBatch (line 147) | public function handleBatch(array $records): void
method bulkSend (line 159) | protected function bulkSend(array $records): void
method createExceptionFromResponses (line 200) | protected function createExceptionFromResponses($responses): Throwable
method createExceptionFromError (line 224) | protected function createExceptionFromError(array $error): Throwable
FILE: src/Monolog/Handler/ErrorLogHandler.php
class ErrorLogHandler (line 25) | class ErrorLogHandler extends AbstractProcessingHandler
method __construct (line 40) | public function __construct(int $messageType = self::OPERATING_SYSTEM,...
method getAvailableTypes (line 57) | public static function getAvailableTypes(): array
method getDefaultFormatter (line 68) | protected function getDefaultFormatter(): FormatterInterface
method write (line 76) | protected function write(LogRecord $record): void
FILE: src/Monolog/Handler/FallbackGroupHandler.php
class FallbackGroupHandler (line 24) | class FallbackGroupHandler extends GroupHandler
method handle (line 29) | public function handle(LogRecord $record): bool
method handleBatch (line 49) | public function handleBatch(array $records): void
FILE: src/Monolog/Handler/FilterHandler.php
class FilterHandler (line 30) | class FilterHandler extends Handler implements ProcessableHandlerInterfa...
method __construct (line 65) | public function __construct(Closure|HandlerInterface $handler, int|str...
method getAcceptedLevels (line 75) | public function getAcceptedLevels(): array
method setAcceptedLevels (line 88) | public function setAcceptedLevels(int|string|Level|array $minLevelOrLi...
method isHandling (line 108) | public function isHandling(LogRecord $record): bool
method handle (line 116) | public function handle(LogRecord $record): bool
method handleBatch (line 134) | public function handleBatch(array $records): void
method getHandler (line 153) | public function getHandler(LogRecord|null $record = null): HandlerInte...
method setFormatter (line 169) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 184) | public function getFormatter(): FormatterInterface
method reset (line 194) | public function reset(): void
FILE: src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
type ActivationStrategyInterface (line 21) | interface ActivationStrategyInterface
method isHandlerActivated (line 26) | public function isHandlerActivated(LogRecord $record): bool;
FILE: src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php
class ChannelLevelActivationStrategy (line 39) | class ChannelLevelActivationStrategy implements ActivationStrategyInterface
method __construct (line 55) | public function __construct(int|string|Level $defaultActionLevel, arra...
method isHandlerActivated (line 61) | public function isHandlerActivated(LogRecord $record): bool
FILE: src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
class ErrorLevelActivationStrategy (line 24) | class ErrorLevelActivationStrategy implements ActivationStrategyInterface
method __construct (line 33) | public function __construct(int|string|Level $actionLevel)
method isHandlerActivated (line 38) | public function isHandlerActivated(LogRecord $record): bool
FILE: src/Monolog/Handler/FingersCrossedHandler.php
class FingersCrossedHandler (line 40) | class FingersCrossedHandler extends Handler implements ProcessableHandle...
method __construct (line 79) | public function __construct(Closure|HandlerInterface $handler, int|str...
method isHandling (line 104) | public function isHandling(LogRecord $record): bool
method activate (line 112) | public function activate(): void
method handle (line 125) | public function handle(LogRecord $record): bool
method close (line 149) | public function close(): void
method reset (line 156) | public function reset(): void
method clear (line 172) | public function clear(): void
method flushBuffer (line 181) | private function flushBuffer(): void
method getHandler (line 202) | public function getHandler(LogRecord|null $record = null): HandlerInte...
method setFormatter (line 218) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 233) | public function getFormatter(): FormatterInterface
FILE: src/Monolog/Handler/FirePHPHandler.php
class FirePHPHandler (line 23) | class FirePHPHandler extends AbstractProcessingHandler
method createHeader (line 69) | protected function createHeader(array $meta, string $message): array
method createRecordHeader (line 85) | protected function createRecordHeader(LogRecord $record): array
method getDefaultFormatter (line 98) | protected function getDefaultFormatter(): FormatterInterface
method getInitHeaders (line 111) | protected function getInitHeaders(): array
method sendHeader (line 124) | protected function sendHeader(string $header, string $content): void
method write (line 137) | protected function write(LogRecord $record): void
method headersAccepted (line 166) | protected function headersAccepted(): bool
FILE: src/Monolog/Handler/FleepHookHandler.php
class FleepHookHandler (line 27) | class FleepHookHandler extends SocketHandler
method __construct (line 47) | public function __construct(
method getDefaultFormatter (line 83) | protected function getDefaultFormatter(): FormatterInterface
method write (line 91) | public function write(LogRecord $record): void
method generateDataStream (line 100) | protected function generateDataStream(LogRecord $record): string
method buildHeader (line 110) | private function buildHeader(string $content): string
method buildContent (line 124) | private function buildContent(LogRecord $record): string
FILE: src/Monolog/Handler/FlowdockHandler.php
class FlowdockHandler (line 32) | class FlowdockHandler extends SocketHandler
method __construct (line 39) | public function __construct(
method setFormatter (line 69) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getDefaultFormatter (line 81) | protected function getDefaultFormatter(): FormatterInterface
method write (line 89) | protected function write(LogRecord $record): void
method generateDataStream (line 99) | protected function generateDataStream(LogRecord $record): string
method buildContent (line 109) | private function buildContent(LogRecord $record): string
method buildHeader (line 117) | private function buildHeader(string $content): string
FILE: src/Monolog/Handler/FormattableHandlerInterface.php
type FormattableHandlerInterface (line 21) | interface FormattableHandlerInterface
method setFormatter (line 28) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 33) | public function getFormatter(): FormatterInterface;
FILE: src/Monolog/Handler/FormattableHandlerTrait.php
type FormattableHandlerTrait (line 22) | trait FormattableHandlerTrait
method setFormatter (line 29) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 39) | public function getFormatter(): FormatterInterface
method getDefaultFormatter (line 53) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/GelfHandler.php
class GelfHandler (line 26) | class GelfHandler extends AbstractProcessingHandler
method __construct (line 36) | public function __construct(PublisherInterface $publisher, int|string|...
method write (line 46) | protected function write(LogRecord $record): void
method getDefaultFormatter (line 54) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/GroupHandler.php
class GroupHandler (line 23) | class GroupHandler extends Handler implements ProcessableHandlerInterfac...
method __construct (line 37) | public function __construct(array $handlers, bool $bubble = true)
method isHandling (line 52) | public function isHandling(LogRecord $record): bool
method handle (line 66) | public function handle(LogRecord $record): bool
method handleBatch (line 82) | public function handleBatch(array $records): void
method reset (line 97) | public function reset(): void
method close (line 108) | public function close(): void
method setFormatter (line 120) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
FILE: src/Monolog/Handler/Handler.php
class Handler (line 19) | abstract class Handler implements HandlerInterface
method handleBatch (line 24) | public function handleBatch(array $records): void
method close (line 34) | public function close(): void
method __destruct (line 38) | public function __destruct()
method __serialize (line 47) | public function __serialize(): array
FILE: src/Monolog/Handler/HandlerInterface.php
type HandlerInterface (line 21) | interface HandlerInterface
method isHandling (line 34) | public function isHandling(LogRecord $record): bool;
method handle (line 50) | public function handle(LogRecord $record): bool;
method handleBatch (line 57) | public function handleBatch(array $records): void;
method close (line 75) | public function close(): void;
FILE: src/Monolog/Handler/HandlerWrapper.php
class HandlerWrapper (line 35) | class HandlerWrapper implements HandlerInterface, ProcessableHandlerInte...
method __construct (line 39) | public function __construct(HandlerInterface $handler)
method isHandling (line 47) | public function isHandling(LogRecord $record): bool
method handle (line 55) | public function handle(LogRecord $record): bool
method handleBatch (line 63) | public function handleBatch(array $records): void
method close (line 71) | public function close(): void
method pushProcessor (line 79) | public function pushProcessor(callable $callback): HandlerInterface
method popProcessor (line 93) | public function popProcessor(): callable
method setFormatter (line 105) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 119) | public function getFormatter(): FormatterInterface
method reset (line 128) | public function reset(): void
FILE: src/Monolog/Handler/IFTTTHandler.php
class IFTTTHandler (line 29) | class IFTTTHandler extends AbstractProcessingHandler
method __construct (line 40) | public function __construct(string $eventName, string $secretKey, int|...
method write (line 55) | public function write(LogRecord $record): void
FILE: src/Monolog/Handler/InsightOpsHandler.php
class InsightOpsHandler (line 23) | class InsightOpsHandler extends SocketHandler
method __construct (line 34) | public function __construct(
method generateDataStream (line 70) | protected function generateDataStream(LogRecord $record): string
FILE: src/Monolog/Handler/LogEntriesHandler.php
class LogEntriesHandler (line 20) | class LogEntriesHandler extends SocketHandler
method __construct (line 31) | public function __construct(
method generateDataStream (line 64) | protected function generateDataStream(LogRecord $record): string
FILE: src/Monolog/Handler/LogglyHandler.php
class LogglyHandler (line 27) | class LogglyHandler extends AbstractProcessingHandler
method __construct (line 50) | public function __construct(string $token, int|string|Level $level = L...
method getCurlHandler (line 64) | protected function getCurlHandler(string $endpoint): CurlHandle
method loadCurlHandle (line 76) | private function loadCurlHandle(string $endpoint): CurlHandle
method setTag (line 93) | public function setTag(string|array $tag): self
method addTag (line 108) | public function addTag(string|array $tag): self
method write (line 118) | protected function write(LogRecord $record): void
method handleBatch (line 123) | public function handleBatch(array $records): void
method send (line 136) | protected function send(string $data, string $endpoint): void
method getDefaultFormatter (line 152) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/LogmaticHandler.php
class LogmaticHandler (line 22) | class LogmaticHandler extends SocketHandler
method __construct (line 38) | public function __construct(
method generateDataStream (line 77) | protected function generateDataStream(LogRecord $record): string
method getDefaultFormatter (line 85) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/MailHandler.php
class MailHandler (line 23) | abstract class MailHandler extends AbstractProcessingHandler
method handleBatch (line 28) | public function handleBatch(array $records): void
method send (line 54) | abstract protected function send(string $content, array $records): void;
method write (line 59) | protected function write(LogRecord $record): void
method getHighestRecord (line 67) | protected function getHighestRecord(array $records): LogRecord
method isHtmlBody (line 79) | protected function isHtmlBody(string $body): bool
method getDefaultFormatter (line 87) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/MandrillHandler.php
class MandrillHandler (line 23) | class MandrillHandler extends MailHandler
method __construct (line 36) | public function __construct(string $apiKey, callable|Swift_Message $me...
method send (line 53) | protected function send(string $content, array $records): void
FILE: src/Monolog/Handler/MissingExtensionException.php
class MissingExtensionException (line 19) | class MissingExtensionException extends \Exception
FILE: src/Monolog/Handler/MongoDBHandler.php
class MongoDBHandler (line 36) | class MongoDBHandler extends AbstractProcessingHandler
method __construct (line 51) | public function __construct(Client|Manager $mongodb, string $database,...
method write (line 63) | protected function write(LogRecord $record): void
method getDefaultFormatter (line 79) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/NativeMailerHandler.php
class NativeMailerHandler (line 23) | class NativeMailerHandler extends MailHandler
method __construct (line 69) | public function __construct(string|array $to, string $subject, string ...
method addHeader (line 84) | public function addHeader($headers): self
method addParameter (line 102) | public function addParameter($parameters): self
method send (line 112) | protected function send(string $content, array $records): void
method getContentType (line 135) | public function getContentType(): ?string
method getEncoding (line 140) | public function getEncoding(): string
method setContentType (line 149) | public function setContentType(string $contentType): self
method setEncoding (line 163) | public function setEncoding(string $encoding): self
method mail (line 175) | protected function mail(string $to, string $subject, string $content, ...
FILE: src/Monolog/Handler/NewRelicHandler.php
class NewRelicHandler (line 29) | class NewRelicHandler extends AbstractProcessingHandler
method __construct (line 34) | public function __construct(
method write (line 60) | protected function write(LogRecord $record): void
method isNewRelicEnabled (line 110) | protected function isNewRelicEnabled(): bool
method getAppName (line 121) | protected function getAppName(array $context): ?string
method getTransactionName (line 136) | protected function getTransactionName(array $context): ?string
method setNewRelicAppName (line 148) | protected function setNewRelicAppName(string $appName): void
method setNewRelicTransactionName (line 156) | protected function setNewRelicTransactionName(string $transactionName)...
method setNewRelicParameter (line 164) | protected function setNewRelicParameter(string $key, $value): void
method getDefaultFormatter (line 176) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/NoopHandler.php
class NoopHandler (line 25) | class NoopHandler extends Handler
method isHandling (line 30) | public function isHandling(LogRecord $record): bool
method handle (line 38) | public function handle(LogRecord $record): bool
FILE: src/Monolog/Handler/NullHandler.php
class NullHandler (line 27) | class NullHandler extends Handler
method __construct (line 36) | public function __construct(string|int|Level $level = Level::Debug)
method isHandling (line 44) | public function isHandling(LogRecord $record): bool
method handle (line 52) | public function handle(LogRecord $record): bool
FILE: src/Monolog/Handler/OverflowHandler.php
class OverflowHandler (line 38) | class OverflowHandler extends AbstractHandler implements FormattableHand...
method __construct (line 55) | public function __construct(
method handle (line 80) | public function handle(LogRecord $record): bool
method setFormatter (line 117) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 131) | public function getFormatter(): FormatterInterface
FILE: src/Monolog/Handler/PHPConsoleHandler.php
class PHPConsoleHandler (line 89) | class PHPConsoleHandler extends AbstractProcessingHandler
method __construct (line 125) | public function __construct(array $options = [], ?Connector $connector...
method initOptions (line 142) | private function initOptions(array $options): array
method initConnector (line 152) | private function initConnector(?Connector $connector = null): Connector
method getConnector (line 207) | public function getConnector(): Connector
method getOptions (line 215) | public function getOptions(): array
method handle (line 220) | public function handle(LogRecord $record): bool
method write (line 232) | protected function write(LogRecord $record): void
method handleDebugRecord (line 243) | private function handleDebugRecord(LogRecord $record): void
method handleExceptionRecord (line 253) | private function handleExceptionRecord(LogRecord $record): void
method handleErrorRecord (line 258) | private function handleErrorRecord(LogRecord $record): void
method getRecordTags (line 274) | private function getRecordTags(LogRecord $record): array
method getDefaultFormatter (line 299) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/ProcessHandler.php
class ProcessHandler (line 28) | class ProcessHandler extends AbstractProcessingHandler
method __construct (line 64) | public function __construct(string $command, int|string|Level $level =...
method write (line 85) | protected function write(LogRecord $record): void
method ensureProcessIsStarted (line 101) | private function ensureProcessIsStarted(): void
method startProcess (line 113) | private function startProcess(): void
method handleStartupErrors (line 127) | private function handleStartupErrors(): void
method selectErrorStream (line 148) | protected function selectErrorStream()
method readProcessErrors (line 163) | protected function readProcessErrors(): string
method writeProcessInput (line 173) | protected function writeProcessInput(string $string): void
method close (line 181) | public function close(): void
FILE: src/Monolog/Handler/ProcessableHandlerInterface.php
type ProcessableHandlerInterface (line 22) | interface ProcessableHandlerInterface
method pushProcessor (line 32) | public function pushProcessor(callable $callback): HandlerInterface;
method popProcessor (line 42) | public function popProcessor(): callable;
FILE: src/Monolog/Handler/ProcessableHandlerTrait.php
type ProcessableHandlerTrait (line 23) | trait ProcessableHandlerTrait
method pushProcessor (line 34) | public function pushProcessor(callable $callback): HandlerInterface
method popProcessor (line 44) | public function popProcessor(): callable
method processRecord (line 53) | protected function processRecord(LogRecord $record): LogRecord
method resetProcessors (line 62) | protected function resetProcessors(): void
FILE: src/Monolog/Handler/PsrHandler.php
class PsrHandler (line 28) | class PsrHandler extends AbstractHandler implements FormattableHandlerIn...
method __construct (line 41) | public function __construct(LoggerInterface $logger, int|string|Level ...
method handle (line 52) | public function handle(LogRecord $record): bool
method setFormatter (line 74) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 84) | public function getFormatter(): FormatterInterface
FILE: src/Monolog/Handler/PushoverHandler.php
class PushoverHandler (line 26) | class PushoverHandler extends SocketHandler
method __construct (line 100) | public function __construct(
method generateDataStream (line 138) | protected function generateDataStream(LogRecord $record): string
method buildContent (line 145) | private function buildContent(LogRecord $record): string
method buildHeader (line 186) | private function buildHeader(string $content): string
method write (line 197) | protected function write(LogRecord $record): void
method setHighPriorityLevel (line 215) | public function setHighPriorityLevel(int|string|Level $level): self
method setEmergencyLevel (line 228) | public function setEmergencyLevel(int|string|Level $level): self
method useFormattedMessage (line 240) | public function useFormattedMessage(bool $useFormattedMessage): self
FILE: src/Monolog/Handler/RedisHandler.php
class RedisHandler (line 32) | class RedisHandler extends AbstractProcessingHandler
method __construct (line 44) | public function __construct(Predis|Redis $redis, string $key, int|stri...
method write (line 56) | protected function write(LogRecord $record): void
method writeCapped (line 69) | protected function writeCapped(LogRecord $record): void
method getDefaultFormatter (line 90) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/RedisPubSubHandler.php
class RedisPubSubHandler (line 32) | class RedisPubSubHandler extends AbstractProcessingHandler
method __construct (line 42) | public function __construct(Predis|Redis $redis, string $key, int|stri...
method write (line 53) | protected function write(LogRecord $record): void
method getDefaultFormatter (line 61) | protected function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/Handler/RollbarHandler.php
class RollbarHandler (line 35) | class RollbarHandler extends AbstractProcessingHandler
method __construct (line 49) | public function __construct(RollbarLogger $rollbarLogger, int|string|L...
method toRollbarLevel (line 61) | protected function toRollbarLevel(Level $level): string
method write (line 78) | protected function write(LogRecord $record): void
method flush (line 107) | public function flush(): void
method close (line 118) | public function close(): void
method reset (line 126) | public function reset(): void
FILE: src/Monolog/Handler/RotatingFileHandler.php
class RotatingFileHandler (line 29) | class RotatingFileHandler extends StreamHandler
method __construct (line 48) | public function __construct(string $filename, int $maxFiles = 0, int|s...
method close (line 62) | public function close(): void
method reset (line 74) | public function reset(): void
method setFilenameFormat (line 82) | public function setFilenameFormat(string $filenameFormat, string $date...
method write (line 100) | protected function write(LogRecord $record): void
method rotate (line 123) | protected function rotate(): void
method getTimedFilename (line 178) | protected function getTimedFilename(): string
method getGlobPattern (line 194) | protected function getGlobPattern(): string
method setDateFormat (line 213) | protected function setDateFormat(string $dateFormat): void
method getNextRotation (line 226) | protected function getNextRotation(): \DateTimeImmutable
FILE: src/Monolog/Handler/SamplingHandler.php
class SamplingHandler (line 32) | class SamplingHandler extends AbstractHandler implements ProcessableHand...
method __construct (line 51) | public function __construct(Closure|HandlerInterface $handler, int $fa...
method isHandling (line 58) | public function isHandling(LogRecord $record): bool
method handle (line 63) | public function handle(LogRecord $record): bool
method getHandler (line 81) | public function getHandler(LogRecord|null $record = null): HandlerInte...
method setFormatter (line 97) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 112) | public function getFormatter(): FormatterInterface
FILE: src/Monolog/Handler/SendGridHandler.php
class SendGridHandler (line 22) | class SendGridHandler extends MailHandler
method __construct (line 41) | public function __construct(
method send (line 62) | protected function send(string $content, array $records): void
FILE: src/Monolog/Handler/Slack/SlackRecord.php
class SlackRecord (line 28) | class SlackRecord
method __construct (line 81) | public function __construct(
method getSlackData (line 112) | public function getSlackData(LogRecord $record): array
method getAttachmentColor (line 192) | public function getAttachmentColor(Level $level): string
method stringify (line 207) | public function stringify(array $fields): string
method setChannel (line 226) | public function setChannel(?string $channel = null): self
method setUsername (line 239) | public function setUsername(?string $username = null): self
method useAttachment (line 249) | public function useAttachment(bool $useAttachment = true): self
method setUserIcon (line 259) | public function setUserIcon(?string $userIcon = null): self
method useShortAttachment (line 273) | public function useShortAttachment(bool $useShortAttachment = false): ...
method includeContextAndExtra (line 283) | public function includeContextAndExtra(bool $includeContextAndExtra = ...
method excludeFields (line 298) | public function excludeFields(array $excludeFields = []): self
method setFormatter (line 308) | public function setFormatter(?FormatterInterface $formatter = null): self
method generateAttachmentField (line 322) | private function generateAttachmentField(string $title, $value): array
method generateAttachmentFields (line 342) | private function generateAttachmentFields(array $data): array
method removeExcludedFields (line 360) | private function removeExcludedFields(LogRecord $record): array
FILE: src/Monolog/Handler/SlackHandler.php
class SlackHandler (line 26) | class SlackHandler extends SocketHandler
method __construct (line 49) | public function __construct(
method getSlackRecord (line 94) | public function getSlackRecord(): SlackRecord
method getToken (line 99) | public function getToken(): string
method generateDataStream (line 107) | protected function generateDataStream(LogRecord $record): string
method buildContent (line 117) | private function buildContent(LogRecord $record): string
method prepareContentData (line 127) | protected function prepareContentData(LogRecord $record): array
method buildHeader (line 142) | private function buildHeader(string $content): string
method write (line 156) | protected function write(LogRecord $record): void
method finalizeWrite (line 168) | protected function finalizeWrite(): void
method setFormatter (line 177) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 185) | public function getFormatter(): FormatterInterface
method setChannel (line 198) | public function setChannel(string $channel): self
method setUsername (line 210) | public function setUsername(string $username): self
method useAttachment (line 220) | public function useAttachment(bool $useAttachment): self
method setIconEmoji (line 230) | public function setIconEmoji(string $iconEmoji): self
method useShortAttachment (line 240) | public function useShortAttachment(bool $useShortAttachment): self
method includeContextAndExtra (line 250) | public function includeContextAndExtra(bool $includeContextAndExtra): ...
method excludeFields (line 261) | public function excludeFields(array $excludeFields): self
FILE: src/Monolog/Handler/SlackWebhookHandler.php
class SlackWebhookHandler (line 26) | class SlackWebhookHandler extends AbstractProcessingHandler
method __construct (line 52) | public function __construct(
method getSlackRecord (line 83) | public function getSlackRecord(): SlackRecord
method getWebhookUrl (line 88) | public function getWebhookUrl(): string
method write (line 96) | protected function write(LogRecord $record): void
method setFormatter (line 115) | public function setFormatter(FormatterInterface $formatter): HandlerIn...
method getFormatter (line 123) | public function getFormatter(): FormatterInterface
FILE: src/Monolog/Handler/SocketHandler.php
class SocketHandler (line 23) | class SocketHandler extends AbstractProcessingHandler
method __construct (line 49) | public function __construct(
method write (line 83) | protected function write(LogRecord $record): void
method close (line 93) | public function close(): void
method closeSocket (line 103) | public function closeSocket(): void
method setPersistent (line 116) | public function setPersistent(bool $persistent): self
method setConnectionTimeout (line 129) | public function setConnectionTimeout(float $seconds): self
method setTimeout (line 143) | public function setTimeout(float $seconds): self
method setWritingTimeout (line 157) | public function setWritingTimeout(float $seconds): self
method setChunkSize (line 170) | public function setChunkSize(int $bytes): self
method getConnectionString (line 180) | public function getConnectionString(): string
method isPersistent (line 188) | public function isPersistent(): bool
method getConnectionTimeout (line 196) | public function getConnectionTimeout(): float
method getTimeout (line 204) | public function getTimeout(): float
method getWritingTimeout (line 212) | public function getWritingTimeout(): float
method getChunkSize (line 220) | public function getChunkSize(): ?int
method isConnected (line 230) | public function isConnected(): bool
method pfsockopen (line 241) | protected function pfsockopen()
method fsockopen (line 251) | protected function fsockopen()
method streamSetTimeout (line 261) | protected function streamSetTimeout(): bool
method streamSetChunkSize (line 280) | protected function streamSetChunkSize(): int|bool
method fwrite (line 298) | protected function fwrite(string $data): int|bool
method streamGetMetadata (line 312) | protected function streamGetMetadata(): array|bool
method validateTimeout (line 321) | private function validateTimeout(float $value): void
method connectIfNotConnected (line 328) | private function connectIfNotConnected(): void
method generateDataStream (line 336) | protected function generateDataStream(LogRecord $record): string
method getResource (line 344) | protected function getResource()
method connect (line 349) | private function connect(): void
method createSocketResource (line 356) | private function createSocketResource(): void
method setSocketTimeout (line 369) | private function setSocketTimeout(): void
method setStreamChunkSize (line 376) | private function setStreamChunkSize(): void
method writeToSocket (line 383) | private function writeToSocket(string $data): void
method writingIsTimedOut (line 412) | private function writingIsTimedOut(int $sent): bool
FILE: src/Monolog/Handler/SqsHandler.php
class SqsHandler (line 24) | class SqsHandler extends AbstractProcessingHandler
method __construct (line 34) | public function __construct(SqsClient $sqsClient, string $queueUrl, in...
method write (line 45) | protected function write(LogRecord $record): void
FILE: src/Monolog/Handler/StreamHandler.php
class StreamHandler (line 25) | class StreamHandler extends AbstractProcessingHandler
method __construct (line 51) | public function __construct($stream, int|string|Level $level = Level::...
method reset (line 86) | public function reset(): void
method close (line 100) | public function close(): void
method getStream (line 114) | public function getStream()
method getUrl (line 122) | public function getUrl(): ?string
method getStreamChunkSize (line 127) | public function getStreamChunkSize(): int
method write (line 135) | protected function write(LogRecord $record): void
method streamWrite (line 208) | protected function streamWrite($stream, LogRecord $record): void
method customErrorHandler (line 216) | private function customErrorHandler(int $code, string $msg): bool
method getDirFromStream (line 223) | private function getDirFromStream(string $stream): ?string
method createDir (line 237) | private function createDir(string $url): void
method getInodeFromUrl (line 259) | private function getInodeFromUrl(): ?int
method hasUrlInodeWasChanged (line 270) | private function hasUrlInodeWasChanged(): bool
FILE: src/Monolog/Handler/SymfonyMailerHandler.php
class SymfonyMailerHandler (line 29) | class SymfonyMailerHandler extends MailHandler
method __construct (line 41) | public function __construct($mailer, Email|Closure $email, int|string|...
method send (line 52) | protected function send(string $content, array $records): void
method getSubjectFormatter (line 62) | protected function getSubjectFormatter(?string $format): FormatterInte...
method buildMessage (line 73) | protected function buildMessage(string $content, array $records): Email
FILE: src/Monolog/Handler/SyslogHandler.php
class SyslogHandler (line 30) | class SyslogHandler extends AbstractSyslogHandler
method __construct (line 39) | public function __construct(string $ident, string|int $facility = LOG_...
method close (line 50) | public function close(): void
method write (line 58) | protected function write(LogRecord $record): void
FILE: src/Monolog/Handler/SyslogUdp/UdpSocket.php
class UdpSocket (line 17) | class UdpSocket
method __construct (line 25) | public function __construct(string $ip, int $port = 514)
method write (line 31) | public function write(string $line, string $header = ""): void
method close (line 36) | public function close(): void
method getSocket (line 44) | protected function getSocket(): Socket
method send (line 66) | protected function send(string $chunk): void
method assembleMessage (line 71) | protected function assembleMessage(string $line, string $header): string
FILE: src/Monolog/Handler/SyslogUdpHandler.php
class SyslogUdpHandler (line 26) | class SyslogUdpHandler extends AbstractSyslogHandler
method __construct (line 55) | public function __construct(string $host, int $port = 514, string|int ...
method write (line 69) | protected function write(LogRecord $record): void
method close (line 80) | public function close(): void
method splitMessageIntoLines (line 89) | private function splitMessageIntoLines($message): array
method makeCommonSyslogHeader (line 108) | protected function makeCommonSyslogHeader(int $severity, DateTimeInter...
method setSocket (line 148) | public function setSocket(UdpSocket $socket): self
FILE: src/Monolog/Handler/TelegramBotHandler.php
class TelegramBotHandler (line 37) | class TelegramBotHandler extends AbstractProcessingHandler
method __construct (line 109) | public function __construct(
method setParseMode (line 140) | public function setParseMode(string|null $parseMode = null): self
method disableWebPagePreview (line 154) | public function disableWebPagePreview(bool|null $disableWebPagePreview...
method disableNotification (line 164) | public function disableNotification(bool|null $disableNotification = n...
method splitLongMessages (line 177) | public function splitLongMessages(bool $splitLongMessages = false): self
method delayBetweenMessages (line 189) | public function delayBetweenMessages(bool $delayBetweenMessages = fals...
method setTopic (line 199) | public function setTopic(?int $topic = null): self
method handleBatch (line 209) | public function handleBatch(array $records): void
method write (line 233) | protected function write(LogRecord $record): void
method send (line 241) | protected function send(string $message): void
method sendCurl (line 254) | protected function sendCurl(string $message): void
method handleMessageLength (line 292) | private function handleMessageLength(string $message): array
FILE: src/Monolog/Handler/TestHandler.php
class TestHandler (line 72) | class TestHandler extends AbstractProcessingHandler
method getRecords (line 83) | #[NoDiscard]
method clear (line 89) | public function clear(): void
method reset (line 95) | public function reset(): void
method setSkipReset (line 102) | public function setSkipReset(bool $skipReset): void
method hasRecords (line 112) | #[NoDiscard]
method hasRecord (line 123) | #[NoDiscard]
method hasRecordThatContains (line 142) | #[NoDiscard]
method hasRecordThatMatches (line 148) | #[NoDiscard]
method hasRecordThatPasses (line 157) | #[NoDiscard]
method write (line 178) | protected function write(LogRecord $record): void
method __call (line 187) | #[NoDiscard]
FILE: src/Monolog/Handler/WebRequestRecognizerTrait.php
type WebRequestRecognizerTrait (line 14) | trait WebRequestRecognizerTrait
method isWebRequest (line 19) | protected function isWebRequest(): bool
FILE: src/Monolog/Handler/WhatFailureGroupHandler.php
class WhatFailureGroupHandler (line 23) | class WhatFailureGroupHandler extends GroupHandler
method handle (line 28) | public function handle(LogRecord $record): bool
method handleBatch (line 48) | public function handleBatch(array $records): void
method close (line 70) | public function close(): void
FILE: src/Monolog/Handler/ZendMonitorHandler.php
class ZendMonitorHandler (line 25) | class ZendMonitorHandler extends AbstractProcessingHandler
method __construct (line 30) | public function __construct(int|string|Level $level = Level::Debug, bo...
method toZendMonitorLevel (line 44) | protected function toZendMonitorLevel(Level $level): int
method write (line 61) | protected function write(LogRecord $record): void
method writeZendMonitorCustomEvent (line 78) | protected function writeZendMonitorCustomEvent(string $type, string $m...
method getDefaultFormatter (line 86) | public function getDefaultFormatter(): FormatterInterface
FILE: src/Monolog/JsonSerializableDateTimeImmutable.php
class JsonSerializableDateTimeImmutable (line 22) | class JsonSerializableDateTimeImmutable extends \DateTimeImmutable imple...
method __construct (line 26) | public function __construct(bool $useMicroseconds, ?DateTimeZone $time...
method jsonSerialize (line 35) | public function jsonSerialize(): string
method __toString (line 44) | public function __toString(): string
FILE: src/Monolog/Level.php
method fromName (line 88) | public static function fromName(string $name): self
method fromValue (line 106) | public static function fromValue(int $value): self
method includes (line 114) | public function includes(Level $level): bool
method isHigherThan (line 119) | public function isHigherThan(Level $level): bool
method isLowerThan (line 124) | public function isLowerThan(Level $level): bool
method getName (line 136) | public function getName(): string
method toPsrLogLevel (line 155) | public function toPsrLogLevel(): string
method toRFC5424Level (line 174) | public function toRFC5424Level(): int
FILE: src/Monolog/LogRecord.php
class LogRecord (line 22) | class LogRecord implements ArrayAccess
method __construct (line 29) | public function __construct(
method offsetSet (line 42) | public function offsetSet(mixed $offset, mixed $value): void
method offsetExists (line 63) | public function offsetExists(mixed $offset): bool
method offsetUnset (line 72) | public function offsetUnset(mixed $offset): void
method offsetGet (line 77) | public function &offsetGet(mixed $offset): mixed
method toArray (line 106) | public function toArray(): array
method with (line 119) | public function with(mixed ...$args): self
FILE: src/Monolog/Logger.php
class Logger (line 35) | class Logger implements LoggerInterface, ResettableInterface
method __construct (line 175) | public function __construct(string $name, array $handlers = [], array ...
method getName (line 184) | public function getName(): string
method withName (line 194) | public function withName(string $name): self
method pushHandler (line 207) | public function pushHandler(HandlerInterface $handler): self
method popHandler (line 219) | public function popHandler(): HandlerInterface
method setHandlers (line 236) | public function setHandlers(array $handlers): self
method getHandlers (line 249) | public function getHandlers(): array
method pushProcessor (line 260) | public function pushProcessor(ProcessorInterface|callable $callback): ...
method popProcessor (line 273) | public function popProcessor(): callable
method getProcessors (line 286) | public function getProcessors(): array
method useMicrosecondTimestamps (line 303) | public function useMicrosecondTimestamps(bool $micro): self
method useLoggingLoopDetection (line 313) | public function useLoggingLoopDetection(bool $detectCycles): self
method addRecord (line 332) | public function addRecord(int|Level $level, string $message, array $co...
method close (line 423) | public function close(): void
method reset (line 440) | public function reset(): void
method getLevelName (line 467) | public static function getLevelName(int|Level $level): string
method toMonologLevel (line 480) | public static function toMonologLevel(string|int|Level $level): Level
method isHandling (line 519) | public function isHandling(int|string|Level $level): bool
method setExceptionHandler (line 544) | public function setExceptionHandler(Closure|null $callback): self
method getExceptionHandler (line 551) | public function getExceptionHandler(): Closure|null
method log (line 567) | public function log($level, string|\Stringable $message, array $contex...
method debug (line 592) | public function debug(string|\Stringable $message, array $context = []...
method info (line 605) | public function info(string|\Stringable $message, array $context = [])...
method notice (line 618) | public function notice(string|\Stringable $message, array $context = [...
method warning (line 631) | public function warning(string|\Stringable $message, array $context = ...
method error (line 644) | public function error(string|\Stringable $message, array $context = []...
method critical (line 657) | public function critical(string|\Stringable $message, array $context =...
method alert (line 670) | public function alert(string|\Stringable $message, array $context = []...
method emergency (line 683) | public function emergency(string|\Stringable $message, array $context ...
method setTimezone (line 693) | public function setTimezone(DateTimeZone $tz): self
method getTimezone (line 703) | public function getTimezone(): DateTimeZone
method handleException (line 712) | protected function handleException(Throwable $e, LogRecord $record): void
method __serialize (line 724) | public function __serialize(): array
method __unserialize (line 741) | public function __unserialize(array $data): void
FILE: src/Monolog/Processor/ClosureContextProcessor.php
class ClosureContextProcessor (line 27) | class ClosureContextProcessor implements ProcessorInterface
method __invoke (line 29) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/GitProcessor.php
class GitProcessor (line 25) | class GitProcessor implements ProcessorInterface
method __construct (line 36) | public function __construct(int|string|Level $level = Level::Debug)
method __invoke (line 44) | public function __invoke(LogRecord $record): LogRecord
method getGitInfo (line 59) | private static function getGitInfo(): array
FILE: src/Monolog/Processor/HostnameProcessor.php
class HostnameProcessor (line 19) | class HostnameProcessor implements ProcessorInterface
method __construct (line 23) | public function __construct()
method __invoke (line 31) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/IntrospectionProcessor.php
class IntrospectionProcessor (line 30) | class IntrospectionProcessor implements ProcessorInterface
method __construct (line 54) | public function __construct(int|string|Level $level = Level::Debug, ar...
method __invoke (line 64) | public function __invoke(LogRecord $record): LogRecord
method isTraceClassOrSkippedFunction (line 118) | private function isTraceClassOrSkippedFunction(array $trace, int $inde...
FILE: src/Monolog/Processor/LoadAverageProcessor.php
class LoadAverageProcessor (line 21) | class LoadAverageProcessor implements ProcessorInterface
method __construct (line 41) | public function __construct(int $avgSystemLoad = self::LOAD_1_MINUTE)
method __invoke (line 52) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/MemoryPeakUsageProcessor.php
class MemoryPeakUsageProcessor (line 22) | class MemoryPeakUsageProcessor extends MemoryProcessor
method __invoke (line 27) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/MemoryProcessor.php
class MemoryProcessor (line 19) | abstract class MemoryProcessor implements ProcessorInterface
method __construct (line 35) | public function __construct(bool $realUsage = true, bool $useFormattin...
method formatBytes (line 46) | protected function formatBytes(int $bytes)
FILE: src/Monolog/Processor/MemoryUsageProcessor.php
class MemoryUsageProcessor (line 22) | class MemoryUsageProcessor extends MemoryProcessor
method __invoke (line 27) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/MercurialProcessor.php
class MercurialProcessor (line 24) | class MercurialProcessor implements ProcessorInterface
method __construct (line 35) | public function __construct(int|string|Level $level = Level::Debug)
method __invoke (line 43) | public function __invoke(LogRecord $record): LogRecord
method getMercurialInfo (line 58) | private static function getMercurialInfo(): array
FILE: src/Monolog/Processor/ProcessIdProcessor.php
class ProcessIdProcessor (line 21) | class ProcessIdProcessor implements ProcessorInterface
method __invoke (line 26) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/ProcessorInterface.php
type ProcessorInterface (line 21) | interface ProcessorInterface
method __invoke (line 26) | public function __invoke(LogRecord $record);
FILE: src/Monolog/Processor/PsrLogMessageProcessor.php
class PsrLogMessageProcessor (line 24) | class PsrLogMessageProcessor implements ProcessorInterface
method __construct (line 36) | public function __construct(?string $dateFormat = null, bool $removeUs...
method __invoke (line 45) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/TagProcessor.php
class TagProcessor (line 21) | class TagProcessor implements ProcessorInterface
method __construct (line 29) | public function __construct(array $tags = [])
method addTags (line 38) | public function addTags(array $tags = []): self
method setTags (line 49) | public function setTags(array $tags = []): self
method __invoke (line 59) | public function __invoke(LogRecord $record): LogRecord
FILE: src/Monolog/Processor/UidProcessor.php
class UidProcessor (line 22) | class UidProcessor implements ProcessorInterface, ResettableInterface
method __construct (line 30) | public function __construct(int $length = 7)
method __invoke (line 42) | public function __invoke(LogRecord $record): LogRecord
method getUid (line 49) | public function getUid(): string
method reset (line 54) | public function reset(): void
method generateUid (line 63) | private function generateUid(int $length): string
FILE: src/Monolog/Processor/WebProcessor.php
class WebProcessor (line 22) | class WebProcessor implements ProcessorInterface
method __construct (line 49) | public function __construct(array|ArrayAccess|null $serverData = null,...
method __invoke (line 80) | public function __invoke(LogRecord $record): LogRecord
method addExtraField (line 96) | public function addExtraField(string $extraName, string $serverName): ...
method appendExtraFields (line 107) | private function appendExtraFields(array $extra): array
FILE: src/Monolog/Registry.php
class Registry (line 38) | class Registry
method addLogger (line 55) | public static function addLogger(Logger $logger, ?string $name = null,...
method hasLogger (line 71) | public static function hasLogger($logger): bool
method removeLogger (line 87) | public static function removeLogger($logger): void
method clear (line 101) | public static function clear(): void
method getInstance (line 112) | public static function getInstance(string $name): Logger
method __callStatic (line 129) | public static function __callStatic(string $name, array $arguments): L...
FILE: src/Monolog/ResettableInterface.php
type ResettableInterface (line 28) | interface ResettableInterface
method reset (line 30) | public function reset(): void;
FILE: src/Monolog/SignalHandler.php
class SignalHandler (line 23) | class SignalHandler
method __construct (line 34) | public function __construct(LoggerInterface $logger)
method registerSignalHandler (line 45) | public function registerSignalHandler(int $signo, int|string|Level $le...
method handleSignal (line 74) | public function handleSignal(int $signo, $siginfo = null): void
FILE: src/Monolog/Test/MonologTestCase.php
class MonologTestCase (line 26) | class MonologTestCase extends \PHPUnit\Framework\TestCase
method getRecord (line 34) | protected function getRecord(int|string|Level $level = Level::Warning,...
method getMultipleRecords (line 49) | protected function getMultipleRecords(): array
method getIdentityFormatter (line 60) | protected function getIdentityFormatter(): FormatterInterface
FILE: src/Monolog/Test/TestCase.php
class TestCase (line 21) | class TestCase extends MonologTestCase
FILE: src/Monolog/Utils.php
class Utils (line 14) | final class Utils
method getClass (line 18) | public static function getClass(object $object): string
method substr (line 33) | public static function substr(string $string, int $start, ?int $length...
method canonicalizePath (line 47) | public static function canonicalizePath(string $streamUrl): string
method jsonEncode (line 79) | public static function jsonEncode($data, ?int $encodeFlags = null, boo...
method handleJsonError (line 116) | public static function handleJsonError(int $code, $data, ?int $encodeF...
method throwEncodeError (line 150) | private static function throwEncodeError(int $code, $data): never
method detectAndCleanUtf8 (line 178) | private static function detectAndCleanUtf8(&$data): void
method expandIniShorthandBytes (line 209) | public static function expandIniShorthandBytes($val)
method getRecordMessageForException (line 239) | public static function getRecordMessageForException(LogRecord $record)...
FILE: tests/Monolog/Attribute/AsMonologProcessorTest.php
class AsMonologProcessorTest (line 17) | final class AsMonologProcessorTest extends \Monolog\Test\MonologTestCase
method test (line 19) | public function test(): void
FILE: tests/Monolog/Attribute/WithMonologChannelTest.php
class WithMonologChannelTest (line 14) | class WithMonologChannelTest extends \Monolog\Test\MonologTestCase
method test (line 16) | public function test(): void
FILE: tests/Monolog/ErrorHandlerTest.php
class ErrorHandlerTest (line 19) | class ErrorHandlerTest extends \PHPUnit\Framework\TestCase
method testRegister (line 21) | public function testRegister()
method testHandleError (line 28) | #[WithoutErrorHandler]
method fatalHandlerProvider (line 59) | public static function fatalHandlerProvider()
method getPrivatePropertyValue (line 67) | protected function getPrivatePropertyValue($instance, $property)
method testFatalHandler (line 75) | #[DataProvider('fatalHandlerProvider')]
method testHandleException (line 93) | #[WithoutErrorHandler]
method testCodeToString (line 114) | public function testCodeToString()
class CustomTestException (line 138) | class CustomTestException extends \Exception
class CustomCustomException (line 141) | class CustomCustomException extends CustomTestException
FILE: tests/Monolog/Formatter/ChromePHPFormatterTest.php
class ChromePHPFormatterTest (line 17) | class ChromePHPFormatterTest extends MonologTestCase
method testDefaultFormat (line 22) | public function testDefaultFormat()
method testFormatWithFileAndLine (line 54) | public function testFormatWithFileAndLine()
method testFormatWithoutContext (line 86) | public function testFormatWithoutContext()
method testBatchFormatThrowException (line 112) | public function testBatchFormatThrowException()
FILE: tests/Monolog/Formatter/ElasticaFormatterTest.php
class ElasticaFormatterTest (line 17) | class ElasticaFormatterTest extends MonologTestCase
method setUp (line 19) | public function setUp(): void
method testFormat (line 31) | public function testFormat()
method testGetters (line 73) | public function testGetters()
FILE: tests/Monolog/Formatter/ElasticsearchFormatterTest.php
class ElasticsearchFormatterTest (line 17) | class ElasticsearchFormatterTest extends MonologTestCase
method testFormat (line 24) | public function testFormat()
method testGetters (line 63) | public function testGetters()
FILE: tests/Monolog/Formatter/FlowdockFormatterTest.php
class FlowdockFormatterTest (line 17) | class FlowdockFormatterTest extends MonologTestCase
method testFormat (line 22) | public function testFormat()
method testFormatBatch (line 43) | public function testFormatBatch()
FILE: tests/Monolog/Formatter/FluentdFormatterTest.php
class FluentdFormatterTest (line 17) | class FluentdFormatterTest extends MonologTestCase
method testConstruct (line 23) | public function testConstruct()
method testFormat (line 36) | public function testFormat()
method testFormatWithTag (line 50) | public function testFormatWithTag()
FILE: tests/Monolog/Formatter/GelfMessageFormatterTest.php
class GelfMessageFormatterTest (line 17) | class GelfMessageFormatterTest extends MonologTestCase
method setUp (line 19) | public function setUp(): void
method testDefaultFormatter (line 29) | public function testDefaultFormatter()
method testFormatWithFileAndLine (line 61) | public function testFormatWithFileAndLine()
method testFormatWithContext (line 83) | public function testFormatWithContext()
method testFormatWithContextContainingException (line 127) | public function testFormatWithContextContainingException()
method testFormatWithExtra (line 153) | public function testFormatWithExtra()
method testFormatWithLargeData (line 194) | public function testFormatWithLargeData()
method testFormatWithUnlimitedLength (line 220) | public function testFormatWithUnlimitedLength()
method testFormatWithLargeCyrillicData (line 246) | public function testFormatWithLargeCyrillicData()
method isLegacy (line 265) | private function isLegacy()
FILE: tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php
class GoogleCloudLoggingFormatterTest (line 18) | class GoogleCloudLoggingFormatterTest extends MonologTestCase
method formatProvidesRfc3339Timestamps (line 26) | public function formatProvidesRfc3339Timestamps(): void
method formatIntroducesLogSeverity (line 43) | public function formatIntroducesLogSeverity(): void
FILE: tests/Monolog/Formatter/JsonFormatterTest.php
class JsonFormatterTest (line 20) | class JsonFormatterTest extends MonologTestCase
method testConstruct (line 27) | public function testConstruct()
method testFormat (line 40) | public function testFormat()
method testFormatWithPrettyPrint (line 54) | public function testFormatWithPrettyPrint()
method testFormatBatch (line 86) | public function testFormatBatch()
method testFormatBatchNewlines (line 101) | public function testFormatBatchNewlines()
method testDefFormatWithException (line 112) | public function testDefFormatWithException()
method testBasePathWithException (line 123) | public function testBasePathWithException(): void
method testDefFormatWithPreviousException (line 135) | public function testDefFormatWithPreviousException()
method testDefFormatWithThrowable (line 147) | public function testDefFormatWithThrowable()
method testMaxNormalizeDepth (line 158) | public function testMaxNormalizeDepth()
method testMaxNormalizeItemCountWith0ItemsMax (line 169) | public function testMaxNormalizeItemCountWith0ItemsMax()
method testMaxNormalizeItemCountWith2ItemsMax (line 184) | public function testMaxNormalizeItemCountWith2ItemsMax()
method testDefFormatWithResource (line 199) | public function testDefFormatWithResource()
method assertContextContainsFormattedException (line 211) | private function assertContextContainsFormattedException(string $expec...
method formatRecordWithExceptionInContext (line 219) | private function formatRecordWithExceptionInContext(JsonFormatter $for...
method formatExceptionFilePathWithLine (line 235) | private function formatExceptionFilePathWithLine($exception): string
method formatException (line 246) | private function formatException($exception, ?string $previous = null)...
method testNormalizeHandleLargeArraysWithExactly1000Items (line 259) | public function testNormalizeHandleLargeArraysWithExactly1000Items()
method testNormalizeHandleLargeArrays (line 275) | public function testNormalizeHandleLargeArrays()
method testCanNormalizeIncompleteObject (line 291) | public function testCanNormalizeIncompleteObject(): void
method testEmptyContextAndExtraFieldsCanBeIgnored (line 303) | public function testEmptyContextAndExtraFieldsCanBeIgnored()
method testFormatObjects (line 320) | public function testFormatObjects()
method testNormalizeHandleExceptionInToString (line 343) | public function testNormalizeHandleExceptionInToString(): void
class TestJsonNormPublic (line 362) | class TestJsonNormPublic
class TestJsonNormPrivate (line 367) | class TestJsonNormPrivate
class TestJsonNormWithToStringAndJson (line 372) | class TestJsonNormWithToStringAndJson implements JsonSerializable
method jsonSerialize (line 374) | public function jsonSerialize(): mixed
method __toString (line 379) | public function __toString()
class TestJsonNormWithToString (line 385) | class TestJsonNormWithToString
method __toString (line 387) | public function __toString()
class TestJsonNormWithFailingToString (line 393) | class TestJsonNormWithFailingToString
method __toString (line 395) | public function __toString()
FILE: tests/Monolog/Formatter/LineFormatterTest.php
class LineFormatterTest (line 22) | class LineFormatterTest extends MonologTestCase
method testDefFormatWithString (line 24) | public function testDefFormatWithString()
method testDefFormatWithArrayContext (line 35) | public function testDefFormatWithArrayContext()
method testDefFormatExtras (line 52) | public function testDefFormatExtras()
method testFormatExtras (line 64) | public function testFormatExtras()
method testContextAndExtraOptionallyNotShownIfEmpty (line 76) | public function testContextAndExtraOptionallyNotShownIfEmpty()
method testContextAndExtraReplacement (line 87) | public function testContextAndExtraReplacement()
method testDefFormatWithObject (line 101) | public function testDefFormatWithObject()
method testDefFormatWithException (line 115) | public function testDefFormatWithException()
method testDefFormatWithExceptionAndStacktrace (line 130) | public function testDefFormatWithExceptionAndStacktrace()
method testInlineLineBreaksRespectsEscapedBackslashes (line 146) | public function testInlineLineBreaksRespectsEscapedBackslashes()
method testDefFormatWithExceptionAndStacktraceParserFull (line 156) | public function testDefFormatWithExceptionAndStacktraceParserFull()
method testDefFormatWithExceptionAndStacktraceParserCustom (line 171) | public function testDefFormatWithExceptionAndStacktraceParserCustom()
method testDefFormatWithExceptionAndStacktraceParserEmpty (line 188) | public function testDefFormatWithExceptionAndStacktraceParserEmpty()
method testDefFormatWithPreviousException (line 200) | public function testDefFormatWithPreviousException()
method testDefFormatWithSoapFaultException (line 216) | public function testDefFormatWithSoapFaultException()
method testBatchFormat (line 246) | public function testBatchFormat()
method testFormatShouldStripInlineLineBreaks (line 264) | public function testFormatShouldStripInlineLineBreaks()
method testFormatShouldNotStripInlineLineBreaksWhenFlagIsSet (line 272) | public function testFormatShouldNotStripInlineLineBreaksWhenFlagIsSet()
method testIndentStackTraces (line 280) | public function testIndentStackTraces(): void
method testBasePath (line 293) | public function testBasePath(): void
method testMaxLevelNameLength (line 306) | #[DataProvider('providerMaxLevelNameLength')]
method providerMaxLevelNameLength (line 316) | public static function providerMaxLevelNameLength(): array
class TestFoo (line 340) | class TestFoo
class TestBar (line 345) | class TestBar
method __toString (line 347) | public function __toString()
FILE: tests/Monolog/Formatter/LogglyFormatterTest.php
class LogglyFormatterTest (line 16) | class LogglyFormatterTest extends MonologTestCase
method testConstruct (line 21) | public function testConstruct()
method testFormat (line 32) | public function testFormat()
FILE: tests/Monolog/Formatter/LogmaticFormatterTest.php
class LogmaticFormatterTest (line 19) | class LogmaticFormatterTest extends MonologTestCase
method testFormat (line 24) | public function testFormat()
FILE: tests/Monolog/Formatter/LogstashFormatterTest.php
class LogstashFormatterTest (line 17) | class LogstashFormatterTest extends MonologTestCase
method testDefaultFormatterV1 (line 22) | public function testDefaultFormatterV1()
method testFormatWithFileAndLineV1 (line 53) | public function testFormatWithFileAndLineV1()
method testFormatWithContextV1 (line 74) | public function testFormatWithContextV1()
method testFormatWithExtraV1 (line 104) | public function testFormatWithExtraV1()
method testFormatWithApplicationNameV1 (line 131) | public function testFormatWithApplicationNameV1()
method testFormatWithLatin9Data (line 149) | public function testFormatWithLatin9Data()
FILE: tests/Monolog/Formatter/MongoDBFormatterTest.php
class MongoDBFormatterTest (line 24) | #[RequiresPhpExtension('mongodb')]
method constructArgumentProvider (line 27) | public static function constructArgumentProvider()
method testConstruct (line 35) | #[DataProvider('constructArgumentProvider')]
method testSimpleFormat (line 47) | public function testSimpleFormat()
method testRecursiveFormat (line 70) | public function testRecursiveFormat()
method testFormatDepthArray (line 116) | public function testFormatDepthArray()
method testFormatDepthArrayInfiniteNesting (line 148) | public function testFormatDepthArrayInfiniteNesting()
method testFormatDepthObjects (line 187) | public function testFormatDepthObjects()
method testFormatDepthException (line 220) | public function testFormatDepthException()
method testBsonTypes (line 240) | public function testBsonTypes()
FILE: tests/Monolog/Formatter/NormalizerFormatterTest.php
class NormalizerFormatterTest (line 19) | class NormalizerFormatterTest extends \Monolog\Test\MonologTestCase
method testFormat (line 21) | public function testFormat()
method testFormatExceptions (line 60) | public function testFormatExceptions()
method testFormatExceptionWithBasePath (line 83) | public function testFormatExceptionWithBasePath(): void
method testFormatSoapFaultException (line 97) | public function testFormatSoapFaultException()
method testFormatToStringExceptionHandle (line 144) | public function testFormatToStringExceptionHandle()
method testBatchFormat (line 168) | public function testBatchFormat()
method testIgnoresRecursiveObjectReferences (line 200) | public function testIgnoresRecursiveObjectReferences()
method testCanNormalizeReferences (line 229) | public function testCanNormalizeReferences()
method testToJsonIgnoresInvalidTypes (line 238) | public function testToJsonIgnoresInvalidTypes()
method testNormalizeHandleLargeArraysWithExactly1000Items (line 263) | public function testNormalizeHandleLargeArraysWithExactly1000Items()
method testNormalizeHandleLargeArrays (line 279) | public function testNormalizeHandleLargeArrays()
method testIgnoresInvalidEncoding (line 295) | public function testIgnoresInvalidEncoding()
method testConvertsInvalidEncodingAsLatin9 (line 307) | public function testConvertsInvalidEncodingAsLatin9()
method testMaxNormalizeDepth (line 317) | public function testMaxNormalizeDepth()
method testMaxNormalizeItemCountWith0ItemsMax (line 330) | public function testMaxNormalizeItemCountWith0ItemsMax()
method testMaxNormalizeItemCountWith2ItemsMax (line 344) | public function testMaxNormalizeItemCountWith2ItemsMax()
method testExceptionTraceWithArgs (line 369) | public function testExceptionTraceWithArgs()
method formatRecordWithExceptionInContext (line 398) | private function formatRecordWithExceptionInContext(NormalizerFormatte...
method testExceptionTraceDoesNotLeakCallUserFuncArgs (line 410) | public function testExceptionTraceDoesNotLeakCallUserFuncArgs()
method testCanNormalizeIncompleteObject (line 428) | public function testCanNormalizeIncompleteObject(): void
method testMaxTraceLengthDefault (line 442) | public function testMaxTraceLengthDefault()
method testMaxTraceLengthSetter (line 448) | public function testMaxTraceLengthSetter()
method testMaxTraceLengthLimitsTrace (line 458) | public function testMaxTraceLengthLimitsTrace()
method testMaxTraceLengthZeroDoesNotIncludeTrace (line 470) | public function testMaxTraceLengthZeroDoesNotIncludeTrace()
method testMaxTraceLengthNullAllowsUnlimited (line 481) | public function testMaxTraceLengthNullAllowsUnlimited()
method testMaxTraceLengthWithPreviousException (line 493) | public function testMaxTraceLengthWithPreviousException()
method testMaxTraceLengthWithBasePath (line 509) | public function testMaxTraceLengthWithBasePath()
method createDeepTraceException (line 526) | private function createDeepTraceException(): \Exception
method throwHelper (line 538) | private function throwHelper($arg)
class TestFooNorm (line 544) | class TestFooNorm
class TestBarNorm (line 549) | class TestBarNorm
method __toString (line 551) | public function __toString()
class TestStreamFoo (line 557) | class TestStreamFoo
method __construct (line 562) | public function __construct($resource)
method __toString (line 568) | public function __toString()
class TestToStringError (line 576) | class TestToStringError
method __toString (line 578) | public function __toString()
class TestInfoLeak (line 584) | class TestInfoLeak
method __toString (line 586) | public function __toString()
FILE: tests/Monolog/Formatter/ScalarFormatterTest.php
class ScalarFormatterTest (line 16) | class ScalarFormatterTest extends \Monolog\Test\MonologTestCase
method setUp (line 20) | public function setUp(): void
method tearDown (line 25) | public function tearDown(): void
method buildTrace (line 32) | public function buildTrace(\Exception $e)
method encodeJson (line 45) | public function encodeJson($data)
method testFormat (line 50) | public function testFormat()
method testFormatWithErrorContext (line 80) | public function testFormatWithErrorContext()
method testFormatWithExceptionContext (line 90) | public function testFormatWithExceptionContext()
FILE: tests/Monolog/Formatter/SyslogFormatterTest.php
class SyslogFormatterTest (line 19) | class SyslogFormatterTest extends \Monolog\Test\MonologTestCase
method testFormat (line 25) | #[DataProvider('formatDataProvider')]
method formatDataProvider (line 59) | public static function formatDataProvider(): array
FILE: tests/Monolog/Formatter/WildfireFormatterTest.php
class WildfireFormatterTest (line 16) | class WildfireFormatterTest extends \Monolog\Test\MonologTestCase
method testDefaultFormat (line 21) | public function testDefaultFormat()
method testFormatWithFileAndLine (line 44) | public function testFormatWithFileAndLine()
method testFormatWithoutContext (line 67) | public function testFormatWithoutContext()
method testBatchFormatThrowException (line 87) | public function testBatchFormatThrowException()
method testTableFormat (line 104) | public function testTableFormat()
FILE: tests/Monolog/Handler/AbstractHandlerTest.php
class AbstractHandlerTest (line 16) | class AbstractHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructAndGetSet (line 25) | public function testConstructAndGetSet()
method testHandleBatch (line 40) | public function testHandleBatch()
method testIsHandling (line 51) | public function testIsHandling()
method testHandlesPsrStyleLevels (line 61) | public function testHandlesPsrStyleLevels()
FILE: tests/Monolog/Handler/AbstractProcessingHandlerTest.php
class AbstractProcessingHandlerTest (line 18) | class AbstractProcessingHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructAndGetSet (line 24) | public function testConstructAndGetSet()
method testHandleLowerLevelMessage (line 34) | public function testHandleLowerLevelMessage()
method testHandleBubbling (line 43) | public function testHandleBubbling()
method testHandleNotBubbling (line 52) | public function testHandleNotBubbling()
method testHandleIsFalseWhenNotHandled (line 61) | public function testHandleIsFalseWhenNotHandled()
method testProcessRecord (line 71) | public function testProcessRecord()
method testPushPopProcessor (line 96) | public function testPushPopProcessor()
method testPushProcessorWithNonCallable (line 116) | public function testPushProcessorWithNonCallable()
method testGetFormatterInitializesDefault (line 129) | public function testGetFormatterInitializesDefault()
FILE: tests/Monolog/Handler/AmqpHandlerTest.php
class AmqpHandlerTest (line 20) | class AmqpHandlerTest extends \Monolog\Test\MonologTestCase
method testHandleAmqpExt (line 22) | public function testHandleAmqpExt()
method testHandlePhpAmqpLib (line 78) | public function testHandlePhpAmqpLib()
FILE: tests/Monolog/Handler/BrowserConsoleHandlerTest.php
class BrowserConsoleHandlerTest (line 19) | class BrowserConsoleHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 21) | protected function setUp(): void
method generateScript (line 26) | protected function generateScript()
method testStyling (line 33) | public function testStyling()
method testStylingMultiple (line 49) | public function testStylingMultiple()
method testEscaping (line 65) | public function testEscaping()
method testAutolabel (line 81) | public function testAutolabel()
method testContext (line 101) | public function testContext()
method testConcurrentHandlers (line 121) | public function testConcurrentHandlers()
FILE: tests/Monolog/Handler/BufferHandlerTest.php
class BufferHandlerTest (line 16) | class BufferHandlerTest extends \Monolog\Test\MonologTestCase
method testHandleBuffers (line 25) | public function testHandleBuffers()
method testPropagatesRecordsAtEndOfRequest (line 42) | public function testPropagatesRecordsAtEndOfRequest()
method checkPropagation (line 52) | public function checkPropagation()
method testHandleBufferLimit (line 63) | public function testHandleBufferLimit()
method testHandleBufferLimitWithFlushOnOverflow (line 80) | public function testHandleBufferLimitWithFlushOnOverflow()
method testHandleLevel (line 110) | public function testHandleLevel()
method testFlush (line 127) | public function testFlush()
method testHandleUsesProcessors (line 142) | public function testHandleUsesProcessors()
method testSetHandler (line 158) | public function testSetHandler()
FILE: tests/Monolog/Handler/ChromePHPHandlerTest.php
class ChromePHPHandlerTest (line 20) | class ChromePHPHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 22) | protected function setUp(): void
method testHeaders (line 28) | #[DataProvider('agentsProvider')]
method agentsProvider (line 53) | public static function agentsProvider()
method testHeadersOverflow (line 63) | public function testHeadersOverflow()
method testConcurrentHandlers (line 103) | public function testConcurrentHandlers()
class TestChromePHPHandler (line 133) | class TestChromePHPHandler extends ChromePHPHandler
method resetStatic (line 137) | public static function resetStatic(): void
method sendHeader (line 145) | protected function sendHeader(string $header, string $content): void
method getHeaders (line 150) | public function getHeaders(): array
method isWebRequest (line 155) | protected function isWebRequest(): bool
FILE: tests/Monolog/Handler/CouchDBHandlerTest.php
class CouchDBHandlerTest (line 16) | class CouchDBHandlerTest extends \Monolog\Test\MonologTestCase
method testHandle (line 18) | public function testHandle()
FILE: tests/Monolog/Handler/DeduplicationHandlerTest.php
class DeduplicationHandlerTest (line 16) | class DeduplicationHandlerTest extends \Monolog\Test\MonologTestCase
method testFlushPassthruIfAllRecordsUnderTrigger (line 21) | public function testFlushPassthruIfAllRecordsUnderTrigger()
method testFlushPassthruIfEmptyLog (line 41) | public function testFlushPassthruIfEmptyLog()
method testFlushSkipsIfLogExists (line 63) | public function testFlushSkipsIfLogExists()
method testFlushPassthruIfLogTooOld (line 84) | public function testFlushPassthruIfLogTooOld()
method testGcOldLogs (line 107) | public function testGcOldLogs()
method tearDownAfterClass (line 155) | public static function tearDownAfterClass(): void
FILE: tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php
class DoctrineCouchDBHandlerTest (line 16) | class DoctrineCouchDBHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 18) | protected function setUp(): void
method testHandle (line 25) | public function testHandle()
FILE: tests/Monolog/Handler/DynamoDbHandlerTest.php
class DynamoDbHandlerTest (line 17) | class DynamoDbHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 23) | public function setUp(): void
method tearDown (line 40) | public function tearDown(): void
method testGetFormatter (line 47) | public function testGetFormatter()
method testHandle (line 53) | public function testHandle()
FILE: tests/Monolog/Handler/ElasticaHandlerTest.php
class ElasticaHandlerTest (line 23) | #[Group('Elastica')]
method setUp (line 39) | public function setUp(): void
method tearDown (line 53) | public function tearDown(): void
method testHandle (line 66) | public function testHandle()
method testSetFormatter (line 89) | public function testSetFormatter()
method testSetFormatterInvalid (line 102) | public function testSetFormatterInvalid()
method testOptions (line 117) | public function testOptions()
method testConnectionErrors (line 131) | #[DataProvider('providerTestConnectionErrors')]
method providerTestConnectionErrors (line 148) | public static function providerTestConnectionErrors(): array
method testHandleIntegrationNewESVersion (line 164) | public function testHandleIntegrationNewESVersion()
method getCreatedDocId (line 208) | protected function getCreatedDocId(Response $response): ?string
method getDocSourceFromElastic (line 226) | protected function getDocSourceFromElastic(Client $client, string $ind...
FILE: tests/Monolog/Handler/ElasticsearchHandlerTest.php
class ElasticsearchHandlerTest (line 25) | #[Group('Elasticsearch')]
method setUp (line 40) | public function setUp(): void
method tearDown (line 54) | public function tearDown(): void
method testSetFormatter (line 61) | public function testSetFormatter()
method testSetFormatterInvalid (line 71) | public function testSetFormatterInvalid()
method testOptions (line 82) | public function testOptions()
method testConnectionErrors (line 99) | #[DataProvider('providerTestConnectionErrors')]
method providerTestConnectionErrors (line 119) | public static function providerTestConnectionErrors(): array
method testHandleBatchIntegration (line 135) | public function testHandleBatchIntegration()
method getCreatedDocId (line 187) | protected function getCreatedDocId(array $info): ?string
method getCreatedDocIdV8 (line 204) | protected function getCreatedDocIdV8(array $data)
method getDocSourceFromElastic (line 218) | protected function getDocSourceFromElastic(Client|Client8 $client, str...
method getClientBuilder (line 241) | private function getClientBuilder()
FILE: tests/Monolog/Handler/ErrorLogHandlerTest.php
function error_log (line 17) | function error_log()
class ErrorLogHandlerTest (line 22) | class ErrorLogHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 24) | protected function setUp(): void
method testShouldNotAcceptAnInvalidTypeOnConstructor (line 32) | public function testShouldNotAcceptAnInvalidTypeOnConstructor()
method testShouldLogMessagesUsingErrorLogFunction (line 43) | public function testShouldLogMessagesUsingErrorLogFunction()
FILE: tests/Monolog/Handler/ExceptionTestHandler.php
class ExceptionTestHandler (line 17) | class ExceptionTestHandler extends TestHandler
method write (line 22) | protected function write(LogRecord $record): void
FILE: tests/Monolog/Handler/FallbackGroupHandlerTest.php
class FallbackGroupHandlerTest (line 17) | class FallbackGroupHandlerTest extends \Monolog\Test\MonologTestCase
method testHandle (line 23) | public function testHandle()
method testHandleExceptionThrown (line 40) | public function testHandleExceptionThrown()
method testHandleBatch (line 56) | public function testHandleBatch()
method testHandleBatchExceptionThrown (line 70) | public function testHandleBatchExceptionThrown()
method testIsHandling (line 84) | public function testIsHandling()
method testHandleUsesProcessors (line 96) | public function testHandleUsesProcessors()
method testHandleBatchUsesProcessors (line 114) | public function testHandleBatchUsesProcessors()
method testProcessorsDoNotInterfereBetweenHandlers (line 142) | public function testProcessorsDoNotInterfereBetweenHandlers()
method testProcessorsDoNotInterfereBetweenHandlersWithBatch (line 158) | public function testProcessorsDoNotInterfereBetweenHandlersWithBatch()
FILE: tests/Monolog/Handler/FilterHandlerTest.php
class FilterHandlerTest (line 16) | class FilterHandlerTest extends \Monolog\Test\MonologTestCase
method testIsHandling (line 21) | public function testIsHandling()
method testHandleProcessOnlyNeededLevels (line 40) | public function testHandleProcessOnlyNeededLevels()
method testAcceptedLevelApi (line 83) | public function testAcceptedLevelApi()
method testHandleUsesProcessors (line 107) | public function testHandleUsesProcessors()
method testHandleRespectsBubble (line 127) | public function testHandleRespectsBubble()
method testHandleWithCallback (line 143) | public function testHandleWithCallback()
method testHandleWithBadCallbackThrowsException (line 163) | public function testHandleWithBadCallbackThrowsException()
method testHandleEmptyBatch (line 176) | public function testHandleEmptyBatch()
method testResetTestHandler (line 188) | public function testResetTestHandler()
FILE: tests/Monolog/Handler/FingersCrossedHandlerTest.php
class FingersCrossedHandlerTest (line 19) | class FingersCrossedHandlerTest extends \Monolog\Test\MonologTestCase
method testHandleBuffers (line 26) | public function testHandleBuffers()
method testHandleStopsBufferingAfterTrigger (line 44) | public function testHandleStopsBufferingAfterTrigger()
method testHandleResetBufferingAfterReset (line 60) | public function testHandleResetBufferingAfterReset()
method testHandleResetBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled (line 79) | public function testHandleResetBufferingAfterBeingTriggeredWhenStopBuf...
method testHandleBufferLimit (line 96) | public function testHandleBufferLimit()
method testHandleWithCallback (line 113) | public function testHandleWithCallback()
method testHandleWithBadCallbackThrowsException (line 132) | public function testHandleWithBadCallbackThrowsException()
method testIsHandlingAlways (line 146) | public function testIsHandlingAlways()
method testErrorLevelActivationStrategy (line 158) | public function testErrorLevelActivationStrategy()
method testErrorLevelActivationStrategyWithPsrLevel (line 174) | public function testErrorLevelActivationStrategyWithPsrLevel()
method testOverrideActivationStrategy (line 189) | public function testOverrideActivationStrategy()
method testChannelLevelActivationStrategy (line 205) | public function testChannelLevelActivationStrategy()
method testChannelLevelActivationStrategyWithPsrLevels (line 221) | public function testChannelLevelActivationStrategyWithPsrLevels()
method testHandleUsesProcessors (line 237) | public function testHandleUsesProcessors()
method testPassthruOnClose (line 255) | public function testPassthruOnClose()
method testPsrLevelPassthruOnClose (line 271) | public function testPsrLevelPassthruOnClose()
FILE: tests/Monolog/Handler/FirePHPHandlerTest.php
class FirePHPHandlerTest (line 19) | class FirePHPHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 21) | public function setUp(): void
method testHeaders (line 27) | public function testHeaders()
method testConcurrentHandlers (line 45) | public function testConcurrentHandlers()
class TestFirePHPHandler (line 75) | class TestFirePHPHandler extends FirePHPHandler
method resetStatic (line 79) | public static function resetStatic(): void
method sendHeader (line 86) | protected function sendHeader(string $header, string $content): void
method getHeaders (line 91) | public function getHeaders(): array
method isWebRequest (line 96) | protected function isWebRequest(): bool
FILE: tests/Monolog/Handler/FleepHookHandlerTest.php
class FleepHookHandlerTest (line 20) | class FleepHookHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 29) | public function setUp(): void
method tearDown (line 41) | public function tearDown(): void
method testConstructorSetsExpectedDefaults (line 51) | public function testConstructorSetsExpectedDefaults()
method testHandlerUsesLineFormatterWhichIgnoresEmptyArrays (line 60) | public function testHandlerUsesLineFormatterWhichIgnoresEmptyArrays()
method testConnectionStringisConstructedCorrectly (line 76) | public function testConnectionStringisConstructedCorrectly()
FILE: tests/Monolog/Handler/FlowdockHandlerTest.php
class FlowdockHandlerTest (line 21) | class FlowdockHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 30) | public function setUp(): void
method tearDown (line 37) | public function tearDown(): void
method testWriteHeader (line 45) | public function testWriteHeader()
method testWriteContent (line 60) | public function testWriteContent($content)
method createHandler (line 66) | private function createHandler($token = 'myToken')
FILE: tests/Monolog/Handler/GelfHandlerTest.php
class GelfHandlerTest (line 18) | class GelfHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 20) | public function setUp(): void
method testConstruct (line 30) | public function testConstruct()
method getHandler (line 36) | protected function getHandler($messagePublisher)
method getMessagePublisher (line 43) | protected function getMessagePublisher()
method testDebug (line 51) | public function testDebug()
method testWarning (line 72) | public function testWarning()
method testInjectedGelfMessageFormatter (line 93) | public function testInjectedGelfMessageFormatter()
FILE: tests/Monolog/Handler/GroupHandlerTest.php
class GroupHandlerTest (line 17) | class GroupHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructorOnlyTakesHandler (line 22) | public function testConstructorOnlyTakesHandler()
method testHandle (line 33) | public function testHandle()
method testHandleBatch (line 49) | public function testHandleBatch()
method testIsHandling (line 64) | public function testIsHandling()
method testHandleUsesProcessors (line 76) | public function testHandleUsesProcessors()
method testHandleBatchUsesProcessors (line 94) | public function testHandleBatchUsesProcessors()
method testProcessorsDoNotInterfereBetweenHandlers (line 121) | public function testProcessorsDoNotInterfereBetweenHandlers()
method testProcessorsDoNotInterfereBetweenHandlersWithBatch (line 137) | public function testProcessorsDoNotInterfereBetweenHandlersWithBatch()
FILE: tests/Monolog/Handler/HandlerWrapperTest.php
class HandlerWrapperTest (line 20) | class HandlerWrapperTest extends \Monolog\Test\MonologTestCase
method setUp (line 26) | public function setUp(): void
method tearDown (line 33) | public function tearDown(): void
method trueFalseDataProvider (line 41) | public static function trueFalseDataProvider(): array
method testIsHandling (line 49) | #[DataProvider('trueFalseDataProvider')]
method testHandle (line 61) | #[DataProvider('trueFalseDataProvider')]
method testHandleBatch (line 73) | #[DataProvider('trueFalseDataProvider')]
FILE: tests/Monolog/Handler/InsightOpsHandlerTest.php
class InsightOpsHandlerTest (line 21) | class InsightOpsHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 30) | public function tearDown(): void
method testWriteContent (line 38) | public function testWriteContent()
method testWriteBatchContent (line 49) | public function testWriteBatchContent()
method createHandler (line 60) | private function createHandler()
FILE: tests/Monolog/Handler/LogEntriesHandlerTest.php
class LogEntriesHandlerTest (line 20) | class LogEntriesHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 29) | public function tearDown(): void
method testWriteContent (line 37) | public function testWriteContent()
method testWriteBatchContent (line 48) | public function testWriteBatchContent()
method createHandler (line 64) | private function createHandler()
FILE: tests/Monolog/Handler/LogmaticHandlerTest.php
class LogmaticHandlerTest (line 20) | class LogmaticHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 29) | public function tearDown(): void
method testWriteContent (line 37) | public function testWriteContent()
method testWriteBatchContent (line 48) | public function testWriteBatchContent()
method createHandler (line 64) | private function createHandler()
FILE: tests/Monolog/Handler/MailHandlerTest.php
class MailHandlerTest (line 16) | class MailHandlerTest extends \Monolog\Test\MonologTestCase
method testHandleBatch (line 21) | public function testHandleBatch()
method testHandleBatchNotSendsMailIfMessagesAreBelowLevel (line 41) | public function testHandleBatchNotSendsMailIfMessagesAreBelowLevel()
method testHandle (line 60) | public function testHandle()
FILE: tests/Monolog/Handler/MongoDBHandlerTest.php
class MongoDBHandlerTest (line 20) | #[RequiresPhpExtension('mongodb')]
method testConstructorShouldThrowExceptionForInvalidMongo (line 23) | public function testConstructorShouldThrowExceptionForInvalidMongo()
method testHandleWithLibraryClient (line 30) | public function testHandleWithLibraryClient()
method testHandleWithDriverManager (line 61) | public function testHandleWithDriverManager()
FILE: tests/Monolog/Handler/NativeMailerHandlerTest.php
function mail (line 16) | function mail($to, $subject, $message, $additional_headers = null, $addi...
class NativeMailerHandlerTest (line 21) | class NativeMailerHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 23) | protected function setUp(): void
method newNativeMailerHandler (line 28) | protected function newNativeMailerHandler(... $args) : NativeMailerHan...
method testConstructorHeaderInjection (line 45) | public function testConstructorHeaderInjection()
method testSetterHeaderInjection (line 52) | public function testSetterHeaderInjection()
method testSetterArrayHeaderInjection (line 60) | public function testSetterArrayHeaderInjection()
method testSetterContentTypeInjection (line 68) | public function testSetterContentTypeInjection()
method testSetterEncodingInjection (line 76) | public function testSetterEncodingInjection()
method testSend (line 84) | public function testSend()
method testMessageSubjectFormatting (line 111) | public function testMessageSubjectFormatting()
method testMail (line 123) | public function testMail()
FILE: tests/Monolog/Handler/NewRelicHandlerTest.php
class NewRelicHandlerTest (line 17) | class NewRelicHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 23) | public function setUp(): void
method testThehandlerThrowsAnExceptionIfTheNRExtensionIsNotLoaded (line 30) | public function testThehandlerThrowsAnExceptionIfTheNRExtensionIsNotLo...
method testThehandlerCanHandleTheRecord (line 39) | public function testThehandlerCanHandleTheRecord()
method testThehandlerCanAddContextParamsToTheNewRelicTrace (line 45) | public function testThehandlerCanAddContextParamsToTheNewRelicTrace()
method testThehandlerCanAddExplodedContextParamsToTheNewRelicTrace (line 52) | public function testThehandlerCanAddExplodedContextParamsToTheNewRelic...
method testThehandlerCanAddExtraParamsToTheNewRelicTrace (line 66) | public function testThehandlerCanAddExtraParamsToTheNewRelicTrace()
method testThehandlerCanAddExplodedExtraParamsToTheNewRelicTrace (line 77) | public function testThehandlerCanAddExplodedExtraParamsToTheNewRelicTr...
method testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace (line 91) | public function testThehandlerCanAddExtraContextAndParamsToTheNewRelic...
method testThehandlerCanHandleTheRecordsFormattedUsingTheLineFormatter (line 107) | public function testThehandlerCanHandleTheRecordsFormattedUsingTheLine...
method testTheAppNameIsNullByDefault (line 114) | public function testTheAppNameIsNullByDefault()
method testTheAppNameCanBeInjectedFromtheConstructor (line 122) | public function testTheAppNameCanBeInjectedFromtheConstructor()
method testTheAppNameCanBeOverriddenFromEachLog (line 130) | public function testTheAppNameCanBeOverriddenFromEachLog()
method testTheTransactionNameIsNullByDefault (line 138) | public function testTheTransactionNameIsNullByDefault()
method testTheTransactionNameCanBeInjectedFromTheConstructor (line 146) | public function testTheTransactionNameCanBeInjectedFromTheConstructor()
method testTheTransactionNameCanBeOverriddenFromEachLog (line 154) | public function testTheTransactionNameCanBeOverriddenFromEachLog()
class StubNewRelicHandlerWithoutExtension (line 163) | class StubNewRelicHandlerWithoutExtension extends NewRelicHandler
method isNewRelicEnabled (line 165) | protected function isNewRelicEnabled(): bool
class StubNewRelicHandler (line 171) | class StubNewRelicHandler extends NewRelicHandler
method isNewRelicEnabled (line 173) | protected function isNewRelicEnabled(): bool
function newrelic_notice_error (line 179) | function newrelic_notice_error()
function newrelic_set_appname (line 184) | function newrelic_set_appname($appname)
function newrelic_name_transaction (line 189) | function newrelic_name_transaction($transactionName)
function newrelic_add_custom_parameter (line 194) | function newrelic_add_custom_parameter($key, $value)
FILE: tests/Monolog/Handler/NoopHandlerTest.php
class NoopHandlerTest (line 20) | class NoopHandlerTest extends \Monolog\Test\MonologTestCase
method testIsHandling (line 22) | #[DataProvider('logLevelsProvider')]
method testHandle (line 29) | #[DataProvider('logLevelsProvider')]
method logLevelsProvider (line 36) | public static function logLevelsProvider()
FILE: tests/Monolog/Handler/NullHandlerTest.php
class NullHandlerTest (line 19) | class NullHandlerTest extends \Monolog\Test\MonologTestCase
method testHandle (line 21) | public function testHandle()
method testHandleLowerLevelRecord (line 27) | public function testHandleLowerLevelRecord()
method testSerializeRestorePrivate (line 33) | public function testSerializeRestorePrivate()
FILE: tests/Monolog/Handler/OverflowHandlerTest.php
class OverflowHandlerTest (line 20) | class OverflowHandlerTest extends \Monolog\Test\MonologTestCase
method testNotPassingRecordsBeneathLogLevel (line 22) | public function testNotPassingRecordsBeneathLogLevel()
method testPassThroughWithoutThreshold (line 30) | public function testPassThroughWithoutThreshold()
method testHoldingMessagesBeneathThreshold (line 47) | public function testHoldingMessagesBeneathThreshold()
method testCombinedThresholds (line 73) | public function testCombinedThresholds()
FILE: tests/Monolog/Handler/PHPConsoleHandlerTest.php
class PHPConsoleHandlerTest (line 30) | class PHPConsoleHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 36) | protected function setUp(): void
method tearDown (line 58) | public function tearDown(): void
method initDebugDispatcherMock (line 65) | protected function initDebugDispatcherMock(Connector $connector)
method initErrorDispatcherMock (line 74) | protected function initErrorDispatcherMock(Connector $connector)
method initConnectorMock (line 83) | protected function initConnectorMock()
method getHandlerDefaultOption (line 108) | protected function getHandlerDefaultOption($name)
method initLogger (line 116) | protected function initLogger($handlerOptions = [], $level = Level::De...
method testInitWithDefaultConnector (line 123) | public function testInitWithDefaultConnector()
method testInitWithCustomConnector (line 129) | public function testInitWithCustomConnector()
method testDebug (line 135) | public function testDebug()
method testDebugContextInMessage (line 141) | public function testDebugContextInMessage()
method testDebugTags (line 154) | public function testDebugTags($tagsContextKeys = null)
method testError (line 172) | #[WithoutErrorHandler]
method testException (line 194) | public function testException()
method testWrongOptionsThrowsException (line 208) | public function testWrongOptionsThrowsException()
method testOptionEnabled (line 215) | public function testOptionEnabled()
method testOptionDebugTagsKeysInContext (line 221) | public function testOptionDebugTagsKeysInContext()
method testOptionUseOwnErrorsAndExceptionsHandler (line 226) | public function testOptionUseOwnErrorsAndExceptionsHandler()
method provideConnectorMethodsOptionsSets (line 240) | public static function provideConnectorMethodsOptionsSets()
method testOptionCallsConnectorMethod (line 253) | #[DataProvider('provideConnectorMethodsOptionsSets')]
method testOptionDetectDumpTraceAndSource (line 263) | public function testOptionDetectDumpTraceAndSource()
method provideDumperOptionsValues (line 269) | public static function provideDumperOptionsValues()
method testDumperOptions (line 280) | #[DataProvider('provideDumperOptionsValues')]
FILE: tests/Monolog/Handler/ProcessHandlerTest.php
class ProcessHandlerTest (line 17) | class ProcessHandlerTest extends \Monolog\Test\MonologTestCase
method testWriteOpensProcessAndWritesToStdInOfProcess (line 35) | public function testWriteOpensProcessAndWritesToStdInOfProcess()
method invalidCommandProvider (line 67) | public static function invalidCommandProvider(): array
method testConstructWithInvalidCommandThrowsInvalidArgumentException (line 80) | #[DataProvider('invalidCommandProvider')]
method invalidCwdProvider (line 90) | public static function invalidCwdProvider(): array
method testConstructWithInvalidCwdThrowsInvalidArgumentException (line 103) | #[DataProvider('invalidCwdProvider')]
method testConstructWithValidCwdWorks (line 114) | public function testConstructWithValidCwdWorks()
method testStartupWithFailingToSelectErrorStreamThrowsUnexpectedValueException (line 127) | public function testStartupWithFailingToSelectErrorStreamThrowsUnexpec...
method testStartupWithErrorsThrowsUnexpectedValueException (line 148) | public function testStartupWithErrorsThrowsUnexpectedValueException()
method testWritingWithErrorsOnStdOutOfProcessThrowsInvalidArgumentException (line 160) | public function testWritingWithErrorsOnStdOutOfProcessThrowsInvalidArg...
method testCloseClosesProcess (line 180) | public function testCloseClosesProcess()
FILE: tests/Monolog/Handler/PsrHandlerTest.php
class PsrHandlerTest (line 21) | class PsrHandlerTest extends \Monolog\Test\MonologTestCase
method logLevelProvider (line 23) | public static function logLevelProvider()
method testHandlesAllLevels (line 31) | #[DataProvider('logLevelProvider')]
method testFormatter (line 46) | public function testFormatter()
method testIncludeExtra (line 62) | public function testIncludeExtra()
FILE: tests/Monolog/Handler/PushoverHandlerTest.php
class PushoverHandlerTest (line 23) | class PushoverHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 29) | public function tearDown(): void
method testWriteHeader (line 37) | public function testWriteHeader()
method testWriteContent (line 53) | public function testWriteContent($content)
method testWriteWithComplexTitle (line 58) | public function testWriteWithComplexTitle()
method testWriteWithComplexMessage (line 68) | public function testWriteWithComplexMessage()
method testWriteWithTooLongMessage (line 79) | public function testWriteWithTooLongMessage()
method testWriteWithHighPriority (line 93) | public function testWriteWithHighPriority()
method testWriteWithEmergencyPriority (line 103) | public function testWriteWithEmergencyPriority()
method testWriteToMultipleUsers (line 113) | public function testWriteToMultipleUsers()
method createHandler (line 124) | private function createHandler($token = 'myToken', $user = 'myUser', $...
FILE: tests/Monolog/Handler/RedisHandlerTest.php
class RedisHandlerTest (line 17) | class RedisHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructorShouldWorkWithPredis (line 19) | public function testConstructorShouldWorkWithPredis()
method testConstructorShouldWorkWithRedis (line 25) | public function testConstructorShouldWorkWithRedis()
method testPredisHandle (line 35) | public function testPredisHandle()
method testRedisHandle (line 49) | public function testRedisHandle()
method testRedisHandleCapped (line 69) | public function testRedisHandleCapped()
method testPredisHandleCapped (line 101) | public function testPredisHandleCapped()
FILE: tests/Monolog/Handler/RedisPubSubHandlerTest.php
class RedisPubSubHandlerTest (line 19) | class RedisPubSubHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructorShouldWorkWithPredis (line 21) | public function testConstructorShouldWorkWithPredis()
method testConstructorShouldWorkWithRedis (line 27) | public function testConstructorShouldWorkWithRedis()
method testPredisHandle (line 37) | public function testPredisHandle()
method testRedisHandle (line 51) | public function testRedisHandle()
FILE: tests/Monolog/Handler/RollbarHandlerTest.php
class RollbarHandlerTest (line 27) | class RollbarHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 33) | protected function setUp(): void
method tearDown (line 40) | public function tearDown(): void
method testExceptionLogLevel (line 51) | public function testExceptionLogLevel()
method setupRollbarLoggerMock (line 61) | private function setupRollbarLoggerMock()
method createHandler (line 81) | private function createHandler(): RollbarHandler
FILE: tests/Monolog/Handler/RotatingFileHandlerTest.php
class RotatingFileHandlerTest (line 20) | class RotatingFileHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 24) | public function setUp(): void
method tearDown (line 42) | public function tearDown(): void
method rrmdir (line 61) | private function rrmdir($directory)
method assertErrorWasTriggered (line 82) | private function assertErrorWasTriggered($code, $message)
method testRotationCreatesNewFile (line 97) | public function testRotationCreatesNewFile()
method testRotation (line 110) | #[DataProvider('rotationTests')]
method rotationTests (line 139) | public static function rotationTests()
method createDeep (line 170) | private function createDeep($file)
method testRotationWithFolderByDate (line 178) | #[DataProvider('rotationWithFolderByDateTests')]
method rotationWithFolderByDateTests (line 207) | public static function rotationWithFolderByDateTests()
method testAllowOnlyFixedDefinedDateFormats (line 238) | #[DataProvider('dateFormatProvider')]
method dateFormatProvider (line 250) | public static function dateFormatProvider()
method testDisallowFilenameFormatsWithoutDate (line 277) | #[DataProvider('filenameFormatProvider')]
method filenameFormatProvider (line 289) | public static function filenameFormatProvider()
method testRotationWhenSimilarFileNamesExist (line 303) | #[DataProvider('rotationWhenSimilarFilesExistTests')]
method rotationWhenSimilarFilesExistTests (line 320) | public static function rotationWhenSimilarFilesExistTests()
method testReuseCurrentFile (line 334) | public function testReuseCurrentFile()
FILE: tests/Monolog/Handler/SamplingHandlerTest.php
class SamplingHandlerTest (line 17) | class SamplingHandlerTest extends \Monolog\Test\MonologTestCase
method testHandle (line 19) | public function testHandle()
FILE: tests/Monolog/Handler/Slack/SlackRecordTest.php
class SlackRecordTest (line 18) | #[CoversClass(SlackRecord::class)]
method dataGetAttachmentColor (line 21) | public static function dataGetAttachmentColor()
method testGetAttachmentColor (line 35) | #[DataProvider('dataGetAttachmentColor')]
method testAddsChannel (line 45) | public function testAddsChannel()
method testNoUsernameByDefault (line 55) | public function testNoUsernameByDefault()
method dataStringify (line 63) | public static function dataStringify(): array
method testStringify (line 77) | #[DataProvider('dataStringify')]
method testAddsCustomUsername (line 92) | public function testAddsCustomUsername()
method testNoIcon (line 102) | public function testNoIcon()
method testAddsIcon (line 110) | public function testAddsIcon()
method testAttachmentsNotPresentIfNoAttachment (line 125) | public function testAttachmentsNotPresentIfNoAttachment()
method testAddsOneAttachment (line 133) | public function testAddsOneAttachment()
method testTextEqualsMessageIfNoAttachment (line 143) | public function testTextEqualsMessageIfNoAttachment()
method testTextEqualsFormatterOutput (line 153) | public function testTextEqualsFormatterOutput()
method testAddsFallbackAndTextToAttachment (line 185) | public function testAddsFallbackAndTextToAttachment()
method testMapsLevelToColorAttachmentColor (line 195) | public function testMapsLevelToColorAttachmentColor()
method testAddsShortAttachmentWithoutContextAndExtra (line 220) | public function testAddsShortAttachmentWithoutContextAndExtra()
method testAddsShortAttachmentWithContextAndExtra (line 234) | public function testAddsShortAttachmentWithContextAndExtra()
method testAddsLongAttachmentWithoutContextAndExtra (line 267) | public function testAddsLongAttachmentWithoutContextAndExtra()
method testAddsLongAttachmentWithContextAndExtra (line 289) | public function testAddsLongAttachmentWithContextAndExtra()
method testAddsTimestampToAttachment (line 329) | public function testAddsTimestampToAttachment()
method testContextHasException (line 340) | public function testContextHasException()
method testExcludeExtraAndContextFields (line 348) | public function testExcludeExtraAndContextFields()
FILE: tests/Monolog/Handler/SlackHandlerTest.php
class SlackHandlerTest (line 23) | class SlackHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 32) | public function setUp(): void
method tearDown (line 39) | public function tearDown(): void
method testWriteHeader (line 47) | public function testWriteHeader()
method testWriteContent (line 57) | public function testWriteContent()
method testWriteContentUsesFormatterIfProvided (line 70) | public function testWriteContentUsesFormatterIfProvided()
method testWriteContentWithEmoji (line 87) | public function testWriteContentWithEmoji()
method testWriteContentWithColors (line 97) | #[DataProvider('provideLevelColors')]
method testWriteContentWithPlainTextMessage (line 108) | public function testWriteContentWithPlainTextMessage()
method provideLevelColors (line 118) | public static function provideLevelColors()
method createHandler (line 132) | private function createHandler($token = 'myToken', $channel = 'channel...
FILE: tests/Monolog/Handler/SlackWebhookHandlerTest.php
class SlackWebhookHandlerTest (line 23) | class SlackWebhookHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructorMinimal (line 31) | public function testConstructorMinimal()
method testConstructorFull (line 64) | public function testConstructorFull()
method testConstructorFullWithAttachment (line 92) | public function testConstructorFullWithAttachment()
method testGetFormatter (line 138) | public function testGetFormatter()
method testSetFormatter (line 148) | public function testSetFormatter()
FILE: tests/Monolog/Handler/SocketHandlerTest.php
class SocketHandlerTest (line 20) | class SocketHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 29) | public function tearDown(): void
method testInvalidHostname (line 37) | public function testInvalidHostname()
method testBadConnectionTimeout (line 45) | public function testBadConnectionTimeout()
method testSetConnectionTimeout (line 53) | public function testSetConnectionTimeout()
method testBadTimeout (line 60) | public function testBadTimeout()
method testSetTimeout (line 68) | public function testSetTimeout()
method testSetWritingTimeout (line 75) | public function testSetWritingTimeout()
method testSetChunkSize (line 82) | public function testSetChunkSize()
method testSetConnectionString (line 89) | public function testSetConnectionString()
method testExceptionIsThrownOnFsockopenError (line 95) | public function testExceptionIsThrownOnFsockopenError()
method testExceptionIsThrownOnPfsockopenError (line 107) | public function testExceptionIsThrownOnPfsockopenError()
method testExceptionIsThrownIfCannotSetTimeout (line 121) | public function testExceptionIsThrownIfCannotSetTimeout()
method testExceptionIsThrownIfCannotSetChunkSize (line 133) | public function testExceptionIsThrownIfCannotSetChunkSize()
method testWriteFailsOnIfFwriteReturnsFalse (line 146) | public function testWriteFailsOnIfFwriteReturnsFalse()
method testWriteFailsIfStreamTimesOut (line 168) | public function testWriteFailsIfStreamTimesOut()
method testWriteFailsOnIncompleteWrite (line 193) | public function testWriteFailsOnIncompleteWrite()
method testWriteWithMemoryFile (line 216) | public function testWriteWithMemoryFile()
method testWriteWithMock (line 226) | public function testWriteWithMock()
method testClose (line 246) | public function testClose()
method testCloseDoesNotClosePersistentSocket (line 255) | public function testCloseDoesNotClosePersistentSocket()
method testAvoidInfiniteLoopWhenNoDataIsWrittenForAWritingTimeoutSeconds (line 265) | public function testAvoidInfiniteLoopWhenNoDataIsWrittenForAWritingTim...
method createHandler (line 284) | private function createHandler(string $connectionString): SocketHandler
method writeRecord (line 292) | private function writeRecord($string)
method setMockHandler (line 297) | private function setMockHandler(array $methods = [])
FILE: tests/Monolog/Handler/StreamHandlerTest.php
class StreamHandlerTest (line 17) | class StreamHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 19) | public function tearDown(): void
method testWrite (line 30) | public function testWrite()
method testCloseKeepsExternalHandlersOpen (line 45) | public function testCloseKeepsExternalHandlersOpen()
method testClose (line 57) | public function testClose()
method testSerialization (line 72) | public function testSerialization()
method testWriteCreatesTheStreamResource (line 98) | public function testWriteCreatesTheStreamResource()
method testWriteLocking (line 108) | public function testWriteLocking()
method testWriteMissingResource (line 119) | public function testWriteMissingResource()
method invalidArgumentProvider (line 127) | public static function invalidArgumentProvider()
method testWriteInvalidArgument (line 139) | #[DataProvider('invalidArgumentProvider')]
method testWriteInvalidResource (line 151) | public function testWriteInvalidResource()
method testWriteNonExistingResource (line 186) | public function testWriteNonExistingResource()
method testWriteNonExistingPath (line 198) | public function testWriteNonExistingPath()
method testWriteNonExistingFileResource (line 208) | public function testWriteNonExistingFileResource()
method testWriteErrorDuringWriteRetriesWithClose (line 217) | public function testWriteErrorDuringWriteRetriesWithClose()
method testWriteErrorDuringWriteRetriesButThrowsIfStillFails (line 247) | public function testWriteErrorDuringWriteRetriesButThrowsIfStillFails()
method testWriteNonExistingAndNotCreatablePath (line 275) | #[DataProvider('provideNonExistingAndNotCreatablePath')]
method provideNonExistingAndNotCreatablePath (line 299) | public static function provideNonExistingAndNotCreatablePath()
method provideMemoryValues (line 311) | public static function provideMemoryValues()
method testPreventOOMError (line 326) | #[DataProvider('provideMemoryValues')]
method testSimpleOOMPrevention (line 351) | public function testSimpleOOMPrevention(): void
method testReopensFileIfInodeChanges (line 369) | public function testReopensFileIfInodeChanges()
FILE: tests/Monolog/Handler/SymfonyMailerHandlerTest.php
class SymfonyMailerHandlerTest (line 19) | class SymfonyMailerHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 24) | public function setUp(): void
method tearDown (line 32) | public function tearDown(): void
method testMessageCreationIsLazyWhenUsingCallback (line 39) | public function testMessageCreationIsLazyWhenUsingCallback()
method testMessageCanBeCustomizedGivenLoggedData (line 56) | public function testMessageCanBeCustomizedGivenLoggedData()
method testMessageSubjectFormatting (line 83) | public function testMessageSubjectFormatting()
FILE: tests/Monolog/Handler/SyslogHandlerTest.php
class SyslogHandlerTest (line 16) | class SyslogHandlerTest extends \PHPUnit\Framework\TestCase
method testConstruct (line 21) | public function testConstruct()
method testConstructInvalidFacility (line 39) | public function testConstructInvalidFacility()
FILE: tests/Monolog/Handler/SyslogUdpHandlerTest.php
class SyslogUdpHandlerTest (line 19) | class SyslogUdpHandlerTest extends \Monolog\Test\MonologTestCase
method testWeValidateFacilities (line 21) | public function testWeValidateFacilities()
method testWeSplitIntoLines (line 28) | public function testWeSplitIntoLines()
method testSplitWorksOnEmptyMsg (line 59) | public function testSplitWorksOnEmptyMsg()
method testRfc (line 76) | public function testRfc()
method getRecordWithMessage (line 111) | protected function getRecordWithMessage($msg)
FILE: tests/Monolog/Handler/TelegramBotHandlerTest.php
class TelegramBotHandlerTest (line 21) | class TelegramBotHandlerTest extends \Monolog\Test\MonologTestCase
method tearDown (line 25) | public function tearDown(): void
method testSendTelegramRequest (line 32) | public function testSendTelegramRequest(): void
method createHandler (line 38) | private function createHandler(
method testSetInvalidParseMode (line 57) | public function testSetInvalidParseMode(): void
method testSetParseMode (line 65) | public function testSetParseMode(): void
FILE: tests/Monolog/Handler/TestHandlerTest.php
class TestHandlerTest (line 20) | class TestHandlerTest extends \Monolog\Test\MonologTestCase
method testHandler (line 22) | #[DataProvider('methodProvider')]
method testHandlerAssertEmptyContext (line 55) | public function testHandlerAssertEmptyContext()
method testHandlerAssertNonEmptyContext (line 78) | public function testHandlerAssertNonEmptyContext()
method methodProvider (line 103) | public static function methodProvider()
FILE: tests/Monolog/Handler/UdpSocketTest.php
class UdpSocketTest (line 19) | class UdpSocketTest extends \Monolog\Test\MonologTestCase
method testWeDoNotTruncateShortMessages (line 21) | public function testWeDoNotTruncateShortMessages()
method testLongMessagesAreTruncated (line 35) | public function testLongMessagesAreTruncated()
method testDoubleCloseDoesNotError (line 53) | public function testDoubleCloseDoesNotError()
method testWriteAfterCloseReopened (line 60) | public function testWriteAfterCloseReopened()
FILE: tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
class WhatFailureGroupHandlerTest (line 17) | class WhatFailureGroupHandlerTest extends \Monolog\Test\MonologTestCase
method testConstructorOnlyTakesHandler (line 22) | public function testConstructorOnlyTakesHandler()
method testHandle (line 33) | public function testHandle()
method testHandleBatch (line 49) | public function testHandleBatch()
method testIsHandling (line 64) | public function testIsHandling()
method testHandleUsesProcessors (line 76) | public function testHandleUsesProcessors()
method testHandleBatchUsesProcessors (line 94) | public function testHandleBatchUsesProcessors()
method testHandleException (line 124) | public function testHandleException()
method testProcessorsDoNotInterfereBetweenHandlers (line 140) | public function testProcessorsDoNotInterfereBetweenHandlers()
method testProcessorsDoNotInterfereBetweenHandlersWithBatch (line 156) | public function testProcessorsDoNotInterfereBetweenHandlersWithBatch()
FILE: tests/Monolog/Handler/ZendMonitorHandlerTest.php
class ZendMonitorHandlerTest (line 14) | class ZendMonitorHandlerTest extends \Monolog\Test\MonologTestCase
method setUp (line 16) | public function setUp(): void
method tearDown (line 23) | public function tearDown(): void
method testWrite (line 33) | public function testWrite()
method testGetDefaultFormatterReturnsNormalizerFormatter (line 71) | public function testGetDefaultFormatterReturnsNormalizerFormatter()
FILE: tests/Monolog/LoggerTest.php
class LoggerTest (line 20) | class LoggerTest extends MonologTestCase
method testGetName (line 25) | public function testGetName()
method testWithName (line 34) | public function testWithName()
method testConvertPSR3ToMonologLevel (line 47) | public function testConvertPSR3ToMonologLevel()
method testConvertRFC5424ToMonologLevelInAddRecordAndLog (line 63) | public function testConvertRFC5424ToMonologLevelInAddRecordAndLog()
method testChannel (line 93) | public function testChannel()
method testLogPreventsCircularLogging (line 106) | public function testLogPreventsCircularLogging()
method testLog (line 128) | public function testLog()
method testLogAlwaysHandledIfNoProcessorsArePresent (line 144) | public function testLogAlwaysHandledIfNoProcessorsArePresent()
method testLogNotHandledIfProcessorsArePresent (line 160) | public function testLogNotHandledIfProcessorsArePresent()
method testHandlersInCtor (line 174) | public function testHandlersInCtor()
method testProcessorsInCtor (line 184) | public function testProcessorsInCtor()
method testPushPopHandler (line 198) | public function testPushPopHandler()
method testSetHandlers (line 218) | public function testSetHandlers()
method testPushPopProcessor (line 243) | public function testPushPopProcessor()
method testProcessorsAreExecuted (line 263) | public function testProcessorsAreExecuted()
method testProcessorsAreCalledOnlyOnce (line 281) | public function testProcessorsAreCalledOnlyOnce()
method testProcessorsNotCalledWhenNotHandled (line 312) | public function testProcessorsNotCalledWhenNotHandled()
method testHandlersNotCalledBeforeFirstHandlingWhenProcessorsPresent (line 331) | public function testHandlersNotCalledBeforeFirstHandlingWhenProcessors...
method testHandlersNotCalledBeforeFirstHandlingWhenProcessorsPresentWithAssocArray (line 374) | public function testHandlersNotCalledBeforeFirstHandlingWhenProcessors...
method testBubblingWhenTheHandlerReturnsFalse (line 412) | public function testBubblingWhenTheHandlerReturnsFalse()
method testNotBubblingWhenTheHandlerReturnsTrue (line 444) | public function testNotBubblingWhenTheHandlerReturnsTrue()
method testIsHandling (line 475) | public function testIsHandling()
method testLogMethods (line 506) | #[DataProvider('logMethodProvider')]
method logMethodProvider (line 517) | public static function logMethodProvider()
method testSetTimezone (line 535) | #[DataProvider('setTimezoneProvider')]
method setTimezoneProvider (line 547) | public static function setTimezoneProvider()
method testTimezoneIsRespectedInUTC (line 561) | public function testTimezoneIsRespectedInUTC()
method testTimezoneIsRespectedInOtherTimezone (line 583) | public function testTimezoneIsRespectedInOtherTimezone()
method tearDown (line 602) | public function tearDown(): void
method testUseMicrosecondTimestamps (line 611) | #[DataProvider('useMicrosecondTimestampsProvider')]
method useMicrosecondTimestampsProvider (line 628) | public static function useMicrosecondTimestampsProvider()
method testProcessorsDoNotInterfereBetweenHandlers (line 638) | public function testProcessorsDoNotInterfereBetweenHandlers()
method testSetExceptionHandler (line 656) | public function testSetExceptionHandler()
method testDefaultHandleException (line 669) | public function testDefaultHandleException()
method testCustomHandleException (line 692) | public function testCustomHandleException()
method testSerializable (line 714) | public function testSerializable()
method testReset (line 724) | public function testReset()
method testLogWithDateTime (line 799) | public function testLogWithDateTime()
method testLogCycleDetectionWithFibersWithoutCycle (line 818) | public function testLogCycleDetectionWithFibersWithoutCycle()
method testLogCycleDetectionWithFibersWithCycle (line 843) | public function testLogCycleDetectionWithFibersWithCycle()
class LoggingHandler (line 865) | class LoggingHandler implements HandlerInterface
method __construct (line 872) | public function __construct(Logger $logger)
method isHandling (line 877) | public function isHandling(LogRecord $record): bool
method handle (line 882) | public function handle(LogRecord $record): bool
method handleBatch (line 889) | public function handleBatch(array $records): void
method close (line 893) | public function close(): void
class FiberSuspendHandler (line 898) | class FiberSuspendHandler implements HandlerInterface
method isHandling (line 900) | public function isHandling(LogRecord $record): bool
method handle (line 905) | public function handle(LogRecord $record): bool
method handleBatch (line 912) | public function handleBatch(array $records): void
method close (line 916) | public function close(): void
FILE: tests/Monolog/Processor/ClosureContextProcessorTest.php
class ClosureContextProcessorTest (line 16) | class ClosureContextProcessorTest extends \Monolog\Test\MonologTestCase
method testReplace (line 18) | public function testReplace()
method testSkip (line 27) | #[DataProvider('getContexts')]
method testClosureReturnsNotArray (line 36) | public function testClosureReturnsNotArray()
method testClosureThrows (line 45) | public function testClosureThrows()
method getContexts (line 58) | public static function getContexts(): iterable
FILE: tests/Monolog/Processor/GitProcessorTest.php
class GitProcessorTest (line 16) | class GitProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 21) | public function testProcessor()
method testProcessorWithLevel (line 33) | public function testProcessorWithLevel()
FILE: tests/Monolog/Processor/HostnameProcessorTest.php
class HostnameProcessorTest (line 14) | class HostnameProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 19) | public function testProcessor()
FILE: tests/Monolog/Processor/IntrospectionProcessorTest.php
class Tester (line 14) | class Tester
method test (line 16) | public function test($handler, $record)
function tester (line 22) | function tester($handler, $record)
class IntrospectionProcessorTest (line 32) | class IntrospectionProcessorTest extends \Monolog\Test\MonologTestCase
method getHandler (line 34) | public function getHandler()
method testProcessorFromClass (line 43) | public function testProcessorFromClass()
method testProcessorFromFunc (line 55) | public function testProcessorFromFunc()
method testLevelTooLow (line 66) | public function testLevelTooLow()
method testLevelEqual (line 78) | public function testLevelEqual()
method testLevelHigher (line 97) | public function testLevelHigher()
FILE: tests/Monolog/Processor/LoadAverageProcessorTest.php
class LoadAverageProcessorTest (line 14) | class LoadAverageProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 19) | public function testProcessor()
method testProcessorWithInvalidAvgSystemLoad (line 30) | public function testProcessorWithInvalidAvgSystemLoad()
FILE: tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
class MemoryPeakUsageProcessorTest (line 14) | class MemoryPeakUsageProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 20) | public function testProcessor()
method testProcessorWithoutFormatting (line 32) | public function testProcessorWithoutFormatting()
FILE: tests/Monolog/Processor/MemoryUsageProcessorTest.php
class MemoryUsageProcessorTest (line 14) | class MemoryUsageProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 20) | public function testProcessor()
method testProcessorWithoutFormatting (line 32) | public function testProcessorWithoutFormatting()
FILE: tests/Monolog/Processor/MercurialProcessorTest.php
class MercurialProcessorTest (line 14) | class MercurialProcessorTest extends \Monolog\Test\MonologTestCase
method setUp (line 19) | protected function setUp(): void
method tearDown (line 30) | protected function tearDown(): void
method testProcessor (line 54) | public function testProcessor()
FILE: tests/Monolog/Processor/ProcessIdProcessorTest.php
class ProcessIdProcessorTest (line 14) | class ProcessIdProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 19) | public function testProcessor()
FILE: tests/Monolog/Processor/PsrLogMessageProcessorTest.php
class PsrLogMessageProcessorTest (line 17) | class PsrLogMessageProcessorTest extends \Monolog\Test\MonologTestCase
method testReplacement (line 19) | #[DataProvider('getPairs')]
method testReplacementWithContextRemoval (line 29) | public function testReplacementWithContextRemoval()
method testCustomDateFormat (line 38) | public function testCustomDateFormat()
method getPairs (line 50) | public static function getPairs()
FILE: tests/Monolog/Processor/TagProcessorTest.php
class TagProcessorTest (line 14) | class TagProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 19) | public function testProcessor()
method testProcessorTagModification (line 31) | public function testProcessorTagModification()
FILE: tests/Monolog/Processor/UidProcessorTest.php
class UidProcessorTest (line 14) | class UidProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 19) | public function testProcessor()
method testGetUid (line 26) | public function testGetUid()
FILE: tests/Monolog/Processor/WebProcessorTest.php
class WebProcessorTest (line 14) | class WebProcessorTest extends \Monolog\Test\MonologTestCase
method testProcessor (line 16) | public function testProcessor()
method testProcessorDoNothingIfNoRequestUri (line 37) | public function testProcessorDoNothingIfNoRequestUri()
method testProcessorReturnNullIfNoHttpReferer (line 48) | public function testProcessorReturnNullIfNoHttpReferer()
method testProcessorDoesNotAddUniqueIdIfNotPresent (line 61) | public function testProcessorDoesNotAddUniqueIdIfNotPresent()
method testProcessorAddsOnlyRequestedExtraFields (line 74) | public function testProcessorAddsOnlyRequestedExtraFields()
method testProcessorAddsOnlyRequestedExtraFieldsIncludingOptionalFields (line 89) | public function testProcessorAddsOnlyRequestedExtraFieldsIncludingOpti...
method testProcessorConfiguringOfExtraFields (line 102) | public function testProcessorConfiguringOfExtraFields()
method testInvalidData (line 117) | public function testInvalidData()
FILE: tests/Monolog/PsrLogCompatTest.php
class PsrLogCompatTest (line 25) | class PsrLogCompatTest extends \Monolog\Test\MonologTestCase
method tearDown (line 29) | public function tearDown(): void
method getLogger (line 36) | public function getLogger(): LoggerInterface
method getLogs (line 48) | public function getLogs(): array
method testImplements (line 61) | public function testImplements()
method testLogsAtAllLevels (line 66) | #[DataProvider('provideLevelsAndMessages')]
method provideLevelsAndMessages (line 80) | public static function provideLevelsAndMessages()
method testThrowsOnInvalidLevel (line 94) | public function testThrowsOnInvalidLevel()
method testContextReplacement (line 102) | public function testContextReplacement()
method testObjectCastToString (line 111) | public function testObjectCastToString()
method testContextCanContainAnything (line 124) | public function testContextCanContainAnything()
method testContextExceptionKeyCanBeExceptionOrOtherValues (line 147) | public function testContextExceptionKeyCanBeExceptionOrOtherValues()
method createStringable (line 165) | protected function createStringable(string $string = ''): MockObject&S...
FILE: tests/Monolog/RegistryTest.php
class RegistryTest (line 16) | class RegistryTest extends \PHPUnit\Framework\TestCase
method setUp (line 18) | protected function setUp(): void
method testHasLogger (line 26) | #[DataProvider('hasLoggerProvider')]
method hasLoggerProvider (line 37) | public static function hasLoggerProvider()
method testClearClears (line 68) | public function testClearClears()
method testRemovesLogger (line 81) | #[DataProvider('removedLoggerProvider')]
method removedLoggerProvider (line 91) | public static function removedLoggerProvider()
method testGetsSameLogger (line 106) | public function testGetsSameLogger()
method testFailsOnNonExistentLogger (line 121) | public function testFailsOnNonExistentLogger()
method testReplacesLogger (line 130) | public function testReplacesLogger()
method testFailsOnUnspecifiedReplacement (line 145) | public function testFailsOnUnspecifiedReplacement()
FILE: tests/Monolog/SignalHandlerTest.php
class SignalHandlerTest (line 24) | class SignalHandlerTest extends MonologTestCase
method setUp (line 30) | protected function setUp(): void
method tearDown (line 43) | public function tearDown(): void
method setSignalHandler (line 63) | private function setSignalHandler($signo, $handler = SIG_DFL)
method testHandleSignal (line 73) | public function testHandleSignal()
method testRegisterSignalHandler (line 95) | public function testRegisterSignalHandler()
method testRegisterDefaultPreviousSignalHandler (line 131) | #[DataProvider('defaultPreviousProvider')]
method defaultPreviousProvider (line 163) | public static function defaultPreviousProvider()
method testRegisterCallablePreviousSignalHandler (line 181) | #[DataProvider('callablePreviousProvider')]
method callablePreviousProvider (line 200) | public static function callablePreviousProvider()
method testRegisterSyscallRestartingSignalHandler (line 213) | #[DataProvider('restartSyscallsProvider')]
method restartSyscallsProvider (line 252) | public static function restartSyscallsProvider()
method testRegisterAsyncSignalHandler (line 266) | #[DataProvider('asyncProvider')]
method asyncProvider (line 281) | public static function asyncProvider()
FILE: tests/Monolog/UtilsTest.php
class UtilsTest (line 16) | class UtilsTest extends \PHPUnit_Framework_TestCase
method testGetClass (line 18) | #[DataProvider('provideObjects')]
method provideObjects (line 24) | public static function provideObjects()
method testCanonicalizePath (line 35) | #[DataProvider('providePathsToCanonicalize')]
method providePathsToCanonicalize (line 41) | public static function providePathsToCanonicalize()
method testHandleJsonErrorFailure (line 54) | #[DataProvider('providesHandleJsonErrorFailure')]
method providesHandleJsonErrorFailure (line 61) | public static function providesHandleJsonErrorFailure()
method testDetectAndCleanUtf8 (line 76) | #[DataProvider('providesDetectAndCleanUtf8')]
method providesDetectAndCleanUtf8 (line 85) | public static function providesDetectAndCleanUtf8()
method provideIniValuesToConvertToBytes (line 104) | public static function provideIniValuesToConvertToBytes()
method testExpandIniShorthandBytes (line 138) | #[DataProvider('provideIniValuesToConvertToBytes')]
Condensed preview — 246 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,046K chars).
[
{
"path": ".editorconfig",
"chars": 179,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_size = 4\nindent_style = space\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": ".gitattributes",
"chars": 247,
"preview": "/doc export-ignore\n/tests export-ignore\n/.* export-ignore\n/phpstan* export-ignore\n/phpunit.xml.dist export-ignore\n/_conf"
},
{
"path": ".github/FUNDING.yml",
"chars": 56,
"preview": "github: [Seldaek]\ntidelift: \"packagist/monolog/monolog\"\n"
},
{
"path": ".github/ISSUE_TEMPLATE/Bug_Report.md",
"chars": 117,
"preview": "---\nname: Bug Report\nabout: Create a bug report\nlabels: Bug\n---\n\nMonolog version 1|2|3?\n\nWrite your bug report here.\n"
},
{
"path": ".github/ISSUE_TEMPLATE/Feature.md",
"chars": 111,
"preview": "---\nname: Feature\nabout: Suggest a new feature or enhancement\nlabels: Feature\n---\n\nWrite your suggestion here.\n"
},
{
"path": ".github/ISSUE_TEMPLATE/Question.md",
"chars": 137,
"preview": "---\nname: Question\nabout: Ask a question regarding software usage\nlabels: Support\n---\n\nMonolog version 1|2|3?\n\nWrite you"
},
{
"path": ".github/SECURITY.md",
"chars": 192,
"preview": "# Reporting a vulnerability\n\nIf you have found any issues that might have security implications,\nplease send a report pr"
},
{
"path": ".github/dependabot.yml",
"chars": 120,
"preview": "version: 2\n\nupdates:\n - package-ecosystem: \"github-actions\"\n directory: \"/\"\n schedule:\n interval: \"monthly\"\n"
},
{
"path": ".github/workflows/continuous-integration.yml",
"chars": 6545,
"preview": "name: \"Continuous Integration\"\n\non:\n - push\n - pull_request\n\npermissions:\n contents: read\n\nenv:\n COMPOSER_ROOT_VERSI"
},
{
"path": ".github/workflows/lint.yml",
"chars": 1049,
"preview": "name: \"PHP Lint\"\n\non:\n - push\n - pull_request\n\npermissions:\n contents: read\n\njobs:\n tests:\n name: \"Lint\"\n\n run"
},
{
"path": ".github/workflows/phpstan.yml",
"chars": 943,
"preview": "name: \"PHPStan\"\n\non:\n - push\n - pull_request\n\npermissions:\n contents: read\n\nenv:\n COMPOSER_ROOT_VERSION: dev-main\n\nj"
},
{
"path": ".gitignore",
"chars": 118,
"preview": "vendor\ncomposer.phar\nphpunit.xml\ncomposer.lock\n.DS_Store\n.php-cs-fixer.cache\n.hg\n.phpunit.result.cache\n.phpunit.cache\n"
},
{
"path": ".php-cs-fixer.php",
"chars": 2236,
"preview": "<?php\n\n$header = <<<EOF\nThis file is part of the Monolog package.\n\n(c) Jordi Boggiano <j.boggiano@seld.be>\n\nFor the full"
},
{
"path": "CHANGELOG.md",
"chars": 50634,
"preview": "### 3.10.0 (2026-01-02)\n\n * Added automatic directory cleanup in RotatingFileHandler (#2000)\n * Added timezone-aware f"
},
{
"path": "LICENSE",
"chars": 1063,
"preview": "Copyright (c) 2011-2020 Jordi Boggiano\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof "
},
{
"path": "README.md",
"chars": 6593,
"preview": "<p align=\"center\"><img src=\"logo.jpg\" alt=\"Monolog\" width=\"400\"></p>\n\n# Monolog - Logging for PHP [\n- [Core Concepts](#core-concepts)\n- [Log Levels](#log-levels)\n- [Config"
},
{
"path": "doc/02-handlers-formatters-processors.md",
"chars": 20600,
"preview": "# Handlers, Formatters and Processors\n\n- [Handlers](#handlers)\n - [Log to files and syslog](#log-to-files-and-syslog)\n "
},
{
"path": "doc/03-utilities.md",
"chars": 928,
"preview": "# Utilities\n\n- _Registry_: The `Monolog\\Registry` class lets you configure global loggers that you\n can then statically"
},
{
"path": "doc/04-extending.md",
"chars": 2506,
"preview": "# Extending Monolog\n\nMonolog is fully extensible, allowing you to adapt your logger to your needs.\n\n## Understanding log"
},
{
"path": "doc/message-structure.md",
"chars": 2297,
"preview": "# Log message structure\n\nWithin monolog log messages are passed around as [Monolog\\LogRecord](../src/Monolog/LogRecord.p"
},
{
"path": "doc/sockets.md",
"chars": 1018,
"preview": "Sockets Handler\n===============\n\nThis handler allows you to write your logs to sockets using [fsockopen](http://php.net/"
},
{
"path": "phpstan-baseline-8.2.neon",
"chars": 141,
"preview": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\tmessage: \"#^Call to deprecated function utf8_encode\\\\(\\\\)\\\\.$#\"\n\t\t\tcount: 1\n\t\t\tpath: s"
},
{
"path": "phpstan-baseline.neon",
"chars": 5955,
"preview": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\trawMessage: 'Property Monolog\\ErrorHandler::$reservedMemory is never read, only writte"
},
{
"path": "phpstan-ignore-by-php-version.neon.php",
"chars": 192,
"preview": "<?php declare(strict_types = 1);\n\n$includes = [];\nif (PHP_VERSION_ID >= 80200) {\n $includes[] = __DIR__ . '/phpstan-b"
},
{
"path": "phpstan.neon.dist",
"chars": 568,
"preview": "parameters:\n level: 8\n\n treatPhpDocTypesAsCertain: false\n reportUnmatchedIgnoredErrors: true\n\n paths:\n "
},
{
"path": "phpunit.xml.dist",
"chars": 790,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNam"
},
{
"path": "src/Monolog/Attribute/AsMonologProcessor.php",
"chars": 1444,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Attribute/WithMonologChannel.php",
"chars": 787,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/DateTimeImmutable.php",
"chars": 583,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/ErrorHandler.php",
"chars": 10256,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/ChromePHPFormatter.php",
"chars": 2266,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/ElasticaFormatter.php",
"chars": 1907,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/ElasticsearchFormatter.php",
"chars": 1839,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/FlowdockFormatter.php",
"chars": 2537,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/FluentdFormatter.php",
"chars": 2078,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/FormatterInterface.php",
"chars": 870,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/GelfMessageFormatter.php",
"chars": 5084,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/GoogleCloudLoggingFormatter.php",
"chars": 1178,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/HtmlFormatter.php",
"chars": 4549,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/JsonFormatter.php",
"chars": 6603,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/LineFormatter.php",
"chars": 9891,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/LogglyFormatter.php",
"chars": 1280,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/LogmaticFormatter.php",
"chars": 1573,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/LogstashFormatter.php",
"chars": 3432,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/MongoDBFormatter.php",
"chars": 3894,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/NormalizerFormatter.php",
"chars": 10611,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/ScalarFormatter.php",
"chars": 1137,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/SyslogFormatter.php",
"chars": 1892,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Formatter/WildfireFormatter.php",
"chars": 4049,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/AbstractHandler.php",
"chars": 2674,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/AbstractProcessingHandler.php",
"chars": 1499,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/AbstractSyslogHandler.php",
"chars": 3225,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/AmqpHandler.php",
"chars": 5070,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/BrowserConsoleHandler.php",
"chars": 9232,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/BufferHandler.php",
"chars": 4660,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ChromePHPHandler.php",
"chars": 4909,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/CouchDBHandler.php",
"chars": 2610,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/CubeHandler.php",
"chars": 5436,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/Curl/Util.php",
"chars": 1613,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/DeduplicationHandler.php",
"chars": 6656,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/DoctrineCouchDBHandler.php",
"chars": 1150,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/DynamoDbHandler.php",
"chars": 1934,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ElasticaHandler.php",
"chars": 3743,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ElasticsearchHandler.php",
"chars": 7271,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ErrorLogHandler.php",
"chars": 2673,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FallbackGroupHandler.php",
"chars": 1720,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FilterHandler.php",
"chars": 7091,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php",
"chars": 649,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php",
"chars": 2438,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php",
"chars": 1083,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FingersCrossedHandler.php",
"chars": 8185,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FirePHPHandler.php",
"chars": 5153,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FleepHookHandler.php",
"chars": 3525,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FlowdockHandler.php",
"chars": 3482,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FormattableHandlerInterface.php",
"chars": 757,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/FormattableHandlerTrait.php",
"chars": 1268,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/GelfHandler.php",
"chars": 1454,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/GroupHandler.php",
"chars": 3269,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/Handler.php",
"chars": 1015,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/HandlerInterface.php",
"chars": 2779,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/HandlerWrapper.php",
"chars": 3355,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/IFTTTHandler.php",
"chars": 2269,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/InsightOpsHandler.php",
"chars": 2088,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/LogEntriesHandler.php",
"chars": 1907,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/LogglyHandler.php",
"chars": 4111,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/LogmaticHandler.php",
"chars": 2634,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/MailHandler.php",
"chars": 2245,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/MandrillHandler.php",
"chars": 2540,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/MissingExtensionException.php",
"chars": 473,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/MongoDBHandler.php",
"chars": 2472,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/NativeMailerHandler.php",
"chars": 5200,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/NewRelicHandler.php",
"chars": 5837,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/NoopHandler.php",
"chars": 908,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/NullHandler.php",
"chars": 1331,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/OverflowHandler.php",
"chars": 4312,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/PHPConsoleHandler.php",
"chars": 12298,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ProcessHandler.php",
"chars": 5484,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ProcessableHandlerInterface.php",
"chars": 1185,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ProcessableHandlerTrait.php",
"chars": 1618,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/PsrHandler.php",
"chars": 2470,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/PushoverHandler.php",
"chars": 8111,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/RedisHandler.php",
"chars": 2734,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/RedisPubSubHandler.php",
"chars": 1681,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/RollbarHandler.php",
"chars": 3564,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/RotatingFileHandler.php",
"chars": 7751,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SamplingHandler.php",
"chars": 3917,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SendGridHandler.php",
"chars": 3089,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/Slack/SlackRecord.php",
"chars": 10660,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SlackHandler.php",
"chars": 7160,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SlackWebhookHandler.php",
"chars": 3924,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SocketHandler.php",
"chars": 12127,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SqsHandler.php",
"chars": 1750,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/StreamHandler.php",
"chars": 8950,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SymfonyMailerHandler.php",
"chars": 3529,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SyslogHandler.php",
"chars": 1687,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SyslogUdp/UdpSocket.php",
"chars": 1965,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/SyslogUdpHandler.php",
"chars": 4714,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/TelegramBotHandler.php",
"chars": 9513,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/TestHandler.php",
"chars": 6892,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/WebRequestRecognizerTrait.php",
"chars": 504,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/WhatFailureGroupHandler.php",
"chars": 1911,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Handler/ZendMonitorHandler.php",
"chars": 2851,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/JsonSerializableDateTimeImmutable.php",
"chars": 1253,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Level.php",
"chars": 5332,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/LogRecord.php",
"chars": 3460,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Logger.php",
"chars": 23086,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/ClosureContextProcessor.php",
"chars": 1512,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/GitProcessor.php",
"chars": 1984,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/HostnameProcessor.php",
"chars": 736,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/IntrospectionProcessor.php",
"chars": 3790,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/LoadAverageProcessor.php",
"chars": 1631,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/MemoryPeakUsageProcessor.php",
"chars": 864,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/MemoryProcessor.php",
"chars": 1804,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/MemoryUsageProcessor.php",
"chars": 845,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/MercurialProcessor.php",
"chars": 2096,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/ProcessIdProcessor.php",
"chars": 634,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/ProcessorInterface.php",
"chars": 576,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/PsrLogMessageProcessor.php",
"chars": 3077,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/TagProcessor.php",
"chars": 1200,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/UidProcessor.php",
"chars": 1492,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Processor/WebProcessor.php",
"chars": 3471,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Registry.php",
"chars": 4022,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/ResettableInterface.php",
"chars": 973,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/SignalHandler.php",
"chars": 3906,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Test/MonologTestCase.php",
"chars": 2180,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Test/TestCase.php",
"chars": 517,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "src/Monolog/Utils.php",
"chars": 8928,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Attribute/AsMonologProcessorTest.php",
"chars": 1105,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Attribute/WithMonologChannelTest.php",
"chars": 522,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/ErrorHandlerTest.php",
"chars": 5848,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/ChromePHPFormatterTest.php",
"chars": 3721,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/ElasticaFormatterTest.php",
"chars": 2337,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/ElasticsearchFormatterTest.php",
"chars": 2068,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/FlowdockFormatterTest.php",
"chars": 1567,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/FluentdFormatterTest.php",
"chars": 1814,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/GelfMessageFormatterTest.php",
"chars": 9156,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/GoogleCloudLoggingFormatterTest.php",
"chars": 1791,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/JsonFormatterTest.php",
"chars": 14188,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/LineFormatterTest.php",
"chars": 13303,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/LogglyFormatterTest.php",
"chars": 1334,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/LogmaticFormatterTest.php",
"chars": 1099,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/LogstashFormatterTest.php",
"chars": 5807,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/MongoDBFormatterTest.php",
"chars": 9301,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/NormalizerFormatterTest.php",
"chars": 19061,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/ScalarFormatterTest.php",
"chars": 3102,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/SyslogFormatterTest.php",
"chars": 3543,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Formatter/WildfireFormatterTest.php",
"chars": 3522,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/AbstractHandlerTest.php",
"chars": 2518,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/AbstractProcessingHandlerTest.php",
"chars": 4853,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/AmqpHandlerTest.php",
"chars": 4253,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/BrowserConsoleHandlerTest.php",
"chars": 4798,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/BufferHandlerTest.php",
"chars": 6015,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/ChromePHPHandlerTest.php",
"chars": 4847,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/CouchDBHandlerTest.php",
"chars": 768,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/DeduplicationHandlerTest.php",
"chars": 6184,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php",
"chars": 1465,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/DynamoDbHandlerTest.php",
"chars": 2277,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/ElasticaHandlerTest.php",
"chars": 7672,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/ElasticsearchHandlerTest.php",
"chars": 7710,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/ErrorLogHandlerTest.php",
"chars": 2196,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/ExceptionTestHandler.php",
"chars": 541,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/FallbackGroupHandlerTest.php",
"chars": 6141,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/FilterHandlerTest.php",
"chars": 7394,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/FingersCrossedHandlerTest.php",
"chars": 11256,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/FirePHPHandlerTest.php",
"chars": 3091,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/Fixtures/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "tests/Monolog/Handler/FleepHookHandlerTest.php",
"chars": 2066,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/FlowdockHandlerTest.php",
"chars": 2695,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/GelfHandlerTest.php",
"chars": 3545,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/GroupHandlerTest.php",
"chars": 4934,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/HandlerWrapperTest.php",
"chars": 2116,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/InsightOpsHandlerTest.php",
"chars": 2534,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/LogEntriesHandlerTest.php",
"chars": 2554,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/LogmaticHandlerTest.php",
"chars": 2827,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/MailHandlerTest.php",
"chars": 2261,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
},
{
"path": "tests/Monolog/Handler/MongoDBHandlerTest.php",
"chars": 2193,
"preview": "<?php declare(strict_types=1);\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@sel"
}
]
// ... and 46 more files (download for full content)
About this extraction
This page contains the full source code of the Seldaek/monolog GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 246 files (969.4 KB), approximately 245.4k tokens, and a symbol index with 1607 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.