I'm trying to make an HTTP Server from scratch and wanted to write the log in a text file so I created this function.

```
    def do_LOG(self, addr, request):
    path = 'log/logging.txt'
    host = addr[0]
    port = addr[1]
    method = request[:4]
    headers = request.split('\n')
    filename = headers[0].split()[1]

    f = open(path, "a+")
    f.writelines('Server used: ' + host + '\n'+'Port used: ' + port + '\n'+'Method Served: ' + method + '\n'+'Filename: ' + filename + '\n\n')
    f.close()
    return

```

This function only creates a file but is not able to write in the file. I'm overriding this function from the parent class.This is the definition in the parent class.

```
    def do_LOG(self, addr, request):
      return

```