2

I'm dealing with a development task that needs the client to be able to read log messages. The client has no access to filesystem, so common log files are not usable.

I was thinking about logging messages in the DB and then make them readable from Magento backend. I'm aware of the performance drawbacks of DB logging vs file logging, but that logging infrastructure would be used only for a specific task, so there should be only few messages per day.

Does an extension like that exist?

3 Answers 3

3

There is a extension from FireGento, called FireGento_Logger which implements various logging adapters, such as DB. You can also live view the logs from the backend.

Currently implemented adapters (multiple logging targets are possible):

  • File (Magento default)
  • File (Advanced Format)
  • E-Mail
  • Database
  • XMPP (Jabber, Google Talk)
  • Graylog2
  • RSyslog (UDP)
  • Loggly (UDP/HTTPS)
  • Chromelogger

Link: https://github.com/firegento/firegento-logger

Personal note: I'm using it and it works really fine. Especially the filtering of the log-messages via grid is awesome. Much better than digging through the files :-)

3
  • Thanks for your answer. Does FireGento_Logger rewrite the standard Mage::log() method or does it implements its own method? I would like to log into DB only certain messages from a specific extension, not all of them. Thanks.
    – ermannob
    Dec 3, 2014 at 9:37
  • github.com/firegento/firegento-logger/blob/master/src/app/code/… ;-) From what I see here, there is a new writer_model (default/core is: Zend_Log_Writer_Stream, FireGento_Logger is: FireGento_Logger_Model_Queue + the writer models for the targets. So the log method itself is untouched. Dec 3, 2014 at 10:12
  • Thank you for your suggestions. Looking at the code, the extension actually takes over the standard Mage::log() method, so some care is needed when configuring FireGento_Logger. Anyway the RegEx target selector lets me choose what to do with each log message, by specifing a log filename and then matching it with regex.
    – ermannob
    Dec 3, 2014 at 11:00
3

here is an extension that reads the logs and shows them in a friendly format: https://github.com/fbrnc/Aoe_LogViewer.
it does not use the db for storing error messages. And that's not even a good idea. What if you have to log an error regarding the db connection?

1
  • +1 for logging an error regarding the db connection. Good point. Thats what we have other checks for in our case, but needs to be considered. Dec 3, 2014 at 9:20
2

I'v created an Extension some time ago, which allows to read the log files in your Magento var/log directory.

You can find the extension here: https://github.com/mhauri/Mhauri_LogView

Hope it will be helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.