Log with timestamp


#1

Hello,
I want to write all log to standard error and standard output with a timestamp prefix: where I have to modify?

Thanks in advance.


#2

Hi,

You can either write our own script, pipe mitmdump’s output through some unix tool that adds timestamps, or modify https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/addons/dumper.py. :slight_smile:


#3

Thank you for your response.
I try to modify the class you linked insert the command
text = datetime.today().isoformat() + ' ' + text;
before the line
click.secho(text, file=self.outfp, **style)
in the method echo
but with mitmdump I don’t see any difference in the standard output.
What can I do?