Mautic Community Forums

Logging

Hi. How do I write to the mautic log file from php scripts? Just can’t seem to find any docs on how to do this?



Thanks



Russell

Hi. How do I write to the mautic log file from php scripts? Just can’t seem to find any docs on how to do this?

Thanks

Russell

I had this question as well. What I discovered is that Mautic logging is based on the Symfony Monolog Bundle

If you have a factory handle:

$this->factory->getLogger()->log('error', 'your message here');

where ‘error’ is your log level (I think info, debug, critical are also available)