LOG文件格式 [英] Format of LOG file

查看:96
本文介绍了LOG文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日志文件的正确格式是什么?我的意思是我们在项目的日志文件中包括的所有详细信息

What is the correct format of log file? I mean what all details we include in Log file of a project

推荐答案

saloni15写道:
saloni15 wrote:

日志文件的正确格式是什么?

What is the correct format of log file?



没有这样的固定/指定格式!通常使用" txt "格式,因为它易于登录并且易于阅读.




There is no such fixed/specified format! Usually ''txt'' format is used as its easy to loginto and is easily readable.


saloni15写道:
saloni15 wrote:

表示我们在项目日志文件中包含的所有详细信息是什么

mean what all details we include in Log file of a project



您喜欢的任何细节!异常,某种警报,执行跟踪...



Any detail you like to! Exceptions, alerts of some kind, Execution trace...


如上一个答案所述,没有固定格式.
如果您使用数据库或日志文件,请至少为您记录的每一行添加一个datetimestamp.

要记录的东西:
*所有异常和错误.
*您执行的所有SQL语句
*方法的开始和结束,最好使用传入或返回的参数值. (还给出了易于检索的方法名称)
*可能对调试有用的任何东西,例如.计算的局部变量.登录状态. (请勿登录密码!)

您还可以添加调试级别1-5,这将记录更多信息,具体取决于您传递的参数.
as mentioned in previous answer there is no fixed format.
if you use a database or logfile, at least add a datetimestamp for each line you log.

things to log:
* ALL exceptions and errors.
* ALL SQL statements you execute
* beginning and end of methods, preferably with the values of the arguments passed in or returned. (also give the name of the method for easy retrievel)
* anything that might be helpful for debugging, eg. calculated local variables. login status. (do not log the password !)

You could also add a debug level, 1 - 5 that will log more information depending on the argument you pass.


这篇关于LOG文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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