question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support full logging to file

See original GitHub issue

Description

Outside of any further modifications to the stdout/stderr output controls, it would be very handy to log everything to a file; this would give users another alternate channel for debugging their fabfiles without having to wrestle with what they see at runtime.

Main question is whether to output things as if debug were set, by default. Thinking to leave it off at first, and have a simple flag/option to turn it on, perhaps --log-debug.

Where to log to? By default I’d say user’s cwd, though that can get annoying (like “pipturds”, i.e. pip-log.txt files that pip drops everywhere.) Unfortunately there’s no other great standard location, so perhaps turn logging-to-file off by default? Either way, allow override, say via --log-location or similar.

Unsure whether it makes any sense to utilize the logging module’s concept of levels; the only place I can see it being useful at all is for the debug stuff, but we currently think of debugging as modifying output instead of adding to it – which doesn’t mesh with how logging works. So possibly best to just stick everything in, say, INFO for now, then tweak later if necessary.


Potential modules:

  • stdlib logging
    • Pros: stdlib, well known/documented
    • Cons: kind of byzantine/complicated to use
  • Logbook
    • Pros: Armin
  • Twiggy
  • Others?

Originally submitted by Jeff Forcier (bitprophet) on 2009-09-06 at 10:57am EDT

Relations

  • Related to #101: ANSI Color support
  • Duplicated by #135: All output should be sent through logging module
  • Related to #151: Make fabfile print() statements controllable via output controls
  • Related to #163: Formattable output prefix.
  • Related to #244: Add additional, verbose-only output when connecting
  • Related to #71: Consider adding “global”/per-task capture of run/sudo/local stdout/stderr
  • Duplicated by #333: Use logger() instead of print()

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:31 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
guhuajuncommented, Aug 8, 2017

Sorry for replying a closed issue. I am using https://github.com/algrebe/python-tee to redirect stdout to a file. Hope this project can help others.

0reactions
bitprophetcommented, Sep 7, 2015

Rolling this into pyinvoke/invoke#15, updated its desc with a bunch of thoughts too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support logs
Gathers the set of support log file data from the controller, or in a team environment, all active controllers in the team, and...
Read more >
What is the Enable logging (troubleshooting) option?
Type of log file Subfolder Outlook 2013 Outlook 2010 Outlook 2007 Outlook Autodiscover Temp No Yes Yes Exchange ActiveSync Temp/EASLogFiles Yes No No Availability service Temp/OlkAS...
Read more >
Apache Logging Basics - The Ultimate Guide To Logging
By default, Apache stores access and error logs in separate files on the server. ... You can find a full list of fields...
Read more >
Configuring Logging - Quarkus
It outputs all log events to a file on the application's host. It supports log file rotation. For details of its configuration options,...
Read more >
Packaging and sending log files from the System ... - IBM
To package and send IBM Spectrum Control log files, you must be assigned to the Administrator role and open a support ticket with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found