Skip to content

How to get route info logs from FastAPI application #1112

Answered by tippexs
ashrafguitoni asked this question in Support
Discussion options

You must be logged in to vote

Hi ---no-daemon is fine. The access_log can be pointed to stdout. Your configuration will look like

{
  "applications": {
    "fastapi": {
      "type": "python 3.9",
      "working_directory": "/app",
      "home": "/opt/venv/",
      "path": ["/app"],
      "module": "ABC.common.server",
      "callable": "APP"
    }
  },
  "listeners": {
    "*:8877": {
      "pass": "applications/fastapi"
    }
  },
  "access_log": "/dev/stdout"
}

As you are running on a quite old version (please consider to update to 1.31.1) the docs are pointing to the latest version. With 1.26 there was no configurable access log format. This was introduces in 1.28.

Update: My minimal Docker-Test:
Unit configuratio…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
8 replies
@ashrafguitoni
Comment options

@ashrafguitoni
Comment options

@ashrafguitoni
Comment options

@tippexs
Comment options

Answer selected by ashrafguitoni
@ashrafguitoni
Comment options

@callahad
Comment options

@ashrafguitoni
Comment options

@ashrafguitoni
Comment options

Comment options

You must be logged in to vote
2 replies
@ashrafguitoni
Comment options

@callahad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants