0

i have more a structural question.

What i have:

i have a Spring MVC which is used to run a multiple asynchronous long-running back-end tasks. AngularJS for UI.

The tasks each have own ID in my custom data-cache implementation. Each tasks writing it's logs by log4j2 file appender.

What i want to do:

To view the logs of each process in AngularJS front-end. I'm thinking that i can do thing for example:

Each 10 seconds Angular send request to Spring MVC Controller with task ID. Spring controller parsing the log4j2 file and returning the logs.

But something says me that is not the right way.

Anyone know what is the best solution for this?

1
  • You can also have seperate file for each Task ID. Commented Jul 12, 2016 at 7:53

2 Answers 2

2

It's not exactly the same as what you want to do and I'm not sure this is the best solution.

You can combine Spring Scheduling Tasks and WebSocket.

Explanation :

Your Spring MVC backend will send every 10s (using Scheduled tasks) information to your AngularJS frontend (using WebSocket)

Documentation :

Sign up to request clarification or add additional context in comments.

Comments

0

I think, its better to make use of elastic kibana dashboard for better logs analysis. Just push all logs to elastic dynamically and map it to kibana. Its is nearly real time. Once setup use kibana web page as iframe in your angular js web page.

2 Comments

i use AWS Cloud Watch. But in this case, i want users to be able to see the logs of their running processes
Yes this is for users only. You have to publish Kibana Dashboard to end users only. This Dashboard will be accessible from your main web application to all clients by merging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.