跨多个Web服务器日志 [英] Logging across multiple web servers

查看:185
本文介绍了跨多个Web服务器日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道人们如何应对跨多个Web服务器日志记录。例如。假设有2个网络服务器和用户会话期间一些事件从一个,一些来自其它服务。你会如何​​去记录从会话连贯的事件在一个地方(不e.g.creating单点故障)?假设我们使用的是:ASP.Net MVC,log4net的

I would like to know how people dealing with logging across multiple web servers. E.g. Assume there are 2 webservers and some events during the users session are serviced from one, some from the other. How would you go about logging events from the session coherently in one place (without e.g.creating single points of failure)? Assuming we are using: ASP.Net MVC, log4net.

还是我在看这个错误的方式 - 我应该记录单独再后来合并

Or am I looking at this the wrong way - should I log seperately and then merge later?

谢谢,

取值

更新

请还假设负载平衡器将不能保证一个会话粘一台服务器。

Please also assume that the load balancers will not guarantee that a session is stuck to one server.

推荐答案

您肯定想你的Web服务器在本地登录,而不是在网络上。你不希望潜在的网络中断,以prevent伐木作业,你不想要记录的网络操作的额外开销。你应该已经日志旋转设置和所有Web服务器时钟的同步。当日志旋转到一个新的文件滚动更新日志文件,具有运到一个共同的目的地,他们可以合并每个Web服务器完成的日志文件。我不是一个.NET的家伙,但你应该能够发现软件有合并IIS日志(或任何Web服务器您正在使用)。然后,你分析合并日志。这种策略是最优的,除非你需要实时日志分析的情况。你做?可能不会。这是相当弹性的故障(假设你有多余的磁盘),因为如果一台服务器出现故障,只需重新启动并重新处理任何日志船,日志合并或日志被打断的分析操作。

You definitely want your web servers to log locally rather than over a network. You don't want potential network outages to prevent logging operations and you don't want the overhead of a network operation for logging. You should have log rotation set up and all your web servers clock's synced. When log rotation rolls your log files over to a new file, have the completed log files from each web server shipped to a common destination where they can be merged. I'm not a .net guy but you should be able to find software out there to merge IIS logs (or whatever web server you're using). Then you analyze the merged logs. This strategy is optimal except in the case that you need real-time log analysis. Do you? Probably not. It's fairly resilient to failures (assuming you have redundant disks) because if a server goes down, you can just reboot it and reprocess any log ship, log merge or log analysis operations that were interrupted.

这篇关于跨多个Web服务器日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆