3

I can see advantages to both.

human readable

  • quickly solving a problem is easy, because you can easily find out what's going on
  • when you make a computer readable form, you're usally also sticking to a certain schema, this limits you when your application changes

computer readable

  • easier to automatically analyze logs to improve the site.
4

1 回答 1

4

Unfortunately, there's no simple answer to this. It will depend on how you expect the log files to be used. If the log files will be used in ways that would really benefit from a human looking at them and a way that would really benefit from a computer reading them, you could make two different log files. Or you could have something that is computer readable and then have a script that can take the computer-readable log file and output something easily human readable when needed.

于 2012-07-29T20:12:03.833 回答