问题描述
我不确定是否被询问,但是找不到类似的东西.
I'm not sure if it was asked, but I couldn't find anything like this.
我的程序将一个简单的.txt文件用于日志目的,它只是创建/打开一个文件并追加行.
My program uses a simple .txt file for log purposes, It just creates/opens a file and appends lines.
一段时间后,我开始记录很多活动,因此文件变得太大且难以读取.我知道,这样做不是写方法,但我只需要一个可读的文件即可.
After some time, I started to log quite a lot of activities, so the file became too large and hardly readable. I know, that it's not write way to do this, but I simply need to have a readable file.
所以我想也许日志文件有一种简单的文件格式,并且可以查看它的软件,或者您对此问题还有其他建议吗?
So I thought maybe there's a simple file format for log files and a soft to view it or if you'd have any other suggestions on this question?
谢谢您的帮助.
更新:
它是Access 97应用程序.我正在记录一些活动,例如表单加载,SELECT/INSERT/UPDATE到MS SQL Server ...日志文件不是很大,我只写操作的持续时间,所以我需要一种简单的方法来完成此操作.
It's access 97 application. I'm logging some activities like Form Loading, SELECT/INSERT/UPDATE to MS SQL Server ...The log file isn't really big, I just write the duration of operations, so I need a simple way to do this.
日志文件是在用户计算机上创建的.它用于监视目的,记录一些活动的持续时间.
The Log file is created on a user's machine. It's used for monitoring purposes logging some activities' durations.
是否可以查看使用现有工具突出显示的那种简单日志文件?
简而言之,我想:
1)将诸如'CurrentTime''ActivityName''持续时间(以毫秒为单位)" (可能是诸如查询字符串之类的一些其他信息)之类的内容写入文件.
1) Write smth like "'CurrentTime' 'ActivityName' 'Duration in milliseconds' " (maybe some additional information like query string) into a file.
2)使用工具将其打开,并以突出显示或更具可读性的方式查看它.
2) Open it with a tool and view it highlighted or somehow more readable.
答案::我找到了一个不错的工具来完成我想要的一切.检查我的答案.
ANSWER: I've found a nice tool to do all I've wanted. Check my answer.
推荐答案
我在这里找到了.筛选比 mtail 更好.有一个突出显示的选项,只需添加一个字符串即可,该应用程序美观且易读.您可以根据需要自定义列.
I've found it here. Filter is better, than in mtail. There's an option of highlighting just adding a string and the app is nice and readable. You can customize columns as you like.
这篇关于一种简单的日志文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!