<p>Anyone still looking for how to fix this, the answer is givin in the link above specifically the comment here: <a href="https://github.com/craftcms/cms/issues/13963#issuecomment-1830116976" rel="noreferrer">https://github.com/craftcms/cms/issues/13963#issuecomment-1830116976</a></p>
<blockquote>
<p>If you can't run php craft update because the incompatible psr/log version is already installed, you need to update to 4.5.11.1 manually using Composer. First, require that specific version of Craft with Composer:
<code>composer require craftcms/cms:4.5.11.1</code>
This will upgrade Craft to the specified version, which pins the psr/log dependency, so it will also downgrade that library to the supported version. After that, you can run php craft update again.
Alternatively, if you're on an older version and can't update Craft for any reason, you can workaround this issue by explicitly requiring psr/log 1.x in your project:
<code>composer require psr/log:^1.0.0</code>
This will downgrade the package and fix the compatibility issue. Once you upgrade to Craft 4.5.11.1, you can remove the direct depency again.</p>
</blockquote>

CC BY-SA 4.0
2023-12-02T15:28:34.930Z
2023-12-02T15:28:34.930Z
jpwdesigns
<p>for now you might try to downgrade :</p>
<ul>
<li>psr/log to 1.1.4</li>
<li>samdark/yii2-psr-log-target to 1.1.3</li>
</ul>
<p>this error cause of update <code>samdark/yii2-psr-log-target</code> from 1.1.3 to 1.1.4</p>
<p>based : <a href="https://github.com/craftcms/cms/issues/13963" rel="nofollow noreferrer">https://github.com/craftcms/cms/issues/13963</a></p>

CC BY-SA 4.0
2023-11-24T06:26:39.250Z
Thank you so much! That solved it.
kr37
CC BY-SA 4.0
2023-11-24T06:36:52.847Z
For clarity, this is just a (hopefully temporary) bug in a dependency package which was introduced within the past 48 hours. With any luck, it’ll soon be fixed by the package maintainer (or patched within Craft itself).
Lindsey D
CC BY-SA 4.0
2023-11-24T09:22:22.970Z
Yup it's already fixed
Nixxian365
CC BY-SA 4.0
2023-11-26T17:45:34.767Z
This was fixed in Craft 4.5.11.1 https://github.com/craftcms/cms/releases/tag/4.5.11.1
Brad Bell
CC BY-SA 4.0
2023-11-28T14:57:09.453Z
How do I fix this? How do I downgrade samdark/yii2-psr-log-target?

I am unable to upgrade craft as this has already broken it. Thanks
Mark
CC BY-SA 4.0
2023-11-24T03:54:13.210Z
2023-11-28T18:20:53.537Z
2023-11-28T18:20:53.537Z
Nixxian365
<p><code>&lt;Irrelevent preliminary context&gt;</code> Somewhere in the process not understanding modules and whether they get to have Variable classes, and running <code>php craft make module</code> and <code>composer dump-autoload -a</code> <code>&lt;/Irrelevant preliminary context&gt;</code> I edited the main craft/composer.json and ran into troubles. Ended up nuking the vendor folder and reinstalling, but now I have this error, which I can't get rid of after many hours, and which seems to happen very early in Craft's initialization process:</p>
<p><strong>Type of craft\log\MonologTarget::$logger must be ?Psr\Log\LoggerInterface (as in class samdark\log\PsrTarget)</strong></p>
<p>coming in
<code>craft/vendor/craftcms/cms/src/log/MonologTarget.php</code> at the class definition of MonologTarget</p>
<p>Any suggestions other than a complete reinstall of Craft?</p>

<composer>
Monolog Logger error
# Monolog Logger error

(Asked by: username_0 on 2023-11-23)

Somewhere in the process not understanding modules and whether they get to have Variable classes, and running `php craft make module` and `composer dump-autoload -a`  I edited the main craft/composer.json and ran into troubles. Ended up nuking the vendor folder and reinstalling, but now I have this error, which I can't get rid of after many hours, and which seems to happen very early in Craft's initialization process:

**Type of craft\log\MonologTarget::$logger must be ?Psr\Log\LoggerInterface (as in class samdark\log\PsrTarget)**

coming in
`craft/vendor/craftcms/cms/src/log/MonologTarget.php` at the class definition of MonologTarget

Any suggestions other than a complete reinstall of Craft?

**Tags:** composer


---

## 2 answers

### Answer by username_2 on 2023-11-24. Score: 4 | Accepted answer

for now you might try to downgrade :

* psr/log to 1.1.4
* samdark/yii2-psr-log-target to 1.1.3

this error cause of update `samdark/yii2-psr-log-target` from 1.1.3 to 1.1.4

based : <https://github.com/craftcms/cms/issues/13963>

> **Comments:**
> **username_0**: Thank you so much! That solved it.  
> **username_3**: For clarity, this is just a (hopefully temporary) bug in a dependency package which was introduced within the past 48 hours. With any luck, it’ll soon be fixed by the package maintainer (or patched within Craft itself).  
> **username_2**: Yup it's already fixed  
> **username_4**: This was fixed in Craft 4.5.11.1 https://github.com/craftcms/cms/releases/tag/4.5.11.1  
> **username_5**: How do I fix this? How do I downgrade samdark/yii2-psr-log-target?  I am unable to upgrade craft as this has already broken it. Thanks  

---

### Answer by username_1 on 2023-12-02. Score: 6

Anyone still looking for how to fix this, the answer is givin in the link above specifically the comment here: <https://github.com/craftcms/cms/issues/13963#issuecomment-1830116976>

> If you can't run php craft update because the incompatible psr/log version is already installed, you need to update to 4.5.11.1 manually using Composer. First, require that specific version of Craft with Composer:
> `composer require craftcms/cms:4.5.11.1`
> This will upgrade Craft to the specified version, which pins the psr/log dependency, so it will also downgrade that library to the supported version. After that, you can run php craft update again.
> Alternatively, if you're on an older version and can't update Craft for any reason, you can workaround this issue by explicitly requiring psr/log 1.x in your project:
> `composer require psr/log:^1.0.0`
> This will downgrade the package and fix the compatibility issue. Once you upgrade to Craft 4.5.11.1, you can remove the direct depency again.


---

