Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#30592 closed defect (implemented)

How do I make stem log info-level to test/data/tor_log?

Reported by: teor Owned by: atagar
Priority: Medium Milestone: Tor: 0.4.1.x-final
Component: Core Tor/Stem Version:
Severity: Normal Keywords: tor-ci-fail-sometimes
Cc: Actual Points: 0.1
Parent ID: #30591 Points: 0.1
Reviewer: Sponsor: Sponsor31-can

Description

I ran the stem tests with --log info, but that just makes stem log info-level errors to the terminal. It doesn't change test/data/tor_log.

Child Tickets

Change History (8)

comment:1 Changed 3 months ago by atagar

Hi teor. The log level of tor_log is not presently configurable...

https://gitweb.torproject.org/stem.git/tree/test/runner.py#n72

I'd be happy to go in several directions with this. What is your preference?

  • Change the default log runlevel to info.
  • Provide a config option or environment variable to customize the runlevel.
  • Provide a config option to add arbitrary torrc lines (this way you could add 'Log info /my/path' or customize the test torrc in any way you'd like).

comment:2 in reply to:  1 Changed 3 months ago by teor

Replying to atagar:

  • Provide a config option or environment variable to customize the runlevel.

Let's provide a way to customise the log level in the file.

If we ever need arbitrary torrc lines, we can do that change later.

comment:3 in reply to:  1 Changed 3 months ago by teor

Replying to atagar:

  • Provide a config option to add arbitrary torrc lines (this way you could add 'Log info /my/path' or customize the test torrc in any way you'd like).

I just talked with nickm on IRC. We want to capture all the controller messages from tor.

So that means we'd like "Log [control]debug /path/to/file", or any other arbitrary torrc line.

comment:4 Changed 3 months ago by teor

Does stem have a way to log all it's control messages?

comment:5 Changed 3 months ago by atagar

Hi teor. Chewing on this a bit I decided to make two changes...

  1. Stem now empties its tor data directory between runs
  2. Integ test tor logging is now at the debug runlevel

If you disagree with either of these changes or this doesn't do the trick for ya then just let me know.

Does stem have a way to log all it's control messages?

Yup. As mentioned on irc trace runlevel logging provide request/reply logs for its control port. That is to say, exactly what we send and receive...

% ./run_tests.py --integ --log TRACE
05/27/2019 16:02:23 [TRACE] Sent to tor: PROTOCOLINFO 1
05/27/2019 16:02:23 [TRACE] Received from tor:
  250-PROTOCOLINFO 1
  250-AUTH METHODS=NULL
  250-VERSION Tor="0.4.1.0-alpha-dev"
  250 OK
05/27/2019 16:02:23 [TRACE] Sent to tor: AUTHENTICATE
05/27/2019 16:02:23 [TRACE] Received from tor: 250 OK
05/27/2019 16:02:23 [TRACE] Sent to tor: SETEVENTS STATUS_SERVER SIGNAL CONF_CHANGED
05/27/2019 16:02:23 [TRACE] Received from tor: 250 OK
... etc...

Feel free to reopen if you need anything else.

comment:6 Changed 3 months ago by atagar

Resolution: implemented
Status: newclosed

comment:7 Changed 3 months ago by teor

Actual Points: 0.1
Points: 0.1

comment:8 Changed 3 months ago by teor

Sponsor: Sponsor31-can

Setting as sponsor 31 can, because we use these jobs to make sure our refactoring works.

Note: See TracTickets for help on using tickets.