Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass closure as logger configuration option #34

Open
kminek opened this issue Apr 14, 2023 · 7 comments
Open

Allow to pass closure as logger configuration option #34

kminek opened this issue Apr 14, 2023 · 7 comments

Comments

@kminek
Copy link
Contributor

kminek commented Apr 14, 2023

currently you need to pass monolog logger instance inside config file. this is unfortunate as logger is created for each request even in situations where nothing is logged. also you cannot use Yii aliases to configure monolog handlers.

@samdark
Copy link
Owner

samdark commented Apr 15, 2023

Good idea. Do you have time to implement it?

@kminek
Copy link
Contributor Author

kminek commented Apr 15, 2023

Sure here it is: #35

@bencroker
Copy link

This change breaks classes that extend PsrTarget and override the setLogger method, please revert!
https://github.com/craftcms/cms/blob/88a80e76493b3b4ef53512bb34742c116dda191c/src/log/MonologTarget.php#L114-L117

Screenshot 2023-04-15 at 17 02 37

@samdark samdark reopened this Apr 16, 2023
@samdark
Copy link
Owner

samdark commented Apr 16, 2023

Owww. Sorry. Removed both tag and commit.

@samdark
Copy link
Owner

samdark commented Apr 16, 2023

@kminek we can still solve it but with keeping the interface.

@kminek
Copy link
Contributor Author

kminek commented Apr 16, 2023

@samdark second attempt: #36

@bencroker
Copy link

Owww. Sorry. Removed both tag and commit.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants