We are using the logging libraries for the Java based development. But AFAIK, We haven’t use any logging methods to the OWA development.
As the good practice, We should follow some logging manner to identify some critical issues. There are some advanced libraries for the JS based logging. Anyway, I have implemented a simple log appender to the System Administration OWA and I am logging every thing through this log Appender.
Easy to handle the log types in the OWA
Easy to control the log types which are going to print in the console through the log appender easily
I can modify the log pattern easily through the log appender easily
It may easy to generate a log file
Anyway, We should improve this log appender with some additional features
CC : @dkayiwa
Now we are implementing the logger on the client side. So storing the logs on the client side will be a huge blocker at this time.
Creating a log file in the server or storing the logs in the database will not be a possible solution for this scenario. because,
We want to use another REST to create log file or store in the database. So what will be the solution if this REST call failed?
We want to access the REST every time to store the logs. (Bulk transfer is not possible, because what can we do if there are any break points during that time duration?
It may take some time to achieve this task using REST. So we can’t call the REST every time to transfer the logs to the server.(huge delay)
So In my view, Using REST services again for the logging is not a good solution to achieve this task.
What is the Solution?
why we can’t use browser session/cookie for this purpose? Because server side doesn’t need this logs anymore. The developer or user who is working in the front end is only wanted this log by that time or after.
So I just think about this idea,
Store the logs into session/cookie(single or multiple) if logging is enabled.
Create one common page for logs accessing which can contain the capability to retrieve the logs from the browser session/cookie.
Improve that page to view as a logger or create a log file automatically (we can simply create a text file with the logs using JS)
The user can get the immediate logs in their console. if the user wants to get some previous logs, he can just visit that page to get that logs. (Anymore if the session/cookie is lost - there are no way )
I think It will be a simple and good way for the front-end developers and light weight implementation for the logger.
Note: We can create some algorithms to create multiple cookies for the logs. Because storing the huge logs into a single cookie is not possible. So we want to follow some multi cookie management here.
If you have any suggestions or idea, let’s discuss to improve this talk
@suthagar23, taking a step back, what is the “user story” behind what you’re doing here? Why are we storing logs?
E.g. one valuable thing is to track user behavior, to analyze how the app is being used. In this case you need to get those logs to the server side.
I don’t personally see much value in storing logs long-term on the client-side. Is it feasible for a typical end-user to find these and do something useful with them? Using browser db storage seems overkill for the small use cal…
@darius, The user story in my view is,
If someone can’t get information through the OWA, then there might be server side or client side problems. We had server-side logs to analyze that problem but haven’t client-side logs for now.
Here we totally depend on the REST services to run the OWA. If the REST is working fine, then there might be some problems on the client side. Because we are doing some sort of logic and some functionalities to improve the OWA experience from the client side using JS. So I thought, It is important to keep a logging facility in the front-end.
Actually, If we use the console for the logging when the user moves to another tap or any where it might be erased. So I planned to store anywhere to get the complete log.
E.g. one valuable thing is to track user behavior, to analyze how the app is being used. In this case, you need to get those logs to the server side.
This may be another use case of this implementation. We can track to improve the user experience
But Is it fine to send every log to server side using another REST calls?