良好的远程应用程序日志记录/监控软件
我确信这已经完成了,但谷歌并没有帮助我 - 我被类似但不同问题的答案淹没了:
我的老板要求我找到或构建一个系统来记录我们的信息亭安装的使用情况。我们使用 java、本机 c++、c#、python 以及 Unity 等工具构建信息亭。我们看到另一家与我们合作的公司使用一个简单的系统,其中包含数据的后调用被记录在远程站点上以供稍后检查。该系统允许应用程序程序员决定消息的内容,并能够根据程序员的意愿将其分配给调试或发布。
日志输出的一个示例可能是:
[Debug] 28-11-2011 10:10:20 Kiosk1: Pulse
[Debug] 28-11-2011 10:10:25 Kiosk1: Button pressed
[Debug] 28-11-2011 10:10:45 Kiosk1: Widget used
[Debug] 28-11-2011 10:11:20 Kiosk1: Pulse
我查看了 log4net/log4j,但这似乎与本机 c++ 或 python 不兼容。我可能在那里弄错了:)。
有谁知道有一个像这样工作的系统,或者适合从如此不同的语言进行日志记录的系统?如果没有,我可以很容易地编写自己的。我只是不想支持它:)
问候, 史蒂夫
I'm sure this has already been done, but Google isn't helping me - I'm getting swamped with answers for similar but different problems:
My boss has asked me to find or build a system that will log uses of our kiosk installations. We build kiosks using java, native c++, c#, python and using things like Unity. We saw another company we worked with using a simple system where a post call with data was logged on a remote site to be checked later. The system allowed the application programmer to decide the contents of the message, and was able to allocate it to either debug or release according to the programmer's wishes.
An example of the log output might be:
[Debug] 28-11-2011 10:10:20 Kiosk1: Pulse
[Debug] 28-11-2011 10:10:25 Kiosk1: Button pressed
[Debug] 28-11-2011 10:10:45 Kiosk1: Widget used
[Debug] 28-11-2011 10:11:20 Kiosk1: Pulse
I looked at log4net/log4j, but that doesn't seem to be compatible with native c++ or python. I'm probably mistaken there :).
Does anyone know of a system that works like this, or that will otherwise be suitable for logging from such diverse languages? If not, I can write my own easily enough. I just don't want to have to support it :)
Regards,
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我不确定,但我认为您正在寻找的是 SPLUNK。这样就可以解析几乎每条日志并统一显示。它可以监听端口,通过轮询读取日志文件,并解析和索引您在任何时间点抛出的任何内容。
您可以使用它来设置您自己的多语言日志服务器/系统。我们一直在使用它,它可以在我们的分布式环境中无缝运行。
I'm not sure, but I think what you're looking for is SPLUNK. This can parse almost every log and display it in a unified manner. It can listen to ports, read log files via polling and parses and indexes anything you throw at any point of time.
You can use this to set up you're own multi-language logging server/system. We've been using this and it seamlessly works in our distributed environment.
虽然编写专门的日志记录后端来处理本地日志记录和网络日志记录是很有可能的,但我建议不要这样做。原因是网络延迟可能太长,因此它要么停止您的应用程序,要么如果使用另一个进程/线程进行实际的网络推送,则日志消息可能会排队。
一个更简单的解决方案是使用安排每天运行一次或几次的小脚本,并将日志文件复制到远程位置。
While writing a specialized logging backend to handle logging both locally and to the network is quite possible, I would advise against it. The reason being that network latency can be to long so it either stops your application, or logging messages can be queued up if using another process/thread to do the actual network pushing.
A much simpler solution is to use little script that is scheduled to run once or a couple of times per day, and that copies the log file(s) to the remote location.
对于 C++,我强烈推荐 Poco 日志记录。它允许您使用属性文件等指定格式和日志级别/输出。
For C++ I highly recommend Poco logging. It allows you to specify the formatting and log level/output using e.g. a properties file.
python 中包含的 python 日志库 与 log4net 非常相似,所以如果您是习惯了这些,另一个就会很容易理解,但他们不共享代码(据我所知)
the python logging library that is included with python is quite similar to log4net, so if you are used to those, the other will be quite easy to understand, but they do not share code (as far as I know)
将 log4j/log4net 与套接字附加程序一起使用或通过 rsyslog 远程记录。
Use log4j/log4net with a socket appender or log remotely via rsyslog.
您可能对网络信标之类的内容感兴趣。我知道这并不完全是您所要求的,但您应该像网络开发人员一样考虑它:了解用户在做什么是件好事。
You might be interested in something like web beacons. I know it's not exactly what you're asking for, but you ought to think about it for the same reason that web developers do: it's good to know what users are doing.