This question is around logging. I need to implement a custom log utils which will be used across multiple services and . this should be capable of logging few attributes (the service name, endpoint uri accessed, etc) in a log event by default without the utility user need to specifying these.
Eg. user might say
mylogutil.debug("order has been placed")
however, the output should be...
DEBUG|service-one|/api/orders|usweridone|oder_id-1| order has been placed
the reason behind this is except the log message other attributes can be extracted from the incoming request by a filter, from a properties file or an env variable etc.. and every logger statement entry doesn't have to contain this.
Please help me with a fair way to do this.