1

Using the python http.server (see https://docs.python.org/3/library/http.server.html), I am running this as a systemd service. In order to get the output of the server, I define StandardOutputand StandardError as appending to a log file. There I find entries like this (anonymized):

<IP address> - - [18/May/2023 21:58:54] "GET <path of HTML file> HTTP/1.1" 304 -

Now I would like to change the format of these entries:

  • between the two left hyphens I would like to get the name of the server (in this case http.server) and
  • get date and time in the ISO format (yyyy-mm-dd hh:mm:ss). How can I manage this?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.