You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike the dev settings, which work like a charm, but about causing problems, one basically could think that the only possible problem of these settings is "lack of proper log".
However, I've been working in an app for several years, since symfony 3 (where it worked ok), but when trying to upgrade to symfony 5 (and later, 6.x), it had a weird misfunctionality when a user tried to login in the app. The only difference I could find with other apps new or upgraded that work without problem (except the above mention to "lack of proper log") is that this uses a custom query for login, instead of the default method. Only in some specific circumstances in prod the login worked as expected, while in the rest, it didn't like in dev, without any kind of logging that could help to debug the issue.
Since this "lack of proper log" didn't prevent any other apps to work, I didn't think to cause any misfunction in the app itself. Then I decided to have some log in order to debug the problem by cloning the dev settings in the "main" section of monolog settings for prod, and since by doing nothing else I started to have proper log, I didn't do anything else. The misfunction was still happenning. Only when I decided to clean the prod cache (since I think shouldn't be necessary since there were no changes in the code), I found out that the app worked as expected, and the misfunction went away. I've been able to reproduce this behaviour in the three servers where I've tried to test the upgraded app.
At this moment, I don't know why this happens, and this is the reason why I write this issue, in order to prevent others to find the same problem. There might be an issue somewhere else that leads to this, or it's just that "the new default prod settings are buggy and should be changed".
I don't understand the relation between using a custom query to login and getting (or not getting) logs.
The default config for the prod environment uses a fingers_crossed handler with an action level of error, so it won't log anything unless there is a log that is at least at the error level to activate the logging in this handler (which would then also log the previous messages kept in the buffer).
Regarding the need to clear the prod cache, changing configuration files require clearing the cache in non-debug mode. There is no automatic tracking of changes in config files in non-debug mode (as the automatic refreshing requires a bunch of IO during initialization, which is far from being free in term of performance, and the prod environment is not meant to change configuration all the time but to be fast).
The default prod settings since about symfony 5 in monolog.yaml are these:
Unlike the dev settings, which work like a charm, but about causing problems, one basically could think that the only possible problem of these settings is "lack of proper log".
However, I've been working in an app for several years, since symfony 3 (where it worked ok), but when trying to upgrade to symfony 5 (and later, 6.x), it had a weird misfunctionality when a user tried to login in the app. The only difference I could find with other apps new or upgraded that work without problem (except the above mention to "lack of proper log") is that this uses a custom query for login, instead of the default method. Only in some specific circumstances in prod the login worked as expected, while in the rest, it didn't like in dev, without any kind of logging that could help to debug the issue.
Since this "lack of proper log" didn't prevent any other apps to work, I didn't think to cause any misfunction in the app itself. Then I decided to have some log in order to debug the problem by cloning the dev settings in the "main" section of monolog settings for prod, and since by doing nothing else I started to have proper log, I didn't do anything else. The misfunction was still happenning. Only when I decided to clean the prod cache (since I think shouldn't be necessary since there were no changes in the code), I found out that the app worked as expected, and the misfunction went away. I've been able to reproduce this behaviour in the three servers where I've tried to test the upgraded app.
At this moment, I don't know why this happens, and this is the reason why I write this issue, in order to prevent others to find the same problem. There might be an issue somewhere else that leads to this, or it's just that "the new default prod settings are buggy and should be changed".
If you want more details, I started a thread in stackoverflow
Thanks in advance.
The text was updated successfully, but these errors were encountered: