Magento2: Log cleaning in DB

Created on 22 Nov 2016  路  9Comments  路  Source: magento/magento2

According to M2.0 guide at http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-log.html it suggests the way to clean logs in Database, but in M2.1.x there is no such function available under ./bin/magento.

My DB tables report_event, report_viewed_product_index, customer_visitor contain more than a few million entries combined. That is pure cluttering of Database. In M1 there is an option of automatic logs cleaning via cron.

I want to keep up to dat褍 logs in these tables only for past 30 days and no more...

What is the option for M2.1.x?

Setup Clear Description Format is not valid bug report

Most helpful comment

@krutkoroma79911 This should be considered a feature request. One that is badly needed I might add. I don't know how much time I waste just clearing our junk that Magento should have a cron job for at the very least.

All 9 comments

@devdesco-ceo This is a badly needed function for sure, not just for DB, but other logs as well. @magento-team I hope this is in the works.

You bet!

@devdesco-ceo thank you for your feedback.
Please format your issue description according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

Preconditions

1. Install Magento 2.1

Steps to reproduce

1. Login to server via SSH (Magento CLI Version 2.1.2)
2. Run the bin/magento command
3. You will see that no commands are available to clear log tables

Actual and Expected result

Expected result:
When running the bin/magento command I should see the commands for log cleaning 
displayed under the list of available commands.

I should then be able to clear database logs by running the following command
magento log:clean [--days=<clean logs older than>]

Actual result:
No option is available for log cleaning which contradicts the following document.

Resources

Magento Dev Docs - Clean the logs

In need of this badly

@viktor-zhuromskyy Hello, The GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for technical questions.

@krutkoroma79911 This should be considered a feature request. One that is badly needed I might add. I don't know how much time I waste just clearing our junk that Magento should have a cron job for at the very least.

@viktor-zhuromskyy, hi, The GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for technical questions.

@magento-engcom-team this is not a technical question but a feature request, it seems to me this issue has been closed erroneously, could you please reconsider? thanks!!!

Was this page helpful?
0 / 5 - 0 ratings