When I call any REST clients by using Ivy.rest().client(...), it will have the log with the category name [rest_client] from IVY Core. However, I want to make the log messages written into the specific log files of each services. With the same category name for all REST services like this, I could not find any way to configure in log4jconfig.xml to make it correct. If anyone have ideas to change that category name or change the log4j configuration, please help. Thanks in advance. asked 29.08.2019 at 04:11 Lieu Vo |
Thank you for your suggestion. But I have traced Ivy core, and I see: every time Ivy rest create a WebTarget instance, it registers a filter to trace log with specific category name "rest_client" in RestCallLoggingAndHistoryFilter class. It traces all rest request with same one category. With your suggestion, I only could forward log of all requests to one log file. So, my requirement needs to separate the log content for every request, every request to every log file. How could I do that? I tried with log4j content filter by regular expression, but it is not working well. And I tried another solution: use java reflection for changing the runtimeLogger property in that filter to separate them to every log file for every request. But I think this solution not good if the variable has been changed the name in the future or this way will make performance slower a little bit. Do you have any better solution for this requirement? answered 29.08.2019 at 22:24 Lieu Vo ok let's try it the other way around. What is the goal you are trying to achieve? I mean having logs in separate files is a good idea. But what is the value you are trying to build?
(30.08.2019 at 07:44)
Reguel Werme... ♦♦
|
I do not see an easy solution for this. As the service name is not part of the logger name. Otherwise you could easily route them into files as shown here: https://developer.axonivy.com/doc/latest/EngineGuideHtml/monitoring.html#d5e3581 What you can do:
answered 29.08.2019 at 07:42 Reguel Werme... ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 29.08.2019 at 04:11
Seen: 1,972 times
Last updated: 02.09.2019 at 08:43