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

Configurable logging #2184

Open
moisses89 opened this issue Aug 12, 2024 · 0 comments
Open

Configurable logging #2184

moisses89 opened this issue Aug 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@moisses89
Copy link
Member

What is needed?

Every time that Debug is enabled, is enabled in all the code and is hard to follow sometimes.
With this enhancement we should be able to enable DEBUG for some parts of code, as for example to everything related with ERC20 indexer, and leave the rest in INFO level.

Log groups proposal

ERC20_721_INDEXER_LOG_LEVEL
PROXY_FACTORY_INDEXER_LOG_LEVEL
SAFE_EVENTS_INDEXER_LOG_LEVEL
INTERNAL_TX_INDEXER_LOG_LEVEL
API_LOG_LEVEL (all the endpoints)
BALANCES_API_LOG_LEVEL
MESSAGES_API_LOG_LEVEL
ALL_TRANSACTIONS_API_LOG_LEVEL

Proposed solution

Django logging is configurable and we can define different environment variables to enable just DEBUG in some parts of the service. For example:

#ERC20_LOGGER
       "safe_transaction_service.history.indexers.erc20_events_indexer": {
            "level": env("ERC20_INDEXER_LEVEL", default="INFO")
        },
        "safe_transaction_service.history.tasks.index_erc20_events_task": {
            "level": env("ERC20_INDEXER_LEVEL", default="INFO")
        },

Just remark that if DEBUG is enabled in general way all the parts of the code should be log level DEBUG

@moisses89 moisses89 added the enhancement New feature or request label Aug 12, 2024
@moisses89 moisses89 self-assigned this Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant