Opened 5 months ago

Closed 5 months ago

#34061 closed defect (fixed)

Reduce amount of GetTor logging

Reported by: cohosh Owned by: cohosh
Priority: Low Milestone:
Component: Applications/GetTor Version:
Severity: Normal Keywords: easy, starter
Cc: traumschule, hiro, gaba, phw, cohosh Actual Points:
Parent ID: Points: .5
Reviewer: phw Sponsor:

Description

We're logging at a very high level (looks like at debug), and outputting frequent successes when we only really need to be logging errors.

For example: a successfully processed email in log/email_parser.log outputs:

2020-04-27 23:18:53+0000 [-] Log opened.
2020-04-27 23:18:53+0000 [process email] New email request received.
2020-04-27 23:18:53+0000 [process email] Reading new email.
2020-04-27 23:18:53+0000 [-] Database query executed successfully.
2020-04-27 23:18:53+0000 [email parser] Building email message from string.
2020-04-27 23:18:53+0000 [email parser] Normalizing and validating FROM email address.
2020-04-27 23:18:53+0000 [email parser] Email address normalized and validated.
2020-04-27 23:18:53+0000 [email parser] Request from [hid]
2020-04-27 23:18:53+0000 [email parser] Found request for links.
2020-04-27 23:18:53+0000 [-] Database query executed successfully.
2020-04-27 23:18:53+0000 [-] Main loop terminated.
2020-04-27 23:18:53+0000 [process email] Email request processed.

and in log/gettor.log:

2020-04-29T14:46:51+0000 [gettor#info] Getting links for windows is.
2020-04-29T14:46:51+0000 [-] Database query executed successfully.
2020-04-29T14:46:51+0000 [gettor#info] Sending links to [hid].
2020-04-29T14:46:51+0000 [gettor#debug] Creating plain text email
2020-04-29T14:46:51+0000 [gettor#debug] Calling asynchronous sendmail.
2020-04-29T14:46:51+0000 [twisted.mail.smtp.ESMTPSenderFactory#info] Starting factory <twisted.mail.smtp.ESMTPSenderFactory object at 0x7f0bba74b780>
2020-04-29T14:46:51+0000 [gettor#info] Email sent successfully.
2020-04-29T14:46:51+0000 [twisted.mail.smtp.ESMTPSenderFactory#info] Stopping factory <twisted.mail.smtp.ESMTPSenderFactory object at 0x7f0bba74b780>
2020-04-29T14:46:51+0000 [-] Database query executed successfully.
2020-04-29T14:46:51+0000 [-] Database query executed successfully.

We could reduce this to one log message at most. Especially since this information *should* be captured in the stats database.

Child Tickets

Change History (5)

comment:1 Changed 5 months ago by cohosh

Owner: set to cohosh
Status: newassigned

Getting moving on this will help us monitor the logs for critical errors more easily.

comment:2 Changed 5 months ago by cohosh

This assigns more appropriate levels to existing log messages and sets the default log level to "info": https://gitlab.torproject.org/torproject/anti-censorship/gettor-project/gettor/-/merge_requests/7

comment:3 Changed 5 months ago by cohosh

Status: assignedneeds_review

comment:4 Changed 5 months ago by phw

Reviewer: phw
Status: needs_reviewmerge_ready

Looks good to me!

comment:5 Changed 5 months ago by cohosh

Resolution: fixed
Status: merge_readyclosed

Merged and deployed.

Note: See TracTickets for help on using tickets.