Is there a way to customize Dockers' log?

Hi there,

We are collecting the logs of our applications. Since we containerize our applications, the way to collect logs needs a little bit changes.

We log via the Docker Logging Driver:

  1. Application output the logs to container’s stdout and stderr
  2. Using json-file logging driver, docker output logs to json file on the host machine
  3. Service on the host machine forwards the log files.

But the logs from Docker has additional information which unnecessary and make the forward step complicated because we need to remove those additional information before forward.

For example, the log from Docker is as below, but all we want is the value of log field. Is there a way to customize log format and only output the information wanted?

{“log”:"{“level”: “info”,“message”: “data is correct”,“timestamp”: “2017-08-01T11:35:30.375Z”}\r\n",“stream”:“stdout”,“time”:“2017-08-03T07:58:02.387253289Z”}

Thanks,
Michelle