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

Dynamic cross-instance register/unregister #586

Closed
kiblik opened this issue Nov 12, 2023 · 4 comments
Closed

Dynamic cross-instance register/unregister #586

kiblik opened this issue Nov 12, 2023 · 4 comments

Comments

@kiblik
Copy link

kiblik commented Nov 12, 2023

Hello,

we are developing and running a Django app

  • which is horizontally scalable on main Django instances as well as on Celery instances
  • with a focus on allowing a user to configure as many parameters from inside of the application (without the necessity to change environment variables and/or restart instances)

In this setup, we would like to get users the ability to enable and disable audit-logging.

Question: Is this possible? I do not think so. But I will be more than happy if somebody will provide instructions on how to achieve our goals.

The reason why it is not possible in my opinion: To enable/disable audit-logging for each model, it is necessary to call auditlog.register(Model_Name)/auditlog.unregister(Model_Name) and this call has only local effect. So change will happen only on the instance which processes the user's request and it won't be propagated to other Django and Celery instances.

Because of this, if we would like to stay scalable, we are forced to change the setting via environment variables before each instance is started.

Am I right or is there some way, to dynamically enable/disable audit-logging?

@hramezani
Copy link
Member

hramezani commented Nov 22, 2023

Please check my comment on a related issue. probably it would be useful.

@kiblik
Copy link
Author

kiblik commented Nov 23, 2023

Please check my comment on a related issue. probably it would be useful.

Thanks @hramezani. Yes, your proposal might be the way for our environment. Let's wait for implementation, review and release.

@hramezani
Copy link
Member

@kiblik We merged #590 and it will be available in the next beta release for testing.

@kiblik
Copy link
Author

kiblik commented Dec 11, 2023

@hramezani, looks nice, thank you.
I might be able to run a local test, but I cannot add to our project until your change is not part of an official (non-beta) release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants