switching logger to monolog

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kopz
Posts: 13
Joined: 18 Jan 2024, 14:11

switching logger to monolog

Post by kopz » 12 Feb 2025, 08:30

Hi,

How do you configure logging so that it writes to file instead of db (madmin_log) ?

I've installed ai-monolog but I'm having some trouble with using that as the default logger (globally).

Info:
PHP 8.2
aimeos/ai-monolog 2023.10.2
aimeos/aimeos-laravel 2023.10.8
laravel/framework 10.48.11

User avatar
aimeos
Administrator
Posts: 8536
Joined: 01 Jan 1970, 00:00

Re: switching logger to monolog

Post by aimeos » 13 Feb 2025, 11:01

You need to overwrite the addLogger() method in the "aimeos.context" service:
- https://github.com/aimeos/aimeos-larave ... hp#L83-L85
- https://github.com/aimeos/aimeos-larave ... #L160-L165

There, you can add your Monolog logger instead like this:
https://github.com/aimeos/ai-monolog#setup
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kopz
Posts: 13
Joined: 18 Jan 2024, 14:11

Re: switching logger to monolog

Post by kopz » 14 Feb 2025, 13:29

Thank you

Post Reply