简体   繁体   English

跟踪多个系统上的用户

[英]Tracking users on multiple systems

I hava a WebApp that authenticates the users and each of their main actions are recorded in the log files.However those actions call some webservice the might call other webservices on other machines. 我有一个WebApp可以对用户进行身份验证,他们的每个主要操作都记录在日志文件中,但是这些操作调用了某些Web服务,可能调用了其他计算机上的其他Web服务。

I would like to be able to track in the logs of those machines each user request because I am allowed to add more logs but not to change the signature of the service by adding a new field. 我希望能够跟踪每个用户请求的那些机器的日志,因为允许我添加更多日志,但不能通过添加新字段来更改服务的签名。

I was thinking to use an UUID (correlation id) and Http header to carry it. 我当时正在考虑使用UUID(相关ID)和Http标头来携带它。

Do you know another solution ? 您知道其他解决方案吗?

Thanks 谢谢

Not sure if you are using Spring, but with Spring you could intercept methods and log stuff in there, and you could do it without changing your signatures at all. 不确定是否使用Spring,但是使用Spring可以拦截方法并将日志记录在其中,并且完全可以在不更改签名的情况下进行操作。

Check this answer, may help you How to intercept a method in java 检查此答案,可能对您帮助如何在Java中拦截方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM