A simple log file format

后端 未结 8 1150
广开言路
广开言路 2021-01-12 07:16

I\'m not sure if it was asked, but I couldn\'t find anything like this.

My program uses a simple .txt file for log purposes, It just creates/opens a file and appends

8条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 07:57

    If this is a program, you might investigate apache logging libraries (http://logging.apache.org/) Out of the box, they'll give you a decent logging format out of the box. They're also customizable, so you can simplify your parsing job.

    If this is a script, see some of the other answers.

提交回复
热议问题