Skip to content

Commit

Permalink
Merge pull request #13544 from craftcms/force-one-line-logs
Browse files Browse the repository at this point in the history
Force one line logs via env
  • Loading branch information
brandonkelly committed Aug 15, 2023
2 parents d4b1e22 + f25290a commit 539b1b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@

### System
- Added support for setting environmental values in a “secrets” PHP file, identified by a `CRAFT_SECRETS_PATH` environment variable. ([#13283](https://github.com/craftcms/cms/pull/13283))
- Added support for the `CRAFT_LOG_ALLOW_LINE_BREAKS` environment variable. ([#13544](https://github.com/craftcms/cms/pull/13544))
- All generated URL param characters are now properly encoded. ([#12796](https://github.com/craftcms/cms/issues/12796))
- `migrate` commands besides `migrate/create` no longer create the migration directory if it doesn’t exist yet. ([#12732](https://github.com/craftcms/cms/pull/12732))
- When `content` table columns are resized, if any existing values are too long, all column data is now backed up into a new table, and the overflowing values are set to `null`. ([#13025](https://github.com/craftcms/cms/pull/13025))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Unreleased (4.5)
- Added `craft\events\AssetBundleEvent`.
- Added `craft\web\View::EVENT_AFTER_REGISTER_ASSET_BUNDLE`.
- Added support for the `CRAFT_LOG_ALLOW_LINE_BREAKS` environment variable. ([#13544](https://github.com/craftcms/cms/pull/13544))
- Fixed multiple issues with Selectize inputs.
- Fixed a bug where <kbd>Command</kbd>/<kbd>Ctrl</kbd> + clicks on “New entry” button menu options would open the Entries index page in a new tab, and redirect to the Edit Entry page in the current tab. ([#13550](https://github.com/craftcms/cms/issues/13550))

Expand Down
3 changes: 2 additions & 1 deletion src/log/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ public function getTargets(): array
static::TARGET_CONSOLE,
static::TARGET_QUEUE,
])->mapWithKeys(function($name) {
$allowLineBreaks = (bool) (App::env('CRAFT_LOG_ALLOW_LINE_BREAKS') ?? App::devMode());
$config = $this->monologTargetConfig + [
'name' => $name,
'enabled' => false,
'extractExceptionTrace' => !App::devMode(),
'allowLineBreaks' => App::devMode(),
'allowLineBreaks' => $allowLineBreaks,
'level' => App::devMode() ? LogLevel::INFO : LogLevel::WARNING,
];

Expand Down

0 comments on commit 539b1b6

Please sign in to comment.