Ticket #3534 enhancement closed fixed

Opened 5 years ago

Last modified 5 years ago

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:


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


Changed 5 years ago by radix

  • branch set to branches/configure-log-observer-in-tacs-3534
  • branch_author set to radix

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


Changed 5 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.


Changed 5 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!



Changed 5 years ago by radix

  • owner radix deleted
  • keywords review added

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.


Changed 5 years ago by therve

  • owner set to radix
  • keywords review removed

Awesome, please merge.


Changed 5 years ago by radix

  • status changed from new to closed
  • resolution set to fixed

(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.


Changed 3 years ago by <automation>

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