What to write into log file?

后端 未结 7 1392
面向向阳花
面向向阳花 2020-12-28 09:28

My question is simple: what to write into a log. Are there any conventions? What do I have to put in?

Since my app has to be released, I\'d like to have friendly log

相关标签:
7条回答
  • 2020-12-28 10:09

    timeStamp i.e. DateTime YYYY/MM/DD:HH:mm:ss:ms User Thread ID Function Name Message/Error Message/Success Message/Function Trace

    Have this in XML format and you can then easily write a parser for it.

    <log>
      <logEntry DebugLevel="0|1|2|3|4|5....">
        <TimeStamp format="YYYY/MM/DD:HH:mm:ss:ms" value="2009/04/22:14:12:33:120" />
        <ThreadId value="" />
        <FunctionName value="" />
        <Message type="Error|Success|Failure|Status|Trace">
          Your message goes here
        </Message> 
      </logEntry>
    </log>
    
    0 讨论(0)
提交回复
热议问题