Replies: 2 comments 1 reply
-
Hi @erdengk , thanks for your thoughts and analysis. Generally I like your approach to optimize the accessibility of the log. That is indeed an open issue and an important addition for the overall operability of Polypheny. However, I have a few remarks on your idea.
The question is always why do we even log and when to we want to use it? And in general it will always come down to investigating a faulty behavior or even a system crash. If in the future the log should be accessible using the db. I would suggest this to be a feature of the UI and a dedicated log & trace file viewer. A common practice is to read the log file chunk wise. That being 1000 lines at a time (or any other arbitrary) number. To sum things up, I think there are always solution like |
Beta Was this translation helpful? Give feedback.
-
Hi @erdengk So regarding the architecture. The UI and the DB can be installed separately, meaning they can reside on different systems. Therefore, I would really avoid loading the log into the DB. So for Control to keep things simple and neat, I would propose based on your suggestions to dynamically load the last 1000 lines or so from the one logfile that is generated form the currently running instance. If a user then chooses to access by date you can still do this by looking for the required files in the given directory. |
Beta Was this translation helpful? Give feedback.
-
I think this issue needs a detailed discussion, so create a new discussion here.
Dynamically load log lines from server
As mentioned in the question, in test scenarios or long-running deployments with higher log levels, the logs can get very large.
When the log file becomes very large, it can be very resource-intensive to read the file directly. If it is designed in this way, when we want to query the logs of the specified date, it is a very troublesome thing.
So I think it is a reasonable and convenient practice to store the logs into the database.
The reasons are as follows:
But this design will also have some new problems.
The solution of one problem may often lead to new problems, and we need to balance the new problems with the old ones.
The above analysis is just my personal analysis, I don't know much about the overall architecture of DB. Perhaps reading the log file directly is a better way? Which plan do you think is better?
@vogti
Beta Was this translation helpful? Give feedback.
All reactions