'Send info from Angular to Java to use LOGGER.info for logging purposes
At first I had hoped to skate by, by using a console.log(); in the ui, but as I suspected, I don't think our logging, even though the UI is a service, will catch it.
I'm searching, not finding a way to do this, short of possibly an npm library like ngx-logger, but unclear if that will work, or just creating an entire new endpoint for this express purpose, so thought I'd ask first:
I need to send some info from a button click in Angular (9, if it makes a difference) to Java to use it in a LOGGER.info for logging purposes - is there an easy way of doing this, or do I need to create an endpoint, etc..?
Solution 1:[1]
You got to create an end point for this. A RESTful application only interacts with front end via end points only.
By the way, I am also assuming that your application would also be sending API calls to perform action. These actions themselves can print additional informaation like - User X shooped for product Y, so you don't always have to log via front end.
TLDR: Yes. An end point is required. Though you can buffer them at front end, send it one go.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gaurav |
