Opened 6 years ago

Closed 6 years ago

#3534 enhancement closed fixed (fixed)

allow .tac files to configure logging behavior

Reported by: radix Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/configure-log-observer-in-tacs-3534
(diff, github, buildbot, log)
Author: radix Launchpad Bug:

Description

It would be useful to allow .tac files to configure logging behavior by specifying in the .tac file the observer to be used.

Of course, twistd should also have some sort of user interface for customizing logging behavior, which is being tracked in #638.

Change History (8)

comment:1 Changed 6 years ago by radix

  • Author set to radix
  • Branch set to branches/configure-log-observer-in-tacs-3534

(In [25356]) Branching to 'configure-log-observer-in-tacs-3534'

comment:2 Changed 6 years ago by radix

  • Keywords review added
  • Owner radix deleted

Ok, here's basically the same branch as in #638 but without the --logger stuff.

Please review.

comment:3 Changed 6 years ago by therve

  • Keywords review removed
  • Owner set to radix
  1. Some flakes:
    doc/core/examples/twistd-logging.tac:10: 'sys' imported but unused
    twisted/application/app.py:9: 'namedAny' imported but unused
    
  2. In application.xhtml, the example you give is correct, but doesn't bring much against the -l option of twistd. Maybe you could use a DailyLogFile to show an advantage?
  3. The twistd-logging.tac example is nice, but it shows bad usage of logging: it doesn't call flush on the log file, and it doesn't use untilConcludes.
  4. The example tac file needs to be referenced in examples/index.xhtml

That's it!

comment:5 Changed 6 years ago by radix

  • Keywords review added
  • Owner radix deleted

Thanks therve.

  1. fixed
  2. ok, I changed it to use DailyLogFile.
  3. Ok, I made it call flush and use untilConcludes on both the write and flush call, and even explained why.
  4. fixed, and organized a new Logging section in the example index.

comment:6 Changed 6 years ago by therve

  • Keywords review removed
  • Owner set to radix

Awesome, please merge.

comment:7 Changed 6 years ago by radix

  • Resolution set to fixed
  • Status changed from new to closed

(In [25379]) Merge configure-log-observer-in-tacs-3534

Author: radix
Reviewer: therve
Fixes: #3534

Now it's possible to specify the log observer used by twistd in a .tac
file by setting the ILogObserver component on the application.

comment:8 Changed 3 years ago by <automation>

  • Owner radix deleted
Note: See TracTickets for help on using tickets.