mrjackwills / oxker

A simple tui to view & control docker containers
MIT License
727 stars 24 forks source link

[NEW FEATURE] include stderr in logs #48

Closed iloveitaly closed 1 month ago

iloveitaly commented 2 months ago

Is your feature request related to a problem? Please describe. If the container is failing you can't see it from the log view.

Describe the solution you'd like Include stderr in the log view.

Describe alternatives you've considered Quit oxker, grab container sha, then use docker logs SHA

Additional context

mrjackwills commented 2 months ago

Yeah it should probably do that.

Are you able to point me in the direction of a container/Dockerfile that I can run which will just fail and write to stderr? Would make developing & testing the feature substantially easier.

vincentmasse commented 2 months ago

You can print to stderr with this python script and docker file.

FROM python:latest

COPY print_err.py root/app.py

CMD ["python", "root/app.py"]
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

if __name__ == "__main__":
    print("This print to stdout")
    eprint("This should print to stderr")
iloveitaly commented 1 month ago

This is done! Thank you!